Nightly ERP export
A cron job on the shop's server pushes last night's stock, then reads what Refillo proposes.
What you need
A live key with Send your shop's data and Read proposed orders. The key lives in the server's environment as REFILLO_API_KEY, never in the script file that you commit. The shop's products and locations must already have been pushed once, with the same ids your ERP uses.
The stock file
Write stock.json each night from the ERP. mode full_snapshot replaces the on-hand count at every location you name. as_of is when the count was taken, in the shop's time zone. A product id or location id Refillo has not seen is reported, not guessed.
Cron
Run it after the ERP export finishes and before the shop opens. The Idempotency-Key is the date, so a retry of the same night does not apply twice. A 202 means Refillo accepted the file. Read the report url in the response if you need the per-record errors.
curl -sS -X POST https://app.refilloapp.com/api/v1/stock \
-H "Authorization: Bearer $REFILLO_API_KEY" \
-H "Idempotency-Key: stock-2026-10-02" \
-H "Content-Type: application/json" \
-d '{"mode":"full_snapshot","as_of":"2026-10-02T06:00:00-04:00","records":[{"product_id":"SKU-1001","location_id":"STORE-1","on_hand":12}]}'Then read proposals
GET /v1/proposals returns orders Refillo has approved and is waiting for your ERP to create. Send each one back later with the same refillo_po_id so the quantity on its way is not counted twice.