Orders
These endpoints see your website orders: the ones placed through the API, on the website
channel. Orders from your POS and dashboard stay out of them.
Take orders on your website puts them together into a checkout.
Place an order
Section titled “Place an order”POST/orders
Send the customer, the products and quantities, and how the order reaches them. Every price comes
from your catalogue, never from the request. An Idempotency-Key header is required: see
Idempotency keys.
| Field | Meaning |
|---|---|
customer |
Required: { name, phone, email, address }. name and at least one of phone and email are needed. The customer is found by phone, then email, or added. |
items |
Required. 1 to 100 lines, each { productId, variantId?, quantity }. A product with variants needs its variantId. Any active product can be ordered, shown on your website or not. |
deliveryMethod |
delivery or pickup. Left out: delivery when you send delivery.address, else pickup. |
delivery |
{ address, recipientName, recipientPhone, note }, all optional. Without delivery.address, the customer’s address is used. |
deliveryFee |
What you charge for delivery, in major units. Added to the order. |
promoCode |
A promo code the shopper entered. Your automatic discounts apply either way. |
paymentStatus |
pending (the default), or paid if you’ve taken the money yourself. |
paymentMethod |
With paid: bank_transfer, card, mobile_money or other (the default). |
paymentReference |
Required with paid: your payment provider’s reference. Up to 100 characters. |
notes |
A note for your team, up to 1,000 characters. |
With a live key the answer is 202 Accepted and the order’s id. Sabiwave makes the order in
the background, through the same pipeline as a sale at the POS: follow it with
GET /orders/{id}/status or the order.created webhook.
curl -X POST "https://api.sabiwave.com/api/v1/public/orders" \ -H "Authorization: Bearer $SABIWAVE_SECRET_KEY" \ -H "Idempotency-Key: order-9c145175-b450-4d66-8946-3b972543ffed" \ -H "Content-Type: application/json" \ -d '{ "customer": { "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "quantity": 4 } ], "deliveryMethod": "delivery", "delivery": { "address": "12 Admiralty Way, Lekki, Lagos", "recipientName": "Kemi Okafor", "recipientPhone": "+2348030000002", "note": "Call on arrival" }, "deliveryFee": 2500, "promoCode": "WEEKEND10", "paymentStatus": "pending", "notes": "Website order #1001"}'const res = await fetch('https://api.sabiwave.com/api/v1/public/orders', { method: 'POST', headers: { Authorization: `Bearer ${process.env.SABIWAVE_SECRET_KEY}`, 'Idempotency-Key': 'order-9c145175-b450-4d66-8946-3b972543ffed', 'Content-Type': 'application/json', }, body: JSON.stringify({ "customer": { "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "quantity": 4 } ], "deliveryMethod": "delivery", "delivery": { "address": "12 Admiralty Way, Lekki, Lagos", "recipientName": "Kemi Okafor", "recipientPhone": "+2348030000002", "note": "Call on arrival" }, "deliveryFee": 2500, "promoCode": "WEEKEND10", "paymentStatus": "pending", "notes": "Website order #1001" }),});const result = await res.json();{ "success": true, "message": "Order received: poll its status, or wait for the order.created webhook.", "data": { "id": "01a22953-ae27-7590-abe0-609936b06d7c", "status": "queued" }}With a test key nothing is made: the answer is 200 with "test": true and what the order
would come to. See Test and live keys.
{ "success": true, "message": "Test key: the order was priced and checked, and nothing was made.", "data": { "order": { "test": true, "status": "pending", "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "name": "Weekend Gift Hamper", "variant": null, "quantity": 2, "unitPrice": 20000 } ], "subtotal": 40000, "discount": 4000, "deliveryFee": 2500, "tax": 0, "total": 38500, "amountPaid": 0, "promotions": [ { "kind": "code", "name": "WEEKEND10", "amount": 4000 } ] } }}An order the shopper has already paid for on your website. With a live key, its payment sends the
payment.recorded webhook as well as order.created, marked withOrder: true:
curl -X POST "https://api.sabiwave.com/api/v1/public/orders" \ -H "Authorization: Bearer $SABIWAVE_SECRET_KEY" \ -H "Idempotency-Key: order-d029323b-b35e-40cc-830d-d2c5f461955c" \ -H "Content-Type: application/json" \ -d '{ "customer": { "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "quantity": 2 } ], "deliveryMethod": "delivery", "delivery": { "address": "12 Admiralty Way, Lekki, Lagos", "recipientName": "Kemi Okafor", "recipientPhone": "+2348030000002", "note": "Call on arrival" }, "deliveryFee": 2500, "promoCode": "WEEKEND10", "paymentStatus": "paid", "notes": "Website order #1001", "paymentMethod": "card", "paymentReference": "WEB-PAY-1001"}'const res = await fetch('https://api.sabiwave.com/api/v1/public/orders', { method: 'POST', headers: { Authorization: `Bearer ${process.env.SABIWAVE_SECRET_KEY}`, 'Idempotency-Key': 'order-d029323b-b35e-40cc-830d-d2c5f461955c', 'Content-Type': 'application/json', }, body: JSON.stringify({ "customer": { "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "quantity": 2 } ], "deliveryMethod": "delivery", "delivery": { "address": "12 Admiralty Way, Lekki, Lagos", "recipientName": "Kemi Okafor", "recipientPhone": "+2348030000002", "note": "Call on arrival" }, "deliveryFee": 2500, "promoCode": "WEEKEND10", "paymentStatus": "paid", "notes": "Website order #1001", "paymentMethod": "card", "paymentReference": "WEB-PAY-1001" }),});const result = await res.json();{ "success": true, "message": "Test key: the order was priced and checked, and nothing was made.", "data": { "order": { "test": true, "status": "pending", "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "name": "Weekend Gift Hamper", "variant": null, "quantity": 2, "unitPrice": 20000 } ], "subtotal": 40000, "discount": 4000, "deliveryFee": 2500, "tax": 0, "total": 38500, "amountPaid": 38500, "promotions": [ { "kind": "code", "name": "WEEKEND10", "amount": 4000 } ] } }}paymentStatus: "paid" without a paymentReference is refused:
{ "success": false, "message": "A paid order says where it was paid.", "error": { "name": "ValidationError", "code": "VALIDATION_ERROR", "statusCode": 422, "details": [ { "field": "paymentReference", "message": "A paid order says where it was paid.", "in": "body" } ] }, "requestId": "3d03dd2a-db13-4f54-bb80-e911b90c2395"}When an order can’t be made
Section titled “When an order can’t be made”Some refusals come straight back, whatever the key:
| Status | Code | Why |
|---|---|---|
| 400 | IDEMPOTENCY_KEY_REQUIRED |
No Idempotency-Key header. |
| 400 | IDEMPOTENCY_KEY_INVALID |
The key isn’t 8 to 100 letters, digits, dots, colons, dashes or underscores. |
| 409 | IDEMPOTENCY_KEY_REUSED |
The key was used for a different request in the last 24 hours. |
| 409 | IDEMPOTENCY_KEY_IN_PROGRESS |
A request with this key is still running. |
| 409 | NO_OPEN_STORE |
Your business has no open store to sell from. |
| 422 | VALIDATION_ERROR |
A field is missing or wrong: error.details lists each one. |
| 429 | TOO_MANY_REQUESTS |
More than 60 orders a minute from this key. |
{ "success": false, "message": "customer must contain at least one of [phone, email]", "error": { "name": "ValidationError", "code": "VALIDATION_ERROR", "statusCode": 422, "details": [ { "field": "customer", "message": "customer must contain at least one of [phone, email]", "in": "body" }, { "field": "items", "message": "items must contain at least 1 items", "in": "body" } ] }, "requestId": "00354f9d-cbf4-4d88-9d25-d5a9d0351006"}Others come from making the order: whether the products and the stock are there and the promo code
can be used. With a test key they come straight back with their status. With a live key the
202 has already been sent, so they come back as the order’s status, failed, with the same code:
| Status | Code | Why |
|---|---|---|
| 404 | PRODUCT_NOT_FOUND |
A productId isn’t one of your products. error.details names the line, such as items[1].productId. |
| 409 | PRODUCT_INACTIVE |
A product, or the variant chosen, isn’t for sale any more. |
| 422 | VALIDATION_ERROR |
A product with variants came without a variantId, or with one that isn’t its own (items[0].variantId). |
| 409 | INSUFFICIENT_STOCK |
Not enough stock, and your selling rules say Stop the sale. error.details names the product, what’s available and what’s needed. |
| 409 | STOCK_BELOW_ZERO |
Not enough stock, and your selling rules say Ask, then allow: a website can’t confirm. |
| 409 | STOCK_BEING_COUNTED |
The product’s stock is frozen for a stock count in progress. |
| 409 | STORE_CLOSED |
The store selling it was closed. |
| 409 | PROMO_… |
The promo code can’t be used: the reasons are the same as when you check one. |
{ "success": false, "message": "Not enough \"Weekend Gift Hamper\" at Main store: 4 available, 500 needed.", "error": { "name": "ConflictError", "code": "INSUFFICIENT_STOCK", "statusCode": 409, "details": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "variantId": null, "storeId": "01a21564-0fa5-73bd-b689-d7a0a4173117", "name": "Weekend Gift Hamper", "available": 4, "needed": 500 } ] }, "requestId": "6b08e145-f4fe-49e5-9d65-d9df67cb689b"}A line is named as your request named it, counting from 0: here the second item’s product.
curl -X POST "https://api.sabiwave.com/api/v1/public/orders" \ -H "Authorization: Bearer $SABIWAVE_SECRET_KEY" \ -H "Idempotency-Key: order-7c263344-9a2d-4074-b2bc-4e7cd5d276fe" \ -H "Content-Type: application/json" \ -d '{ "customer": { "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "quantity": 1 }, { "productId": "01a20000-0000-7000-8000-000000000000", "quantity": 1 } ], "deliveryMethod": "delivery", "delivery": { "address": "12 Admiralty Way, Lekki, Lagos", "recipientName": "Kemi Okafor", "recipientPhone": "+2348030000002", "note": "Call on arrival" }, "deliveryFee": 2500, "paymentStatus": "pending", "notes": "Website order #1001"}'const res = await fetch('https://api.sabiwave.com/api/v1/public/orders', { method: 'POST', headers: { Authorization: `Bearer ${process.env.SABIWAVE_SECRET_KEY}`, 'Idempotency-Key': 'order-7c263344-9a2d-4074-b2bc-4e7cd5d276fe', 'Content-Type': 'application/json', }, body: JSON.stringify({ "customer": { "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "quantity": 1 }, { "productId": "01a20000-0000-7000-8000-000000000000", "quantity": 1 } ], "deliveryMethod": "delivery", "delivery": { "address": "12 Admiralty Way, Lekki, Lagos", "recipientName": "Kemi Okafor", "recipientPhone": "+2348030000002", "note": "Call on arrival" }, "deliveryFee": 2500, "paymentStatus": "pending", "notes": "Website order #1001" }),});const result = await res.json();{ "success": false, "message": "We could not find one of those products.", "error": { "name": "NotFoundError", "code": "PRODUCT_NOT_FOUND", "statusCode": 404, "details": [ { "field": "items[1].productId" } ] }, "requestId": "c70c42c8-108f-4b61-9580-08b5f981def5"}Follow an order
Section titled “Follow an order”GET/orders/{id}/status
Where an order you placed stands. Ask every second or two after the 202, until it’s completed
or failed.
status |
Meaning |
|---|---|
queued |
Waiting its turn. |
processing |
Being made. |
completed |
Made: the order is in order, as GET /orders/{id} gives it. |
failed |
Not made, and nothing was saved: the reason is in error. Place it again with a new Idempotency-Key once it’s fixed. |
curl "https://api.sabiwave.com/api/v1/public/orders/01a22953-ae27-7590-abe0-609936b06d7c/status" \ -H "Authorization: Bearer $SABIWAVE_SECRET_KEY"const res = await fetch('https://api.sabiwave.com/api/v1/public/orders/01a22953-ae27-7590-abe0-609936b06d7c/status', { headers: { Authorization: `Bearer ${process.env.SABIWAVE_SECRET_KEY}`, },});const result = await res.json();{ "success": true, "data": { "status": "processing" }}{ "success": true, "data": { "status": "completed", "order": { "id": "01a22953-ae27-7590-abe0-609936b06d7c", "orderNumber": "PDSWT-20261129-0008", "status": "pending", "paymentStatus": "unpaid", "channel": "website", "customer": { "id": "01a22953-aada-745d-a986-131fbe5367bd", "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "name": "Weekend Gift Hamper", "variant": null, "quantity": 4, "unitPrice": 20000, "discount": 8000, "total": 72000 } ], "subtotal": 80000, "discount": 8000, "deliveryFee": 2500, "tax": 0, "total": 74500, "amountPaid": 0, "promotions": [ { "kind": "code", "name": "WEEKEND10", "amount": 8000 } ], "deliveryAddress": "12 Admiralty Way, Lekki, Lagos", "createdAt": "2026-11-29T22:01:19.684Z" } }}{ "success": true, "data": { "status": "failed", "error": { "code": "INSUFFICIENT_STOCK", "message": "Not enough \"Weekend Gift Hamper\" at Main store: 4 available, 500 needed.", "statusCode": 409, "details": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "variantId": null, "storeId": "01a21564-0fa5-73bd-b689-d7a0a4173117", "name": "Weekend Gift Hamper", "available": 4, "needed": 500 } ] } }}A failed order’s status can be read for 7 days. An id that isn’t one of your orders answers
404 ORDER_NOT_FOUND.
Get an order
Section titled “Get an order”GET/orders/{id}
curl "https://api.sabiwave.com/api/v1/public/orders/01a22953-ae27-7590-abe0-609936b06d7c" \ -H "Authorization: Bearer $SABIWAVE_SECRET_KEY"const res = await fetch('https://api.sabiwave.com/api/v1/public/orders/01a22953-ae27-7590-abe0-609936b06d7c', { headers: { Authorization: `Bearer ${process.env.SABIWAVE_SECRET_KEY}`, },});const result = await res.json();{ "success": true, "data": { "order": { "id": "01a22953-ae27-7590-abe0-609936b06d7c", "orderNumber": "PDSWT-20261129-0008", "status": "pending", "paymentStatus": "unpaid", "channel": "website", "customer": { "id": "01a22953-aada-745d-a986-131fbe5367bd", "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "name": "Weekend Gift Hamper", "variant": null, "quantity": 4, "unitPrice": 20000, "discount": 8000, "total": 72000 } ], "subtotal": 80000, "discount": 8000, "deliveryFee": 2500, "tax": 0, "total": 74500, "amountPaid": 0, "promotions": [ { "kind": "code", "name": "WEEKEND10", "amount": 8000 } ], "deliveryAddress": "12 Admiralty Way, Lekki, Lagos", "createdAt": "2026-11-29T22:01:19.684Z" } }}| Field | Meaning |
|---|---|
id |
The order’s id. |
orderNumber |
Its number, as your team sees it: show it to the shopper. |
status |
Where it stands: see order statuses. |
paymentStatus |
unpaid, partially_paid, paid or refunded. |
channel |
website. |
customer |
{ id, name, phone, email }, as on the order. |
items |
Each { productId, name, variant, quantity, unitPrice, discount, total }: discount is the line’s share of the order’s promotions, and total what the line comes to after it. |
subtotal |
The items before discounts. |
discount |
Everything the promotions took off. |
deliveryFee |
The delivery charge. |
tax |
The tax on the order (items and delivery), by your tax settings. It’s already counted in total. |
total |
What the customer pays. |
amountPaid |
What’s been paid so far. |
promotions |
Each promotion used: { kind, name, amount }, kind being code or automatic. |
deliveryAddress |
The address it was given, or null. |
createdAt |
When it was placed. |
An order from another channel, or another business, answers 404 ORDER_NOT_FOUND:
{ "success": false, "message": "We could not find that order.", "error": { "name": "NotFoundError", "code": "ORDER_NOT_FOUND", "statusCode": 404 }, "requestId": "3763e485-fe1b-4417-93b8-243a1fe56d19"}List orders
Section titled “List orders”GET/orders
Your website orders, newest first, a page at a time, each in full as above.
| Query | Meaning |
|---|---|
limit |
1 to 100. Default 20. |
cursor |
nextCursor from the previous page. |
status |
Only orders with this status. |
curl "https://api.sabiwave.com/api/v1/public/orders?limit=1" \ -H "Authorization: Bearer $SABIWAVE_SECRET_KEY"const res = await fetch('https://api.sabiwave.com/api/v1/public/orders?limit=1', { headers: { Authorization: `Bearer ${process.env.SABIWAVE_SECRET_KEY}`, },});const result = await res.json();{ "success": true, "data": { "orders": [ { "id": "01a22953-ae27-7590-abe0-609936b06d7c", "orderNumber": "PDSWT-20261129-0008", "status": "pending", "paymentStatus": "unpaid", "channel": "website", "customer": { "id": "01a22953-aada-745d-a986-131fbe5367bd", "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "name": "Weekend Gift Hamper", "variant": null, "quantity": 4, "unitPrice": 20000, "discount": 8000, "total": 72000 } ], "subtotal": 80000, "discount": 8000, "deliveryFee": 2500, "tax": 0, "total": 74500, "amountPaid": 0, "promotions": [ { "kind": "code", "name": "WEEKEND10", "amount": 8000 } ], "deliveryAddress": "12 Admiralty Way, Lekki, Lagos", "createdAt": "2026-11-29T22:01:19.684Z" } ], "nextCursor": "8KNFWjhdaFNqIyjZdzWcvw" }}Cancel an order
Section titled “Cancel an order”POST/orders/{id}/cancel
Cancels a website order. Its stock goes back, any promo code it used can be used again, and the
order.cancelled webhook goes out.
| Field | Meaning |
|---|---|
reason |
Required. 3 to 300 characters, kept on the order. |
curl -X POST "https://api.sabiwave.com/api/v1/public/orders/01a22953-ae27-7590-abe0-609936b06d7c/cancel" \ -H "Authorization: Bearer $SABIWAVE_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{ "reason": "The customer cancelled on the website."}'const res = await fetch('https://api.sabiwave.com/api/v1/public/orders/01a22953-ae27-7590-abe0-609936b06d7c/cancel', { method: 'POST', headers: { Authorization: `Bearer ${process.env.SABIWAVE_SECRET_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "reason": "The customer cancelled on the website." }),});const result = await res.json();{ "success": true, "message": "Order cancelled: its stock is back.", "data": { "order": { "id": "01a22953-ae27-7590-abe0-609936b06d7c", "orderNumber": "PDSWT-20261129-0008", "status": "cancelled", "paymentStatus": "unpaid", "channel": "website", "customer": { "id": "01a22953-aada-745d-a986-131fbe5367bd", "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "name": "Weekend Gift Hamper", "variant": null, "quantity": 4, "unitPrice": 20000, "discount": 8000, "total": 72000 } ], "subtotal": 80000, "discount": 8000, "deliveryFee": 2500, "tax": 0, "total": 74500, "amountPaid": 0, "promotions": [], "deliveryAddress": "12 Admiralty Way, Lekki, Lagos", "createdAt": "2026-11-29T22:01:19.684Z" } }}With a test key it’s a dry run: the answer is the order as it would
be, with "test": true, and the order, its stock and its promo code stay as they were.
{ "success": true, "message": "Test key: the order can be cancelled, and nothing was changed.", "data": { "order": { "id": "01a22953-ae27-7590-abe0-609936b06d7c", "orderNumber": "PDSWT-20261129-0008", "status": "cancelled", "paymentStatus": "unpaid", "channel": "website", "customer": { "id": "01a22953-aada-745d-a986-131fbe5367bd", "name": "Kemi Okafor", "phone": "+2348030000002", "email": "kemi@example.com" }, "items": [ { "productId": "01a2160c-6b00-7627-af42-d534badeaea4", "name": "Weekend Gift Hamper", "variant": null, "quantity": 4, "unitPrice": 20000, "discount": 8000, "total": 72000 } ], "subtotal": 80000, "discount": 8000, "deliveryFee": 2500, "tax": 0, "total": 74500, "amountPaid": 0, "promotions": [ { "kind": "code", "name": "WEEKEND10", "amount": 8000 } ], "deliveryAddress": "12 Admiralty Way, Lekki, Lagos", "createdAt": "2026-11-29T22:01:19.684Z" }, "test": true }}| Status | Code | Why |
|---|---|---|
| 409 | ORDER_PAID |
Money was recorded on it: cancel it in Sabiwave, where the refund is decided. |
| 409 | ORDER_NOT_CANCELLABLE |
It’s already delivered, returned or cancelled. A delivered order is returned in Sabiwave instead. |
| 404 | ORDER_NOT_FOUND |
Not one of your website orders. |
A test key’s dry run is refused with the same codes.
Order statuses
Section titled “Order statuses”Your team moves an order along in Sabiwave; each move sends order.status_changed.
| Status | Meaning |
|---|---|
pending |
Placed, waiting to be confirmed. Website orders start here. |
confirmed |
Accepted by your team. |
preparing |
Being put together. |
ready |
Ready to be picked up or sent. |
shipped |
Handed to the rider or courier. |
in_transit |
On its way. |
delivered |
In the customer’s hands. |
returned |
Every item came back. |
cancelled |
Cancelled. |