LianaCommerce REST API

Stock alerts

Serverhttps://shop.example.com/api/v1

Set the stock alert limits of products and variations in bulk. When an order takes the stock below the limit, the shop sends a stock alert email.


Set product stock alerts in bulk

POST
https://shop.example.com/api/v1
/stock_alerts/products

Sets the stock alert limit of products. The body is a JSON array of {product_id, stock_alert} elements. If several elements have the same product, the last one wins. If none of the products exists (deleted products count as missing), the response is 404; otherwise the missing ones are listed in not_found. The response items have no result_index.

Set product stock alerts in bulk › Request Body

​ProductStockAlertIn[] · minItems: 1
product_id
​integer · required
stock_alert
​StockAlertValue · required

The stock alert limit. When an order takes the available stock below this limit, the shop sends a stock alert email. null or 0 uses the shop's default limit.

Example: 5

Set product stock alerts in bulk › Responses

The updated products.

href
​string

The URL of the request.

Example: https://shop.example.com/api/v1/products
​object[]

The request elements that updated nothing, as {"<identifier>": <id as sent>}. Present only when some elements matched and some didn't.

The updated products or variations.

​Meta

Set variation stock alerts in bulk

POST
https://shop.example.com/api/v1
/stock_alerts/variations

Sets the stock alert limit of variations. The body is a JSON array of {variation_id, stock_alert} elements. If several elements have the same variation, the last one wins. If none of the variations exists (deleted variations count as missing), the response is 404; otherwise the missing ones are listed in not_found. The response items have no result_index.

Set variation stock alerts in bulk › Request Body

​VariationStockAlertIn[] · minItems: 1
variation_id
​integer · required
stock_alert
​StockAlertValue · required

The stock alert limit. When an order takes the available stock below this limit, the shop sends a stock alert email. null or 0 uses the shop's default limit.

Example: 5

Set variation stock alerts in bulk › Responses

The updated variations.

href
​string

The URL of the request.

Example: https://shop.example.com/api/v1/products
​object[]

The request elements that updated nothing, as {"<identifier>": <id as sent>}. Present only when some elements matched and some didn't.

The updated products or variations.

​Meta