Get stock in transit for a product
Scope: inventory:products.read https://api.alladdin.com/api/v2/products/{productId}/stock/transit
Returns the stock in transit for a product, including per-document movement details.
Each movement represents a document (purchase order, sales order or production order) that affects the product's transit stock. Incoming movements come from purchase orders. Compromised movements come from sales or production orders.
For pack products, the response aggregates transit data from all component products.
Parameters
Path parameters
productId string required
Product ID (24-char hex ObjectId)
Request
import requests
url = "https://api.alladdin.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())Responses
Response
{
"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": "..."
}
]
}
]
}Success responses
200 Product stock in transit application/json object product_id string required
Unique identifier of the product
in_transit string required
Net incoming stock (in transit minus compromised) as a decimal string
compromised string required
Stock committed to pending sales or production orders as a decimal string
movements[] object[] required
Document movements contributing to the transit totals
document_id string required
Identifier of the source document
document_type string required
Type of the source document (e.g. salesorder, order, productionorder)
movement_type string required
Whether this movement is incoming or compromise
Enum: compromise incoming total string required
Total quantity of this movement as a decimal string
date string<date-time> required
Date of the movement in ISO 8601 format
variants[] object[] required
Per-variant breakdown of the movement
Error responses
401 Invalid or missing API key application/json 403 Insufficient permissions application/json 404 Product not found application/json 429 Rate limit exceeded application/json
