Skip to main content

Mabawa Developer Platform

Build reliablecommerce on Mabawa.

Building reliable, secure, and scalable solutions for the Mabawa marketplace. Explore the catalogue, compare products and quote fulfilment through one REST API built for the Mabawa marketplace.

Getting started

From account to production in four steps.

You do not need a plan to start. Create an account, generate a sandbox key and send your first request in minutes.

  1. 01

    Create a Mabawa account

    Sign up for a free account and verify your business email to unlock the developer console.

    Create account
  2. 02

    Generate API keys

    In the developer console, create a sandbox key and an OAuth client for your integration.

    See authentication
  3. 03

    Test in Sandbox

    Send requests against the sandbox environment with realistic, isolated catalogue data.

    View environments
  4. 04

    Move to Production

    Swap your base URL and credentials, then enable live traffic with monitoring and alerts.

    Go live checklist

Authentication

Secure access with OAuth 2.0 and scoped keys.

Every request is authenticated with a short-lived access token. Use the client-credentials flow for server-to-server integrations and request only the scopes you need.

Token flow

  1. 1Exchange your client ID and secret for an access token at the token endpoint.
  2. 2Send the token as a bearer credential on each API request.
  3. 3Refresh before expiry using the refresh token, then retry any 401 once.

API keys

For simple server-to-server scripts, create a sandbox or production key in the developer console and send it as X-API-Key. Keys are limited to read-only catalogue endpoints. Use the OAuth 2.0 client-credentials flow for anything that writes data or needs per-user scopes.

Scopes

Grant the minimum access each integration needs.

Scope
inventory:read
Grants access to
Search inventory and read stock levels.
Scope
products:read
Grants access to
Read product metadata and media.
Scope
products:compare
Grants access to
Compare up to six products in one request.
Scope
fulfillment:read
Grants access to
Look up shipping and fulfilment options.
Scope
orders:write
Grants access to
Create and update orders (approval required).

Token lifetimes

Access token
15 minutes
Refresh token
30 days
Sandbox key
Does not expire
Clock skew tolerance
± 60 seconds

Security tips

  • Send the access token as `Authorization: Bearer <token>` on every request.
  • Never expose tokens in client-side code, URLs or logs.
  • Refresh proactively at ~80% of the access-token lifetime.
  • Rotate keys immediately if a credential is ever exposed.
Request an access token
curl --request POST \
  --url https://api.mabawacreations.com/oauth/token \
  --header "Content-Type: application/json" \
  --data '{
    "grant_type": "client_credentials",
    "client_id": "$MABAWA_CLIENT_ID",
    "client_secret": "$MABAWA_CLIENT_SECRET",
    "scope": "inventory:read products:read"
  }'
Token response
{
  "access_token": "eyJhbGciOi...",
  "token_type": "Bearer",
  "expires_in": 900,
  "refresh_token": "def50200...",
  "scope": "inventory:read products:read"
}

API reference

Five endpoints cover the core marketplace flows.

All endpoints return JSON, accept bearer authentication and use the same pagination and error envelope.

5 of 5 endpoints

Scroll to see all endpoints.

GET/v1/inventory/search

Search products and filter by price, category, brand and specification.

Parameters

Name
q
Type
string
Required
Optional
Description
Free-text search across name, SKU and description.
Name
category
Type
string
Required
Optional
Description
Filter by category slug.
Name
minPrice
Type
number
Required
Optional
Description
Minimum unit price in the selected currency.
Name
maxPrice
Type
number
Required
Optional
Description
Maximum unit price in the selected currency.
Name
inStock
Type
boolean
Required
Optional
Description
Only return products with available stock.
Name
page
Type
integer
Required
Required
Description
Page number, 1-based. Defaults to 1.
Name
pageSize
Type
integer
Required
Required
Description
Items per page, 1–100. Defaults to 24.
Request
GET /v1/inventory/search?q=gloves&inStock=true&page=1&pageSize=24
Authorization: Bearer <access_token>
Response · 200 OK
{
  "data": [
    {
      "id": "prod_8f21",
      "name": "Nitrile Grip Gloves",
      "sku": "GLV-NIT-001",
      "price": 1450,
      "currency": "KES",
      "inStock": true
    }
  ],
  "page": 1,
  "pageSize": 24,
  "total": 137
}

