Inventory Set
{{api_url}}/shop/inventory/{{sku}}Changes inventory for one SKU in one warehouse. InfiPlex then sends the new level to every connected sales channel with inventory sync enabled, on that channel's normal schedule.
Send exactly one of these two quantity fields:
quantity_to_setsets inventory to that exact number. Use it for cycle counts, full syncs from your own system, and corrections.quantity_to_addchanges current inventory by that amount. A positive number adds stock and a negative number subtracts it. Use it for receipts, returns, damages, and other adjustments.
quantity_to_add is applied to the SKU's inventory at the moment InfiPlex processes the request, so a sale that lands between your last read and your write is not lost. If you read the current value, do the math yourself, and send quantity_to_set, you can overwrite a sale that happened in between.
SKU in the path or the query string
Send the SKU in the URL path:
{{api_url}}/shop/inventory/2008-BN
Or send it in the query string:
{{api_url}}/shop/inventory?sku=2008-BN
Both forms take the same body and return the same response. Use the query string form when a SKU contains characters that don't work in a URL path, such as /. URL-encode the SKU in either form.
Body
| Field | Type | Description |
|---|---|---|
quantity_to_set | integer | The exact inventory to set. Send this or quantity_to_add, not both. |
quantity_to_add | integer | The amount to add to current inventory. Negative values subtract. Send this or quantity_to_set, not both. |
warehouse_id | integer | The InfiPlex warehouse to update. Optional. If omitted, the first warehouse in the system is used, which keeps things simple for accounts with a single warehouse. On accounts with more than one warehouse, always send it. Use Warehouse Search to find a warehouse's ID. |
Examples
Set the SKU to 707 units in warehouse 7:
{"quantity_to_set": 707, "warehouse_id": 7}
Receive 12 units into warehouse 7:
{"quantity_to_add": 12, "warehouse_id": 7}
Remove 3 damaged units from warehouse 7:
{"quantity_to_add": -3, "warehouse_id": 7}
Response
After setting the SKU to 707 units:
{"warehouse_inventory": "707"}
| Field | Type | Description |
|---|---|---|
warehouse_inventory | string | The SKU's inventory in the warehouse after the change. |
How the change reaches your sales channels
- Each channel receives the number its own settings produce. That can be the combined total across all warehouses (the default), one warehouse's count, or per-warehouse levels on channels that support multiple warehouses (Amazon, TikTok Shop, Walmart, and Wayfair).
- The channel's set-to-zero threshold and any Inventory Buffer rule on the SKU are applied before the number is sent.
- A marketplace only receives inventory for SKUs flagged as sold on that marketplace.
- Most channels receive inventory updates every 15 minutes. A few connections only accept updates once a day.
Before you build
- Write to warehouses whose inventory InfiPlex holds directly. If a warehouse's inventory is pulled from an ERP, 3PL, WMS, or storefront, that source's next pull replaces the value you set for any SKU it reports.
- SKU Groups apply.
quantity_to_seton a SKU in a group sets every SKU in the group to that number.quantity_to_addapplies the same change to each SKU's own count. - Every change is recorded in the SKU's inventory history as either
quantity_setorquantity_added, along with a note on what caused it. See Inventory Change History Get. - Your API key needs Inventory write permission. A key without it gets
403 Forbidden. - To update more than a few SKUs, use Inventory Set Bulk. It takes the same fields on every row, and each row can use either quantity field.
Related guides:
Authorization
Bearer token, sent in the Authorization header. Inherited from the collection.
Headers
| Key | Value | Description |
|---|---|---|
Content-Type | application/json |
Body
{
"quantity_to_set": 779,
"warehouse_id": 7
}Example Request
curl --location --request PUT '{{api_url}}/shop/inventory/{{sku}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{auth_token}}' \
--data '{
"quantity_to_set": 779,
"warehouse_id": 7
}'Example Responses
Set Total Quantity for Warehouse
Request
curl --location --request PUT '{{api_url}}/shop/inventory/TF1RDOG' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"quantity_to_set": 707,
"warehouse_id": 7
}'Response 200 OK
{
"warehouse_inventory": "707"
}Set Total Quantity for Warehouse
Request
curl --location --request PUT '{{api_url}}/shop/inventory?sku=ABC123' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"quantity_to_set": 707,
"warehouse_id": 7
}'Response 200 OK
{
"warehouse_inventory": "707"
}Set Total Quantity
Request
curl --location --request PUT '{{api_url}}/shop/inventory/5L-MARG-MW04' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"quantity_to_set": 707
}'Response 200 OK
{
"warehouse_inventory": "707"
}Add Quantity
Request
curl --location --request PUT '{{api_url}}/shop/inventory/5L-MARG-MW04' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"quantity_to_add": 2
}'Response 200 OK
{
"warehouse_inventory": "973"
}
