StorlioDevelopers
Inventory

Update inventory

PUT/inventory/{product}

Replace reconciled stock quantities using the current inventory version.

Bearer token ·inventory:write

Path parameters

productintegerrequired

Storlio product ID belonging to this store.

Min: 1.

Headers

Idempotency-Keystringrequired

Reuse only for an identical retry. Changed requests need a new key.

Request body application/json

expectedVersionintegerrequired

Current version from a fresh read. Stale writes return 409.

Min: 0.

quantityintegerrequired

Number of units.

Min: 0.Max: 100000000.

variantStockobject

Complete 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
dataobject
Child fields
productIdstring

Storlio product ID.

inventoryIdstring | null

Stock tracking record ID; compare versions within this record.

versioninteger

Current resource version.

Min: 0.

trackedboolean

Whether inventory tracking is enabled.

quantityinteger | null

Number of units.

variantStockobject | array

Complete variation-key-to-quantity map.

variantKeysstring[]

Valid stock variation keys.

updatedAtstring | null

Last update in ISO 8601 format.

Format: date-time.

Storlio Commerce API v1