Update inventory
PUT
/inventory/{product}Replace reconciled stock quantities using the current inventory version.
Bearer token ·
inventory:writePath parameters
productintegerrequiredStorlio product ID belonging to this store.
Min: 1.
Headers
Idempotency-KeystringrequiredReuse only for an identical retry. Changed requests need a new key.
Request body application/json
expectedVersionintegerrequiredCurrent version from a fresh read. Stale writes return 409.
Min: 0.
quantityintegerrequiredNumber of units.
Min: 0.Max: 100000000.
variantStockobjectComplete variation-key-to-quantity map.
Integration notes
- Use Storlio as the shared stock count. Reconcile website sales before writing a snapshot.
- Send every variation key; quantities must add up to quantity. Use expectedVersion 0 to establish tracking.
- A checkout link does not reserve stock. Independent website checkouts need their own coordinated stock handling.
Responses
Request successful.
Response fields
dataobjectChild fields
productIdstringStorlio product ID.
inventoryIdstring | nullStock tracking record ID; compare versions within this record.
versionintegerCurrent resource version.
Min: 0.
trackedbooleanWhether inventory tracking is enabled.
quantityinteger | nullNumber of units.
variantStockobject | arrayComplete variation-key-to-quantity map.
variantKeysstring[]Valid stock variation keys.
updatedAtstring | nullLast update in ISO 8601 format.
Format: date-time.