Code samples

Quick-start snippets in the languages you use.

Copy a snippet, set your base URL and token, and run it against the sandbox.

Node.js
const BASE = process.env.MABAWA_BASE_URL ??;

export async function searchInventory(query) {
  const url = new URL("/v1/inventory/search", BASE);
  url.searchParams.set("q", query);
  url.searchParams.set("page", "1");
  url.searchParams.set("pageSize", "24");

  const response = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.MABAWA_ACCESS_TOKEN}` },
  });

  if (!response.ok) {
    throw new Error(`Mabawa API ${response.status}: ${await response.text()}`);
  }
  return response.json();
}

SDKs & libraries

Use the REST API directly today.

Mabawa does not publish official language SDKs yet. The REST API is stable and fully documented, and the code samples above are all you need to get started.

Need a client for your stack?

Tell us which language and framework you use. We can share integration guidance, review your implementation, or prioritise an official SDK.

Rate limits & quotas

Stay within the caps and back off cleanly.

Limits are applied per token and per endpoint. Every response includes the remaining quota in the rate-limit headers.

Endpoint
searchInventory
Window
1 minute
Default limit
120 requests
Burst
20
Endpoint
getProductDetails
Window
1 minute
Default limit
300 requests
Burst
50
Endpoint
compareProducts
Window
1 minute
Default limit
60 requests
Burst
10
Endpoint
findFulfillmentOptions
Window
1 minute
Default limit
120 requests
Burst
20
Endpoint
getProductAvailability
Window
1 minute
Default limit
240 requests
Burst
40

Retry strategy

  • Honour the `Retry-After` header when a 429 response includes one.
  • Use exponential backoff with jitter: `min(cap, base × 2^attempt)` seconds.
  • Cap retries at five attempts per request and log the final failure.
  • Never retry 4xx responses other than 408 and 429.
Backoff example
delay = min(30, 0.5 * 2 ** attempt) + random(0, 0.25)

Error handling

Predictable status codes and a useful error body.

Errors use standard HTTP status codes and a consistent JSON envelope with a requestId you can quote to support.

Code
400
Name
Bad request
Meaning
Malformed JSON, missing or invalid parameters.
What to do
Validate the request payload and query string.
Code
401
Name
Unauthorized
Meaning
Missing, expired or invalid access token.
What to do
Refresh the token and retry once.
Code
403
Name
Forbidden
Meaning
The token lacks the required scope.
What to do
Request the missing scope or contact support.
Code
404
Name
Not found
Meaning
The resource or route does not exist.
What to do
Check the product ID and endpoint path.
Code
409
Name
Conflict
Meaning
The request conflicts with current resource state.
What to do
Re-read the resource and reconcile.
Code
422
Name
Unprocessable
Meaning
The payload is valid but semantically rejected.
What to do
Fix the flagged fields and resend.
Code
429
Name
Too many requests
Meaning
The rate limit for the endpoint was exceeded.
What to do
Back off using `Retry-After` and retry.
Code
500
Name
Server error
Meaning
Unexpected failure on the Mabawa API.
What to do
Retry with backoff; contact support if it persists.
Code
503
Name
Unavailable
Meaning
Temporary maintenance or overload.
What to do
Retry later and subscribe to the status page.
Error response · 429
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Too many requests for searchInventory.",
    "status": 429,
    "requestId": "req_01HZX9",
    "retryAfter": 12
  }
}

Troubleshooting

  • Check the requestId in the developer console logs.
  • Confirm the token has the required scope before retrying a 403.
  • Reduce pageSize if responses are truncated.

Best practices

Build for performance, caching and correctness.

Small habits keep integrations fast and resilient as the catalogue grows.

01

Paginate everything

Always send page and pageSize. Never assume a full result set fits in one response.

02

Minimise over-fetching

Use filters and the include parameter so you only transfer the fields you need.

03

Cache immutable data

Cache product details and specifications with a TTL; revalidate availability often.

04

Handle stale inventory

Re-check availability before checkout and surface lead times to the buyer.

05

Refresh tokens early

Renew access tokens at ~80% of their lifetime to avoid request-time expiry.

06

Fail safely

Degrade gracefully on 5xx and show a retry state instead of an empty page.

Security & compliance

Protect credentials, traffic and personal data.

Mabawa is built for regulated buyers. These controls apply to every integration, in sandbox and production.

Encrypt in transit

All traffic must use HTTPS with TLS 1.2 or newer.

Store tokens securely

Keep tokens in a server-side secret store, never in git or the browser.

Redact PII

Do not log names, addresses, phone numbers or payment data.

PCI-DSS scope

Card data never touches your servers; use hosted checkout.

GDPR & data rights

Honour access and deletion requests within statutory timelines.

Rotate credentials

Rotate API keys and OAuth clients on a fixed schedule.

Sandbox & production

Two environments, one integration.

Build and test against the sandbox, then switch the base URL and credentials to go live. The sandbox base URL is namespaced under /api.

Sandbox

Test data

Isolated catalogue and orders for development and automated tests.

Base URLhttps://sandbox.mabawacreations.com/api
  • Resets on a rolling 30-day window
  • No real payments or fulfilment
  • Higher rate limits for CI

Production

Live data

Real catalogue, pricing, stock and fulfilment for customer traffic.

Base URLhttps://api.mabawacreations.com
  • Requires an approved account
  • Standard rate limits apply
  • Monitor status and error budgets

Change log

A versioned timeline of the API.

Follow releases, new endpoints and deprecations. Breaking changes ship under a new version prefix.

  1. v1.4.0

    2026-10-02

    Availability endpointLatest

    • Added getProductAvailability with per-warehouse stock and lead time.
    • Added pageSize maximum of 100 on all list endpoints.
  2. v1.3.0

    2026-08-18

    Compare products

    • Added compareProducts for up to six products.
    • Introduced the products:compare OAuth scope.
  3. v1.2.0

    2026-06-05

    Fulfilment options

    • Added findFulfillmentOptions with carrier and delivery estimates.
    • Deprecated the legacy shipping quote endpoint.
  4. v1.0.0

    2026-02-01

    General availability

    • First public release of the Mabawa API.
    • OAuth 2.0 client credentials and sandbox environment.

FAQ & troubleshooting

Answers to the questions we hear most.

Still stuck? The support section below has direct links to the platform team.

How do I handle pagination?

Send page and pageSize on every list request. Read the page, pageSize and total fields from the response, then stop when page × pageSize is greater than or equal to total. Use a stable sort so pages do not overlap.

What if inventory looks stale?

Inventory is eventually consistent. Re-check availability immediately before checkout, and use the updatedAt field to decide whether to refresh. Cache product details longer than availability.

How long do access tokens last?

Access tokens expire after 15 minutes. Refresh tokens last 30 days. Refresh proactively at around 80% of the access-token lifetime to avoid failed requests.

Is there test data in the sandbox?

Yes. The sandbox mirrors the production schema with isolated catalogue data and simulated payments. It resets on a rolling 30-day window, so do not store long-lived IDs.

How do I report a bug or ask for a new endpoint?

Open a ticket in the developer console or email the developer support address. Include the requestId from the error response so we can trace the request quickly.

Support & community

Get help from the people who build Mabawa.

Reach the developer team for keys, production access, bugs and integration reviews.

Was this page helpful?

Last updated 14 November 2026 · API v1

Ready when you are

Start with the sandbox. Ship with confidence.

Generate a key, send your first request and move to production when you are ready.