Product and stock sync
The flow from your system to the store: the SKU links the two, products are upserted, and stock moves by delta.
The steps
First load
Read
GET /products?per_page=100page by page, passingmeta.next_cursorascursoruntil it isnull, and keep each product and variant id against its SKU.Upsert each item
GET /products/sku/{sku}. A 404 means a new item:POST /productswith the name and the variants (each withskuandpricein halalas),weight_gramswhen it ships, andstatus: activeto show it. When found:PATCH /products/sku/{sku}with only the fields that changed (keys you do not send stay).Pictures
Send public links in
images. They are copied in the background: the answer lists the link inimages_pendingwith statuspending, then it joinsimagesandproduct.updatedis sent. A store has at most 50 links waiting at once (beyond that, 429images_queue_fullwithRetry-After).Stock by delta
Each movement in your system:
POST /inventory/adjustmentswithincrementordecrement, up to 100 lines a call, applied all or nothing, with anIdempotency-Keyfrom the movement number.mode: setis for a stock count only, because it erases what the store sold between your read and your write.When the API says wait
On a 429, wait the seconds in
Retry-After, then send the same call again with the sameIdempotency-Key. A decrement below zero is 409insufficient_stockwithavailable, and nothing is applied.
The step-by-step guide, with every rule for pictures and variants: Sync products and stock. The operations: Products and Inventory.