Connecting your WMS to Stokrio's partner API: movements, idempotency and nightly counts
An integration guide for 3PLs: the order to send things in, why every movement needs a unique event id, how nightly counts correct drift, and what to do when a call fails.
Stokrio Team · · 8 min read
Your warehouse system is the source of truth for stock. The partner API lets it tell Stokrio what happens on the floor, so each client gets forecasts, reorder plans and reports without anyone re-keying data. This guide covers the order of operations and the behaviours that make an integration safe to retry.
Key takeaways
- Send things in order: warehouses and bins, clients, items, then movements.
- Give every movement your own unique event id; repeats are recognised and ignored.
- Send a nightly count so drift is corrected and reported.
- Use dry runs while you build, and read the request log when something fails.
The order
- Warehouses and bins, once, and again whenever they change. Changes reach every client.
- A client, with its users. New users need a name.
- Items (and kits), up to 500 per call. Send your own item id so a SKU rename carries over.
- Optionally, order history for six to twenty-four months so forecasts are useful from day one.
- An opening count per warehouse.
Movements
After setup, send movements as they happen, or batched every few minutes. Types are receipt, return, shipment, adjustment, transfer and bin move, with optional bin, lot and expiry. Each carries your unique eventId.
That id is the safety net. If a request times out and you do not know whether it landed, resend it. A movement whose event id was already applied returns "duplicate" and changes nothing. Each movement succeeds or fails on its own, and the response says which.
Nightly counts
A count per warehouse tells Stokrio what you believe is on the shelf. Stokrio sets its figures to yours and returns the drift: how far its running total had wandered. Send a complete count and unlisted SKUs are set to zero. Rising drift is itself a signal: it points to movements you are not sending.
Orders
Send sales orders so Stokrio can forecast demand, and update their status as they ship. Orders can be created or replaced, and read back.
Signing clients in
Your portal's "Open Stokrio" button asks the API for a single-use, short-lived sign-in link for the client user and redirects them. No passwords are created, and the workspace carries your logo and colour.
When things go wrong
- A partner key works only on your own clients, and not on the regular API.
- Rotate partner keys by creating a new one in the app and revoking the old one.
- The request log shows recent calls and errors, and the Integration health report shows each client's last data, last count and errors.
Start from the partner API docs and the Postman collection, and read how 3PL clients see the result.