Saltar al contenido principal
GET

Obtener la disponibilidad de stock de un producto

Scope:inventory:products.read
https://api.holded.com/api/v2/products/{productId}/stock

Devuelve la disponibilidad de stock de un producto, desglosada en cantidades totales, disponibles, reservadas y en tránsito, así como el stock físico almacenado en cada almacén.

Parámetros

Parámetros de ruta

productIdstringobligatorio

ID del producto (ObjectId hexadecimal de 24 caracteres)

Petición

python
import requests

url = "https://api.holded.com/api/v2/products/{productId}/stock"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

response = requests.get(url, headers=headers)
print(response.json())

Respuestas

Respuesta

json
{
  "product_id": "507f1f77bcf86cd799439011",
  "has_stock": false,
  "total": "15.3",
  "available": "10",
  "reserved": "5.3",
  "in_transit": "2",
  "warehouses": [
    {
      "warehouse_id": "string",
      "stock": "5",
      "variants": [
        {
          "variant_id": "...",
          "stock": "..."
        }
      ]
    }
  ]
}

Respuestas exitosas

200Disponibilidad de stock del productoapplication/json
object
product_idstringrequired

Unique identifier of the product

has_stockbooleanrequired

Whether the product has stock tracking enabled

totalstringrequired

Total stock across all warehouses as a decimal string

availablestringrequired

Stock available for sale (total minus reserved) as a decimal string

reservedstringrequired

Stock committed to pending sales orders as a decimal string

in_transitstringrequired

Stock incoming from purchase orders as a decimal string

warehouses[]object[]required

Physical stock per warehouse

warehouse_idstringrequired

Identifier of the warehouse

stockstringrequired

Stock stored in this warehouse as a decimal string

variants[]object[]optional

Stock per variant in this warehouse. Only present for products with variants (variants, lots, serialnumbers).

Respuestas de error

401API key inválida o no proporcionadaapplication/json
403Permisos insuficientesapplication/json
404Producto no encontradoapplication/json
429Límite de solicitudes excedidoapplication/json