Saltar al contenido principal
GET

Obtener el stock en tránsito de un producto

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

Devuelve el stock en tránsito de un producto, incluyendo los detalles de cada movimiento por documento. Cada movimiento representa un documento (pedido de compra, pedido de venta u orden de producción) que afecta al stock en tránsito del producto.

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/transit"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

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

Respuestas

Respuesta

json
{
  "product_id": "507f1f77bcf86cd799439011",
  "in_transit": "10",
  "compromised": "5",
  "movements": [
    {
      "document_id": "string",
      "document_type": "order",
      "movement_type": "compromise",
      "total": "10",
      "date": "2024-01-15T10:30:00Z",
      "variants": [
        {
          "variant_id": "...",
          "virtual": "...",
          "real": "...",
          "transit": "..."
        }
      ]
    }
  ]
}

Respuestas exitosas

200Stock en tránsito del productoapplication/json
object
product_idstringrequired

Unique identifier of the product

in_transitstringrequired

Net incoming stock (in transit minus compromised) as a decimal string

compromisedstringrequired

Stock committed to pending sales or production orders as a decimal string

movements[]object[]required

Document movements contributing to the transit totals

document_idstringrequired

Identifier of the source document

document_typestringrequired

Type of the source document (e.g. salesorder, order, productionorder)

movement_typestringrequired

Whether this movement is incoming or compromise

Enum:compromiseincoming
totalstringrequired

Total quantity of this movement as a decimal string

datestring<date-time>required

Date of the movement in ISO 8601 format

variants[]object[]required

Per-variant breakdown of the movement

Respuestas de error

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