Update inventory by SKU and warehouse
Updates inventory quantity and lead time for a given SKU in a warehouse.
ℹ️ If you wish to configure lead time exclusively, use the Update inventory lead time by SKU and warehouse endpoint, and if the quantity only, use the Update inventory quantity by SKU and warehouse endpoint.
This endpoint allows you to:
-
Define a quantity: Indicate a specific number of items of a SKU from a warehouse, and it will decrease whenever an item is sold. When the last item is sold, the SKU will run out of stock.
-
Set an unlimited inventory: Always have items of a SKU from a warehouse considered available for sale. When this configuration is active, the SKU never goes out of stock.
-
Configure lead time: Set the lead time for a given SKU from a warehouse, and this period will be added to the order total shipping time. This configuration is optional and by default it is set to 0 days.
Successful requests receive a 200 OK status code with true in the response body, and unsuccessful requests receive a 400 Bad Request error code.
❗ Requests made with an incomplete response body can be successful and receive a 200 OK message. However, sending the request body without the leadTime field sets the SKU lead time to 0. The same is valid for the quantity field, which, if not sent, makes the SKU count equal to 0.
Permissions
Any user or API key must have at least one of the appropriate License Manager resources to be able to successfully run this request. Otherwise they will receive a status code 403 error. These are the applicable resources for this endpoint:
| Product | Category | Resource |
|---|---|---|
| Logistics | Logistics access | Logistics full access |
| Logistics | Logistics access | Logistics inventory full access |
You can create a custom role with that resource or use one of the following predefined roles:
| Role | Resource |
|---|---|
| Logistics - Full access | Logistics full access |
| OMS - Full access | Logistics full access |
| Logistics - Full access | Logistics inventory full access |
| OMS - Full access | Logistics inventory full access |
❗ Assigning a predefined role to users or application keys usually grants permission to multiple License Manager resources. If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see Best practices for using application keys. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication.
Path parameters
Unique identifier of the SKU you wish to update.
Unique identifier of the warehouse of the SKU you wish to update.
Headers
Type of the content being sent.
HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand.
Request body
Example request
{
"quantity": 202,
"dateUtcOnBalanceSystem": "2024-06-13T00:52:16",
"leadTime": "10.10:00:00"
}Response
OK