Decrease or increase qty in stock for specific variation
When your integration changes in stock quantity of product variation in a store pretty often, it becomes harder and harder to keep track of how many items are actually in stock. For example, when at one point of time you have 3 items in stock and 5 in the very next second, then using the specific values can result in incorrect stock quantity.
This method solves this very problem: you can increase or decrease the product variation's stock quantity by a delta quantity. For example, if you need to decrease quantity by 10 items, you can use this method.
This method is also available for product inventory
You can use the checkLowStockNotification
as a request parameter. If true
, makes Ecwid check whether the low stock email notification needs to be sent to merchant after request is sent.
Access scopes
Requires the following access scope: update_catalog
Request
A JSON object with the following fields:
Field | Type | Description |
---|---|---|
quantityDelta | number | Delta value used to update product quantity. Negative value will decrease quantity, positive one will increase it. |
Response
A JSON object of type 'InventoryAdjustmentStatus' with the following fields:
InventoryAdjustmentStatus
Field | Type | Description |
---|---|---|
updateCount | number | The number of updated products (1 or 0 depending on whether the update was successful) |
warning | string | Inventory update warning(optional). For example, the warning will display if the stock became negative |
Errors
In case of error, Ecwid responds with an error HTTP status code and, optionally, JSON-formatted body containing error description
HTTP codes
HTTP Status | Description |
---|---|
400 | Request parameters are malformed: SKU for combination is not set, etc. |
402 | This functionality is not available on this plan |
404 | Product not found |
415 | Unsupported content-type: expected application/json or text/json |
500 | Could not process the request, internal server error |
Error response body (optional)
Field | Type | Description |
---|---|---|
errorMessage | string | Error message |