Obtenir l'estoc en trànsit d'un producte
inventory:products.readhttps://api.holded.com/api/v2/products/{productId}/stock/transitRetorna l'estoc en trànsit d'un producte, incloent-hi els detalls de cada moviment per document. Cada moviment representa un document (comanda de compra, comanda de venda o ordre de producció) que afecta l'estoc en trànsit del producte.
Paràmetres
Paràmetres de ruta
stringobligatoriID del producte (ObjectId hexadecimal de 24 caràcters)
Petició
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())Respostes
Resposta
{
"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": "..."
}
]
}
]
}Respostes exitoses
200Estoc en trànsit del producteapplication/jsonUnique identifier of the product
Net incoming stock (in transit minus compromised) as a decimal string
Stock committed to pending sales or production orders as a decimal string
Document movements contributing to the transit totals
Identifier of the source document
Type of the source document (e.g. salesorder, order, productionorder)
Whether this movement is incoming or compromise
compromiseincomingTotal quantity of this movement as a decimal string
Date of the movement in ISO 8601 format
Per-variant breakdown of the movement
Respostes d'error
401API key no vàlida o no proporcionadaapplication/json403Permisos insuficientsapplication/json404Producte no trobatapplication/json429Límit de sol·licituds exceditapplication/json