Inventory
Read and write stock levels per product. Handles variant-level inventory atomically.
Read levels
GET/api/v1/inventory/:productId
Scope: inventory:read.
Set levels
PUT/api/v1/inventory/:productId
Scope: inventory:write. Pass either top-level stock (no-variant products) or a variants array.
curl# No variants curl -X PUT https://axisel.com/api/v1/inventory/67e0... \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "stock": 100, "minStock": 10 }' # With variants — match by id OR (color + size) curl -X PUT https://axisel.com/api/v1/inventory/67e0... \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "variants": [ { "color": "Red", "size": "M", "stock": 25 }, { "color": "Red", "size": "L", "stock": 15 }, { "id": "67e0var1", "stock": 0 } ] }'
⚠Reservations are preserved. Setting
stock: 100 when 3 units are reserved by pending orders leaves available: 97 automatically. You're setting the physical count; the API computes available for you.Response
json{ "data": { "productId": "67e0...", "stock": 100, "reserved": 3, "available": 97, "minStock": 10, "variants": [ { "id": "67e0var1", "color": "Red", "size": "M", "stock": 25, "reserved": 1, "available": 24 } ] } }