Set or delete low stock level

To get an alert when a product stock is low, you can set a low stock level for one or more products variants.
When a low stock level is set to null or 0, the low stock level is deleted.

Prerequisites

  • Make sure that authorisation is set up with the following OAuth scope using OAuth API:
    • READ:PRODUCT
  • The location UUID for the target location. See Fetch inventories.
  • The product/variant UUIDs for the products/variants to be updated. See Fetch products.

Set low stock level

Set a low stock level for a product variant in a specific inventory. The product and variant UUIDs are defined in the request body.
1
POST /custom-low-stock/locations/{locationUuid}
1
[
2
{
3
"inventoryUuid": <UUID>,
4
"productUuid": <UUID>,
5
"variantUuid": <UUID>,
6
"lowStockLevel": <NUMBER>,
7
"lowStockAlert": <BOOLEAN>
8
}
9
]
Example: This example updates the custom low stock level to 10 for product_uuid de71da94-5cb4-11ec-bf63-0242ac130002, and variant_uuid e58d826a-5cb4-11ec-bf63-0242ac130002, for inventoryUuid f2e4d45e-5cb4-11ec-bf63-0242ac130002.
Request
1
POST /custom-low-stock
1
[
2
{
3
"inventoryUuid": "f2e4d45e-5cb4-11ec-bf63-0242ac130002",
4
"productUuid": "de71da94-5cb4-11ec-bf63-0242ac130002",
5
"variantUuid": "e58d826a-5cb4-11ec-bf63-0242ac130002",
6
"lowStockLevel": 10,
7
"lowStockAlert": false
8
}
9
]
Response
No response body is returned, only a status code of 204 - No Content.

Delete a low stock level

If you want to delete a low stock level for one or more products or variants, set the lowStockLevel to null or 0.