Architecture & Overview
Single Unified REST Contract
The SaukiMart Developer API standardizes mobile data recharges for MTN, Airtel, Glo, and 9Mobile. Regardless of network carrier, the request schema, status codes, and callback signatures are completely uniform.
| Base Production URL | https://saukimart.com |
| Sandbox Base URL | https://saukimart.com/api/v1/test |
| Data Format | JSON (Content-Type: application/json) |
| Authentication | Header: x-api-key: sm_live_... / sm_test_... |
| Default Rate Limit | 90 requests / minute per API key |
Quickstart
4 Steps to Integration
Go from registration to live data fulfillment in under 5 minutes.
Sign up, enable Developer Mode in the dashboard, and copy your live (sm_live_...) or test key.
Call GET /api/v1/data-plans to get wholesale plan codes, validity, and discounted developer rates.
Send a POST to /api/v1/purchase-data with the target phone, planCode, network, and idempotencyKey.
Optionally register a webhook endpoint to receive real-time completion callbacks.
Security & Auth
API Key Authentication
All API requests must include your secret API key in the x-api-key HTTP header. Keys are prefixed with sm_live_ for production and sm_test_ for sandbox environments.
| Header | Format | Description |
|---|---|---|
| x-api-key | sm_live_<prefix>_<secret> | Production key — debits live wallet balance |
| x-api-key | sm_test_<prefix>_<secret> | Sandbox key — ₦0 simulated transactions |
| Content-Type | application/json | Required for all POST/PUT request bodies |
Available Scopes
| Scope | Grants Access To |
|---|---|
read:plans | GET /api/v1/data-plans, GET /api/v1/me, GET /api/v1/wallet/balance |
write:purchases | POST /api/v1/purchase-data |
read:transactions | GET /api/v1/transactions, GET /api/v1/transactions/:id |
Endpoint 01 · Account
Get User Profile
Returns the authenticated developer's profile details, account status, and API key metadata. Use this endpoint to verify authentication and display user information in your integration dashboard.
/api/v1/meread:plansParameters & Schema Guide
Endpoint 02 · Account
Fetch Wallet Balance
Returns the current wallet balance for the authenticated developer. Use this before executing purchases to verify sufficient funds and prevent 402 INSUFFICIENT_FUNDS errors.
/api/v1/wallet/balanceread:plansParameters & Schema Guide
- Call this endpoint before every purchase to pre-flight check available balance.
- Fund your wallet via bank transfer to the virtual account number shown in GET /api/v1/me.
Plan Catalog
Current Wholesale & Developer Rates
Updated in real-time. Pass the numeric planCode into your API purchase calls.
Endpoint 03 · Core Data API
Fetch Available Data Plans
Returns the active mobile data bundle catalog across all supported Nigerian carriers (MTN, Airtel, Glo, 9Mobile) with real-time wholesale developer pricing calculated for your account.
/api/v1/data-plansread:plansParameters & Schema Guide
- Cache the plan catalog locally for 5–15 minutes to reduce API latency in your checkout flows.
- Always use the integer "code" field as the plan identifier in your purchase requests.
Endpoint 04 · Core Data API
Purchase Mobile Data Bundle
Executes instant, automated data delivery to the specified Nigerian phone number. Guaranteed atomic wallet deduction with idempotency protection to eliminate double debit risks.
/api/v1/purchase-datawrite:purchasesParameters & Schema Guide
- Always supply a unique idempotencyKey per customer order. If network timeouts occur, retry with the EXACT SAME idempotencyKey.
- Sandbox testing: Recipient number 08012345678 will simulate instant delivery with ₦0 wallet debit.
Endpoint 05 · Reconciliation
Query Transaction History
Fetch paginated developer transaction logs, carrier delivery receipts, and reconciliation records. Filter by status or idempotency key.
/api/v1/transactionsread:transactionsParameters & Schema Guide
- Use query filtering to automate end-of-day reconciliation with your accounting ledgers.
Endpoint 06 · Reconciliation
Query Individual Transaction
Look up a single transaction by its SaukiMart Transaction ID, Internal DB UUID, or your original Idempotency Key. Critical for timeout recovery and polling pending fulfillment states.
/api/v1/transactions/:idread:transactionsParameters & Schema Guide
- If a POST /purchase-data call times out on your end, do NOT immediately retry with a new key. Call this endpoint with your idempotencyKey to inspect whether the initial purchase succeeded.
- If the status is "pending", poll this endpoint with exponential backoff (e.g. 5s, 15s, 30s) or rely on incoming webhooks.
Webhooks & Events
Real-time Delivery Webhooks
Instead of polling the API, configure an HTTPS webhook URL in your developer dashboard. SaukiMart sends automated HTTP POST event dispatches whenever asynchronous telecom fulfillment completes or fails.
Webhook Event Catalog
| Event | Trigger Condition | Expected Action |
|---|---|---|
developer.purchase.completed | Carrier confirmed data bundle delivered to recipient | Mark order completed in your system and notify end-user |
developer.purchase.failed | Carrier rejected fulfillment or invalid number | Refund end-user or prompt to re-enter phone number |
developer.wallet.low_balance | Developer wallet balance fell below threshold (₦5,000) | Alert finance team to fund developer wallet |
If you configure a webhook signing secret in your dashboard, every webhook dispatch includes the X-SaukiMart-Webhook-Secret header. Verify this header matches your secret to protect against replay attacks.
// Express / Node.js Webhook Handler
app.post('/api/webhooks/saukimart', (req, res) => {
const secret = req.headers['x-saukimart-webhook-secret'];
if (secret !== process.env.SAUKIMART_WEBHOOK_SECRET) {
return res.status(401).send('Unauthorized');
}
const { event, transactionId, status } = req.body;
if (event === 'developer.purchase.completed') {
// Fulfill customer order in your database
}
res.status(200).json({ received: true });
});Reference & Diagnostics
HTTP Status Codes & Error Matrix
Every API failure returns a standard JSON error payload containing machine-readable error codes, human-friendly diagnostics, and an idempotent request tracking ID.
Architecture Reference
Rate Limiting & Idempotency Rules
SaukiMart enforces production-grade reliability primitives to guarantee zero double debits and maintain 99.99% infrastructure availability.
Every POST /api/v1/purchase-data request requires an idempotencyKey. If your server encounters a network timeout or 502 Bad Gateway, retrying with the exact same key guarantees your wallet is charged at most once.
Production keys are provisioned for 90 requests/minute (custom limits up to 600 req/min available for enterprise). Every response returns:
X-RateLimit-Limit: Max requests allowed per windowX-RateLimit-Remaining: Remaining requests in current windowX-RateLimit-Reset: UTC ISO timestamp when window resets
SDKs & Resources
Developer SDKs & OpenAPI Specification
Accelerate your telecom integration with official code samples, OpenAPI 3.0 schemas, and Postman collections.
Complete machine-readable JSON OpenAPI specification for code generators and Swagger UI.
Direct HTTP calls from any programming language or command-line environment.
Native Fetch, Axios, or HTTP client integrations with complete TypeScript types.
Requests and HTTPX client code snippets for instant backend vending.