Restock a shop from your own system
Your program adds stock to a product the way a paste in the dashboard does. Each line it sends becomes one unit a buyer can receive.
On this page
Find the product and variant ids
- Call List products. Each product comes with its id and its variants.
- Keep the ids in your system next to your own item codes. A product id does not change.
Push stock lines
Send the lines with Add stock. Name variant_id when the product has variants, and only then.
The reference lists what a push does: it is all or nothing, waiting pre-orders are served first, and notify sends the shop's restock alerts.
Repeated lines
The API stores each line exactly as sent. It does not remove a line that repeats another one, or a line the product has already sold.
Duplicate stock detection in Settings > Storefront is a check in the dashboard. It does not refuse a push. If your system can send the same code twice, remove repeats before you push.
How much to push
A push can carry many lines, but one large push holds the product while it is written. Send stock in batches your system can retry, and wait for each answer.
A push that cannot take its turn answers 409 with Retry-After. See The 409 busy response.