Saltar al contingut principal
GET

Obtenir nivells d'estoc d'un magatzem

Scope:inventory:warehouses.read
https://api.holded.com/api/v2/warehouses/{warehouseId}/stock

Retorna els nivells d'estoc de tots els productes emmagatzemats en un magatzem específic.

Paràmetres

Paràmetres de ruta

warehouseIdstringobligatori

ID 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/json
object
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/json
403Permisos insuficientsapplication/json
404Magatzem no trobatapplication/json
429Límit de sol·licituds exceditapplication/json