Alladdin

Work in progress

Site en construction

الموقع قيد الإنشاء

Alladdin
GET

Get stock availability for a product

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

Returns the stock availability of a product, broken down into total, available, reserved and in-transit quantities across all warehouses, plus the physical stock stored in each warehouse.
Reserved stock represents units committed to pending sales orders. In-transit stock represents units incoming from purchase orders. Available stock equals total minus reserved.

Parameters

Path parameters

productId string required

Product ID (24-char hex ObjectId)

Request

python
import requests

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

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

Responses

Response

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": "..."
        }
      ]
    }
  ]
}

Success responses

200 Product stock availability application/json object product_id string required

Unique identifier of the product

has_stock boolean required

Whether the product has stock tracking enabled

total string required

Total stock across all warehouses as a decimal string

available string required

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

reserved string required

Stock committed to pending sales orders as a decimal string

in_transit string required

Stock incoming from purchase orders as a decimal string

warehouses[] object[] required

Physical stock per warehouse

warehouse_id string required

Identifier of the warehouse

stock string required

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).

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

← PreviousGet the main product image →

Next →Get stock in transit for a product →