Skip to content

Quickstart

Five minutes from nothing to a priced order. Everything here uses a test key, which works on every plan: what a test key sends is checked against your real catalogue, stock and customers, and nothing is saved.

In Sabiwave, open Settings › Developer, stay on API keys and press New key.

  • Name: where you’ll use it, such as “Main website”.
  • Mode: Test.
  • What it may do: for this quickstart, tick everything. You can change it later.

Press Make the key. Sabiwave shows the secret key (sk_test_…) once: copy it now. If you lose it, rotate the key to get a new one. The publishable key (pk_test_…) stays visible on the key whenever you open it.

The secret key places orders and reads customers, so it lives only on your server, never in a browser, an app or a code repository. An environment variable is the usual place:

Terminal window
export SABIWAVE_SECRET_KEY=sk_test_…

GET /ping is the first call of any integration: it tells you which business the key belongs to, its mode, its type and what it may do.

Terminal window
curl "https://api.sabiwave.com/api/v1/public/ping" \
-H "Authorization: Bearer $SABIWAVE_SECRET_KEY"
200 OK
{
"success": true,
"data": {
"business": {
"id": "01a21564-0f82-72f9-9f14-6826074cfba5",
"name": "Payroll Demo Shop (walk-through)",
"currency": "NGN"
},
"mode": "test",
"keyType": "secret",
"scopes": [
"catalog:read",
"promotions:read",
"orders:read",
"orders:write",
"customers:read",
"customers:write",
"inventory:read"
]
}
}

A 401 here means the key wasn’t sent or isn’t one of ours: see Authentication.

The API only shows products you’ve chosen to show on your website. In Sabiwave, open a product, turn on Show on your website and save. Then:

Terminal window
curl "https://api.sabiwave.com/api/v1/public/catalog/products?limit=20" \
-H "Authorization: Bearer $SABIWAVE_SECRET_KEY"
200 OK
{
"success": true,
"data": {
"products": [
{
"id": "01a2160c-6b00-7627-af42-d534badeaea4",
"name": "Weekend Gift Hamper",
"slug": "weekend-gift-hamper",
"description": "A weekend of treats in a woven basket: biscuits, chocolate, juice and a card.",
"price": 20000,
"category": {
"id": "01a22538-d1f7-765d-8fbb-efd7afcc9459",
"name": "Hampers"
},
"images": [],
"inStock": true,
"stockLevel": "low_stock",
"variants": [],
"seo": {
"title": null,
"description": null
}
}
],
"nextCursor": null
}
}

Prices are in your business’s currency (here naira), in major units: 20000 is ₦20,000. Stock is inStock and stockLevel, never a count. See Catalogue.

Send the products and quantities, never prices: Sabiwave works out every price, discount and total. Each order needs an Idempotency-Key, so a retry after a timeout can’t place it twice.

Terminal window
curl -X POST "https://api.sabiwave.com/api/v1/public/orders" \
-H "Authorization: Bearer $SABIWAVE_SECRET_KEY" \
-H "Idempotency-Key: order-94e3b347-3321-41a4-bbde-8ce514941b27" \
-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": "pending",
"notes": "Website order #1001"
}'
200 OK
{
"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
}
]
}
}
}

With a test key the answer is 200 and "test": true: what the order comes to, with nothing made. With a live key the same request answers 202 and the order is made. See Take orders on your website.