GET
Obtenir nivells d'estoc d'un magatzem
Scope:
inventory:warehouses.readhttps://api.holded.com/api/v2/warehouses/{warehouseId}/stockRetorna els nivells d'estoc de tots els productes emmagatzemats en un magatzem específic.
Paràmetres
Paràmetres de ruta
warehouseId
stringobligatoriID del magatzem (ObjectId hexadecimal de 24 caràcters)
Petició
python
import requests
url = "https://api.holded.com/api/v2/warehouses/{warehouseId}/stock"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(url, headers=headers)
print(response.json())Respostes
Resposta
json
{
"items": [
{
"product_id": "string",
"variant_id": "string",
"stock": "15.3"
}
],
"cursor": "string",
"has_more": false
}Respostes exitoses
200Estoc del magatzemapplication/jsonobject
items[]object[]
product_idstring
Identifier of the product
variant_idstring | null
Identifier of the product variant, if applicable
stockstring
Current stock quantity in this warehouse as a decimal string
cursorstring | null
has_moreboolean
Respostes d'error
401API key no vàlida o no proporcionadaapplication/json403Permisos insuficientsapplication/json404Magatzem no trobatapplication/json429Límit de sol·licituds exceditapplication/json