ERP and web shop stock sync
Use this when another system keeps its own copy of your stock levels, for example an ERP, an accounting package or a web shop, and both need to show the same numbers.
Decide which system records stock
Pick one system where stock changes are recorded, and have the other send its changes there. When Next Inventory is that system:
- The other system sends its stock changes to Next Inventory as stock movements. A web shop
sale becomes a
remove_stockmovement; a delivery booked in the ERP becomesadd_stock. - Next Inventory tells the other system about every change, wherever it was made, through the
stock.changedwebhook.
This way every change has one record in the transaction log, and neither system overwrites the other.
1. Load the current stock once
Read every item with GET /items, a page at a time, and store each item's id, sku and
stock_quantity in the other system. Match items on sku or barcode. See
Page through large lists.
2. Keep it in step with webhooks
Add a webhook for the other system and subscribe it to stock.changed.
It is sent once per item whose quantity changes, with the old and new quantity and what caused
the change, whether the change was made on screen, by a scanner or through the API. Add
stock.low if the other system should react when an item runs low, for example by hiding it from
a shop or raising a purchase order.
Verify the signature of every message before using it, and ignore a
webhook-id you have already processed.
3. Send changes to Next Inventory
Record each change in the other system as a stock movement:
{
"movement_type": "remove_stock",
"is_draft": false,
"movement_date": "2026-11-11",
"warehouse_id": 1,
"reference": "WEB-ORDER-10482",
"items": [ { "item_id": 17, "quantity": 2 } ]
}
- Put the other system's own number in
reference, so the change can be traced back. - Send an
Idempotency-Keyheader, for example the order number, so a retried request is recorded only once. - A movement that would take an item below zero is refused. Decide in advance what the other system does then, for example cancel the order line.
See Endpoint details for the four movement types and the role permission each one needs.
4. Check it now and then
The webhook delivery log shows every message and whether the other system
accepted it. Messages that fail are retried for about a day and a half. If the other system was
down for longer, read the items it missed again with GET /items.