Recipe: syncing orders with an external system
Polling new and changed orders, and creating orders from the external system.
Orders into the external system
- Create a secret key with the
orders:readscope and store the time of the last sync. - Every 5 to 15 minutes request changed orders with a 5-minute overlap.
- For each order compare
idandupdatedAtand update the record in the external system. - Subscribe to
order.createdandorder.status_changedto see changes at once; polling stays as the safety net.
curl "https://api.bazzario.app/v1/admin/orders?updatedSince=2026-11-22T08:55:00Z&limit=100" \
-H "Authorization: Bearer bzk_YOUR_KEY"Use the order’s own total and currency for amounts (integers in minor units), not the store settings: the currency is snapshotted at creation. The country is shippingAddress.country, the phone is E.164. The status is in status (PENDING, PROCESSING, SHIPPED, DELIVERED, CANCELLED, REFUNDED) and paymentStatus is separate.
Orders from the external system into Bazzario
POST /v1/admin/orders needs the orders:write scope, an Idempotency-Key and externalOrderId, the external document number. The recipient and address are the nested shippingAddress object, delivery is the delivery object, every line carries its price in minor units. A new order returns 201; re-posting the same externalOrderId returns the existing order (200).
curl -X POST https://api.bazzario.app/v1/admin/orders \
-H "Authorization: Bearer bzk_YOUR_KEY" \
-H "Idempotency-Key: erp-doc-000123" \
-H "Content-Type: application/json" \
-d '{
"externalOrderId": "000123",
"paymentStatus": "PAID",
"paidAt": "2026-11-22T09:00:00Z",
"fiscalization": "EXTERNAL",
"externalPaymentName": "Bank transfer",
"externalDeliveryName": "Warehouse pickup",
"notifyCustomer": false,
"phone": "+48512345678",
"shippingAddress": { "name": "Anna Kowalska", "line1": "ul. Marszałkowska 1", "city": "Warszawa", "postcode": "00-001", "country": "PL" },
"delivery": { "method": "flat_rate" },
"items": [{ "productId": "…", "quantity": 2, "price": 12000 }]
}'- Order lines cannot be edited in the dashboard: they belong to the external system.
notifyCustomerdefaults tofalse; withtruethe buyer gets a confirmation email.- Change status and payment with
PATCH /v1/admin/orders/:id; payment of card orders is confirmed only by the provider.