update_inventory
Updated September 9, 20261 min read
Set absolute inventory values by submitting snapshot inventory events. If both on_hand and unavailable are provided, this creates a SNAPSHOT event. If only one field is provided, it creates SNAPSHOT_ONHAND or SNAPSHOT_UNAVAILABLE.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
event_timestamp | string | Yes | ISO 8601 event timestamp. Backend rejects future timestamps and timestamps older than the tolerance window. |
location_id | string | Yes | — |
tenantId | string | Yes | — |
inventory_key | string | No | — |
merchant | string | No | — |
on_hand | number | No | Absolute on-hand quantity to set. |
product_id | string | No | Product whose inventory_key identifies the inventory. |
product_ref | string | No | Merchant product reference; requires merchant. |
reason | string | No | — |
sku | string | No | Merchant SKU; requires merchant. Rejected when ambiguous. |
unavailable | number | No | Absolute unavailable quantity to set. |
Example agent prompt
"Update the inventory."
update_inventory(
tenantId="…",
product_id="PROD-1234",
location_id="DXB-WH-01",
event_timestamp=…
)