Real Time Stock Update

Use the Ordergroove API to update product stock status in real time
View as Markdown

Ordergroove’s API can change the stock status of a product in real time. This can help you manage inventory by sending an API call when a product — or group of products — hits a low threshold or goes completely out of stock.

Platform

This article is specifically for stores on eCommerce platforms outside of Shopify who want live stock updates. If you are on Shopify, please reach out to Ordergroove Support and we’ll enable it for you.


Example Use Case

The real time stock update can help you get ahead of inventory issues. For example, if you have 100 units left and 200 are set to renew during the morning order placement task, you can send an automated call to Ordergroove when stock runs out. The overflow orders will then naturally move into Ordergroove’s out-of-stock flow instead of failing due to missing inventory.


PATCH Update Endpoint

https://restapi.ordergroove.com/products-batch/update/

Headers

This endpoint requires user-level authentication. You will need a specific hash key and a merchant-level ID to generate the sig_field value. Please reach out to help@ordergroove.com to get these credentials if you don’t have them.

Headers
headers = {
'authorization': '{"public_id": "<MERCHANT_PUBLIC_ID>", "ts": <SECONDS_SINCE_EPOCH>, "sig_field": "<MERCHANT_LEVEL_ID>", "sig": "<HMAC_SIGNATURE>"}',
'og-authorization': True,
'content-type': 'application/json'
}

Example Request Body

You can update one or more products in the same request:

Request
1[
2 {
3 "product_id": "(external product id)",
4 "live": false
5 }
6]

Example Response

Ordergroove will attempt an update for each product sent and respond with a mapping of each product along with the result:

Response
1[
2 {"results": [{"status": 200, "product_id": "166603786142092350"}]},
3 {"results": [{"status": 404, "product_id": "notfound"}]},
4 {"results": [{"status": 400, "product_id": "166603786142092351"}]}
5]