Skip to API reference
API Documentation Index

Architecture & Overview

Single Unified Telecom REST Contract

The SaukiMart Developer API standardizes instant mobile data bundle delivery across MTN, Airtel, Glo, and 9Mobile. Every carrier shares one uniform request schema, atomic wallet deduction with idempotency protection, and real-time webhook callbacks.

Base Production URLhttps://saukimart.com
Sandbox Base URLhttps://saukimart.com/api/v1/test
Data FormatJSON (Content-Type: application/json)
AuthenticationHeader: x-api-key: sm_live_... / sm_test_...
Default Rate Limit90 requests / minute per API key (configurable up to 600)

Quickstart

4 Steps to Production Fulfillment

Go from account registration to verified sandbox testing and live carrier fulfillment in minutes.

STEP 11. Get Your Key

Sign up or sign in to auto-provision sandbox (sm_test_...) and live (sm_live_...) API keys.

STEP 22. Query Plans

Call GET /api/v1/data-plans to retrieve planCode values, validity, and wholesale rates.

STEP 33. Execute Purchase

Send POST /api/v1/purchase-data with recipient phoneNumber, planCode, network, and idempotencyKey.

STEP 44. Receive Webhooks

Configure your HTTPS webhook endpoint to verify completion events in real time.

Generate or explain this API with your coding assistant:
Ready to delegate integration?Copy the full integration prompt with endpoints, carrier IDs, error handling, and idempotency rules.
Inspect Master Developer Prompt
You are a Senior Full-Stack Software Engineer. Your task is to integrate the SaukiMart Telecom Data & Airtime API into our application backend.

### Context & Goal
SaukiMart (https://saukimart.com) provides a unified REST API for instant mobile data bundle vending across all 4 major Nigerian telecom networks (MTN, Airtel, Glo, 9Mobile).

### Base Configuration
- Base URL: https://saukimart.com
- Sandbox Base URL: https://saukimart.com/api/v1/test
- Authentication: Pass the secret API key in the 'x-api-key' HTTP header.
- Headers required:
  - x-api-key: sm_live_9a8b7c6d5e4f...
  - Content-Type: application/json

### Core Endpoints to Implement

1. Fetch Data Plans (GET /api/v1/data-plans)
   - Method: GET
   - URL: https://saukimart.com/api/v1/data-plans
   - Headers: x-api-key: <KEY>
   - Response: Returns array of active plans with 'code' (numeric plan ID), 'network' (MTN, AIRTEL, GLO, 9MOBILE), 'dataSize', 'validity', and 'developerPrice'.

2. Purchase Mobile Data Bundle (POST /api/v1/purchase-data)
   - Method: POST
   - URL: https://saukimart.com/api/v1/purchase-data
   - Request Body:
     {
       "phoneNumber": "08012345678",
       "planCode": 23,
       "network": 1,
       "idempotencyKey": "unique_uuid_per_order"
     }
     * Note on network ID: 1 = MTN, 2 = Glo, 3 = 9Mobile, 4 = Airtel.
     * Note on idempotencyKey: Always pass a unique UUID per transaction to guarantee at most single debit.

3. Query Transaction Receipt (GET /api/v1/transactions)
   - Method: GET
   - URL: https://saukimart.com/api/v1/transactions?limit=20
   - Query by Idempotency Key: https://saukimart.com/api/v1/transactions?idempotencyKey=unique_uuid_per_order

4. Webhook Callback Listener (POST /api/webhooks/saukimart)
   - Setup an endpoint in our app to receive delivery event webhooks:
     {
       "event": "developer.purchase.completed",
       "transactionId": "tx_uuid",
       "status": "success",
       "planCode": 23,
       "phoneNumber": "08012345678",
       "amount": 332.50,
       "timestamp": "2026-08-19T03:00:00Z"
     }

### Error Handling & Reliability
- HTTP 402: Handle INSUFFICIENT_FUNDS (prompt admin/user that developer wallet needs funding).
- HTTP 429: Respect Retry-After header and apply exponential backoff.
- On network timeout, retry with the EXACT SAME idempotencyKey so the wallet is debited at most once.
- Sandbox testing: Phone number 08012345678 simulates instant success with ₦0 debit.

Please write clean, modular, production-ready code with error handling and environment variable configuration for our stack.
Quickstart Sample · cURL
# 1. Fetch available data plans across MTN, Airtel, Glo & 9Mobile
$curl -X GET "https://saukimart.com/api/v1/data-plans" \
  -H "x-api-key: sm_live_9a8b7c6d5e4f..."

# 2. Purchase data bundle with idempotency protection
$curl -X POST "https://saukimart.com/api/v1/purchase-data" \
  -H "Content-Type: application/json" \
  -H "x-api-key: sm_live_9a8b7c6d5e4f..." \
  -d '{
    "phoneNumber": "08012345678",
    "planCode": 23,
    "network": 1,
    "idempotencyKey": "req_8f19e7a2b"
  }'

Security & Auth

API Key Authentication

Every /api/v1/* request requires your secret API key in the x-api-key HTTP header. Keys are scoped per environment (sm_live_ vs sm_test_), encrypted at rest with AES-256-GCM plus SHA-256 hash verification, and support per-key IP allowlisting.

HeaderFormatDescription
x-api-keysm_live_<prefix>_<secret>Production key — debits live developer wallet balance
x-api-keysm_test_<prefix>_<secret>Sandbox key — ₦0 simulated fulfillment responses
Content-Typeapplication/jsonRequired for all POST requests
Header Authentication Format
$curl -X GET "https://saukimart.com/api/v1/data-plans" \
  -H "x-api-key: sm_live_9a8b7c6d5e4f..."
Error Response — Invalid or Missing Key (401)
401 Unauthorized · application/json
{
  "success": false,
  "error": "A valid API key is required. Pass your key in the x-api-key header.",
  "code": "INVALID_API_KEY",
  "statusCode": 401,
  "requestId": "req_a1b2c3d4"
}
Available Key Scopes
ScopeGrants Access To
read:plansGET /api/v1/data-plans, GET /api/v1/me, GET /api/v1/wallet/balance
write:purchasesPOST /api/v1/purchase-data
read:transactionsGET /api/v1/transactions, GET /api/v1/transactions/:id

Endpoint 01 · Account

Get User Profile

Returns the authenticated developer's profile details, virtual bank funding account details, and API key metadata.

GET/api/v1/me
Scope: read:plans
GET /api/v1/me · cURL
$curl -X GET "https://saukimart.com/api/v1/me" \
  -H "x-api-key: sm_live_9a8b7c6d5e4f..."
Example Response Payload
200 OK · application/json
{
  "success": true,
  "version": "2026-04-17",
  "requestId": "req_a1b2c3d4",
  "user": {
    "id": "usr_uuid_12345",
    "firstName": "David",
    "lastName": "Adeleke",
    "phone": "08012345678",
    "isDeveloper": true,
    "developerDiscountPercent": 5,
    "accountNumber": "7821234567",
    "bankName": "Flutterwave MFB",
    "phoneVerified": true,
    "phoneVerifiedAt": "2026-06-15T10:30:00Z",
    "createdAt": "2026-05-01T08:00:00Z"
  },
  "environment": "live",
  "keyName": "production-server",
  "scopes": [
    "read:plans",
    "write:purchases",
    "read:transactions"
  ]
}
Parameters & Schema
FieldTypeDescription
user.id*stringUnique user identifier (UUID)
user.firstName*stringDeveloper first name
user.lastName*stringDeveloper last name
user.phone*string11-digit registered phone number
user.developerDiscountPercent*numberWholesale discount tier percentage
user.accountNumberstring | nullDedicated virtual bank account for instant wallet funding
user.bankNamestring | nullIssuing bank name for the virtual account
environment*stringActive key environment ("live" or "test")
scopes*string[]Permissions granted to the active API key

Endpoint 02 · Account

Fetch Wallet Balance

Returns the current NGN wallet balance for the authenticated developer account. Check before vending to prevent 402 INSUFFICIENT_FUNDS errors.

GET/api/v1/wallet/balance
Scope: read:plans
GET /api/v1/wallet/balance · cURL
$curl -X GET "https://saukimart.com/api/v1/wallet/balance" \
  -H "x-api-key: sm_live_9a8b7c6d5e4f..."
Example Response Payload
200 OK · application/json
{
  "success": true,
  "version": "2026-04-17",
  "requestId": "req_e5f6g7h8",
  "wallet": {
    "balance": 125430.5,
    "currency": "NGN",
    "lastUpdated": "2026-08-19T14:30:00Z"
  },
  "environment": "live"
}
Parameters & Schema
FieldTypeDescription
wallet.balance*numberAvailable wallet credit balance in NGN
wallet.currency*stringCurrency code ("NGN")
wallet.lastUpdated*ISO 8601Timestamp of last wallet ledger update
Integration Notes
  • Call this endpoint before batch vending jobs to monitor balance availability.
  • Transfers into your dedicated virtual bank account credit your wallet automatically.

Plan Catalog · Live ISR Snapshot

Wholesale & Developer Rates

Pass the numeric planCode shown below into POST /api/v1/purchase-data. Query GET /api/v1/data-plans for your complete live catalog.

GET
MTN

MTN

Wholesale API
CodeSizeValidDev Rate
77200MB7d₦150.00
56500MB7d₦230.00
571GBPopular7d₦400.00
511GB30d₦500.00
582GB7d₦750.00
522GB30d₦850.00
GLO

GLO

Wholesale API
CodeSizeValidDev Rate
651.5GB1d₦350.00
601GBPopular3d₦400.00
613GB3d₦1,200.00
625GB3d₦2,000.00
635GB7d₦2,000.00
645GB30d₦2,200.00
AIRTEL

AIRTEL

Wholesale API
CodeSizeValidDev Rate
67600MB (Sme)2d₦300.00
681GB (Sme Social)3d₦350.00
661.5GB1d₦499.00
692GB (Sme)2d₦700.00
721GB (Gifting)7d₦900.00
703GB (Sme)2d₦1,000.00

Endpoint 03 · Core Data API

Fetch Available Data Plans

Returns all active mobile data bundles across MTN, Airtel, Glo, and 9Mobile with exact wholesale pricing computed for your developer account.

GET/api/v1/data-plans
Scope: read:plans
GET /api/v1/data-plans · cURL
$curl -X GET "https://saukimart.com/api/v1/data-plans" \
  -H "x-api-key: sm_live_9a8b7c6d5e4f..."
Example Response Payload
200 OK · application/json
{
  "success": true,
  "version": "2026-04-17",
  "requestId": "req_dp_10293847",
  "discountPercent": 5,
  "plans": [
    {
      "code": 23,
      "network": "MTN",
      "networkId": 1,
      "planId": 201,
      "dataSize": "1GB",
      "validity": "30 Days",
      "appPrice": 350,
      "developerPrice": 332.5
    },
    {
      "code": 24,
      "network": "MTN",
      "networkId": 1,
      "planId": 202,
      "dataSize": "2GB",
      "validity": "30 Days",
      "appPrice": 700,
      "developerPrice": 665
    },
    {
      "code": 31,
      "network": "GLO",
      "networkId": 2,
      "planId": 301,
      "dataSize": "1GB",
      "validity": "30 Days",
      "appPrice": 399,
      "developerPrice": 379.05
    },
    {
      "code": 41,
      "network": "AIRTEL",
      "networkId": 4,
      "planId": 401,
      "dataSize": "1GB",
      "validity": "30 Days",
      "appPrice": 760,
      "developerPrice": 722
    }
  ]
}
Parameters & Schema
FieldTypeDescription
code*integerNumeric planCode passed into POST /api/v1/purchase-data
network*stringCarrier label: MTN, AIRTEL, GLO, or 9MOBILE
networkId*integerCarrier code: 1=MTN, 2=Glo, 3=9Mobile, 4=Airtel
dataSize*stringBundle capacity (e.g. 500MB, 1GB, 5GB)
validity*stringBundle validity window (e.g. "30 Days")
developerPrice*numberWholesale amount in NGN debited from your wallet
appPrice*numberRetail app price in NGN
Integration Notes
  • Cache the returned catalog for 5–15 minutes to keep checkout pages instantaneous.
  • Always pass the integer code property as planCode when calling /api/v1/purchase-data.

Endpoint 04 · Core Data API

Purchase Mobile Data Bundle

Executes instant automated data delivery to a Nigerian MSISDN. Protected by database-enforced idempotency to guarantee at most one debit per order.

POST/api/v1/purchase-data
Scope: write:purchases
POST /api/v1/purchase-data · cURL
$curl -X POST "https://saukimart.com/api/v1/purchase-data" \
  -H "Content-Type: application/json" \
  -H "x-api-key: sm_live_9a8b7c6d5e4f..." \
  -d '{
    "phoneNumber": "08012345678",
    "planCode": 23,
    "network": 1,
    "idempotencyKey": "order_uuid_98f12a4c"
  }'
Example Response Payload
200 OK · application/json
{
  "success": true,
  "status": "success",
  "transactionId": "tx_a8f9c0e2_1948",
  "idempotencyKey": "order_uuid_98f12a4c",
  "data": {
    "planCode": 23,
    "network": "MTN",
    "phoneNumber": "08012345678",
    "dataSize": "1GB",
    "deliveryReference": "AMG-987654321"
  },
  "developerPrice": 332.5,
  "newBalance": 125098,
  "timestamp": "2026-08-21T14:30:00Z"
}
Parameters & Schema
FieldTypeDescription
phoneNumber*string11-digit Nigerian recipient number (e.g. "08012345678")
planCode*integerNumeric plan code returned by GET /api/v1/data-plans
network*integer1 = MTN, 2 = Glo, 3 = 9Mobile, 4 = Airtel
idempotencyKey*stringUnique UUIDv4 per order to prevent double debits on retry
Integration Notes
  • Always reuse the exact same idempotencyKey when retrying after a network timeout.
  • Sandbox mode: phoneNumber "08012345678" (or any sm_test_ key) simulates delivery at ₦0 cost.

Endpoint 05 · Reconciliation

Query Transaction History

Retrieve paginated developer transactions, carrier references, and wholesale deductions. Supports filtering by status, transactionId, or idempotencyKey.

GET/api/v1/transactions
Scope: read:transactions
GET /api/v1/transactions · cURL
$curl -X GET "https://saukimart.com/api/v1/transactions?limit=20&status=success" \
  -H "x-api-key: sm_live_9a8b7c6d5e4f..."
Example Response Payload
200 OK · application/json
{
  "success": true,
  "version": "2026-04-17",
  "requestId": "req_tx_query_9812",
  "transactions": [
    {
      "id": "dev_tx_01",
      "transactionId": "tx_a8f9c0e2_1948",
      "status": "success",
      "phoneNumber": "08012345678",
      "network": "MTN",
      "planCode": "23",
      "planName": "MTN 1GB (30 Days)",
      "developerPrice": 332.5,
      "appPrice": 350,
      "idempotencyKey": "order_uuid_98f12a4c",
      "amigoReference": "AMG-987654321",
      "createdAt": "2026-08-21T14:30:00Z"
    }
  ]
}
Parameters & Schema
FieldTypeDescription
limitquery integerMaximum records returned (default: 50, max: 200)
statusquery stringFilter status ("success", "pending", "failed")
idempotencyKeyquery stringFilter by original idempotency key
transactionIdquery stringFilter by SaukiMart transaction ID
Integration Notes
  • Schedule automated ledger reconciliation jobs using limit and idempotencyKey filters.

Endpoint 06 · Reconciliation

Query Individual Transaction

Inspect a single transaction receipt by Transaction ID, database UUID, or your client idempotencyKey to recover cleanly from request timeouts.

GET/api/v1/transactions/:id
Scope: read:transactions
GET /api/v1/transactions/:id · cURL
$curl -X GET "https://saukimart.com/api/v1/transactions/order_uuid_98f12a4c" \
  -H "x-api-key: sm_live_9a8b7c6d5e4f..."
Example Response Payload
200 OK · application/json
{
  "success": true,
  "version": "2026-04-17",
  "requestId": "req_single_tx_5544",
  "transaction": {
    "id": "dev_tx_uuid_1029",
    "transactionId": "tx_a8f9c0e2_1948",
    "status": "success",
    "transactionStatus": "COMPLETED",
    "phoneNumber": "08012345678",
    "network": "MTN",
    "planCode": "23",
    "planName": "MTN 1GB (30 Days)",
    "developerPrice": 332.5,
    "appPrice": 350,
    "idempotencyKey": "order_uuid_98f12a4c",
    "amigoReference": "AMG-987654321",
    "rawStatus": "SUCCESSFUL",
    "endpoint": "/api/v1/purchase-data",
    "message": "Data bundle successfully delivered to recipient",
    "createdAt": "2026-08-21T14:30:00Z"
  },
  "environment": "live"
}
Parameters & Schema
FieldTypeDescription
:id (path)*stringTransaction ID, internal UUID, or idempotencyKey
transaction.status*string"success", "pending", or "failed"
transaction.amigoReferencestring | nullUpstream carrier fulfillment reference
transaction.developerPrice*numberExact wholesale debit in NGN
Integration Notes
  • Always query this endpoint with your original idempotencyKey after any network timeout before issuing a replacement purchase.
  • For "pending" responses, poll with backoff (5s, 15s, 30s) or listen for webhooks.

Webhooks & Events

Real-time Delivery Webhooks

Configure a public HTTPS webhook endpoint per API key inside the Developer Console. SaukiMart sends signed HTTP POST callbacks whenever fulfillment transitions or wallet balance thresholds trigger.

Incoming Webhook POST Event Payload
POST /api/webhooks/saukimart · application/json
{
  "event": "developer.purchase.completed",
  "transactionId": "tx_a8f9c0e2_1948",
  "status": "success",
  "planCode": 23,
  "network": "MTN",
  "phoneNumber": "08012345678",
  "dataSize": "1GB",
  "amount": 332.5,
  "idempotencyKey": "order_uuid_98f12a4c",
  "timestamp": "2026-08-21T14:30:05.000Z"
}
Webhook Event Catalog
EventTrigger ConditionExpected Action
developer.purchase.completedCarrier confirmed data bundle delivered to recipientMark order completed in your system and notify end-user
developer.purchase.failedCarrier rejected fulfillment or invalid numberRefund end-user or prompt to re-enter phone number
developer.wallet.low_balanceDeveloper wallet balance fell below threshold (₦5,000)Alert finance team to fund developer wallet
Webhook Signature Verification

Every callback includes the X-SaukiMart-Webhook-Secret header matching the signing secret configured on your key in the Developer Console.

Express / Node.js Webhook Handler
// 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') {
    // Mark fulfillment completed for transactionId (status)
  }

  res.status(200).json({ received: true });
});

Reference & Diagnostics

HTTP Status Codes & Error Matrix

Failed requests return deterministic JSON error envelopes with machine-readable error codes and a unique requestId.

Standard Failure Response Envelope
402 Payment Required · application/json
{
  "success": false,
  "error": "Insufficient wallet balance to fulfill purchase",
  "code": "INSUFFICIENT_FUNDS",
  "statusCode": 402,
  "requestId": "req_98f12a",
  "timestamp": "2026-08-21T14:30:00.000Z"
}
HTTP StatusError CodeDescriptionRecommended Action
200 OKSUCCESSPurchase executed and bundle vended successfully.Parse transactionId and store confirmation in your database.
400 Bad RequestINVALID_PARAMSMissing required fields (phoneNumber, planCode, or network).Ensure request body satisfies schema requirements.
401 UnauthorizedINVALID_API_KEYx-api-key header is missing, expired, or invalid.Verify your key credentials in the Developer Console.
402 Payment RequiredINSUFFICIENT_FUNDSWallet balance is lower than developer wholesale price.Fund your Sauki developer wallet via virtual bank transfer.
404 Not FoundPLAN_NOT_FOUNDThe specified planCode does not exist for this network.Query GET /api/v1/data-plans for active bundles.
404 Not FoundTRANSACTION_NOT_FOUNDNo transaction matching the provided ID or idempotency key.Check reference string or verify transaction belongs to this key.
409 ConflictDUPLICATE_IDEMPOTENCY_KEYA purchase with this idempotencyKey was already processed.Query GET /api/v1/transactions/:id to inspect original status.
422 UnprocessableINVALID_PHONE_NUMBERRecipient phone number is invalid (must be 11-digit Nigerian MSISDN).Validate 11-digit phone format before sending.
429 Too Many RequestsRATE_LIMIT_EXCEEDEDExceeded 90 requests/minute throughput.Read Retry-After header and apply exponential backoff.
502 Bad GatewayPROVIDER_DOWNUpstream telecom carrier switch is temporarily unreachable.Retry with the EXACT SAME idempotencyKey after a short delay.
503 UnavailableMAINTENANCECarrier bundle network is undergoing scheduled maintenance.Check carrier status and retry during operational windows.

Architecture Reference

Rate Limiting & Idempotency Rules

Reliability primitives protect your wallet ledger against duplicate retries and sudden traffic bursts.

Zero Double-Debit Guarantee

Every POST /api/v1/purchase-data call enforces an atomic idempotencyKey. Retrying a timed-out request with the exact same key replays the original outcome without billing your wallet twice.

Rate Limits & Response Headers

Keys default to 90 requests/minute (adjustable per key up to 600 req/min inside Developer Console):

  • X-RateLimit-Limit: Per-minute quota
  • X-RateLimit-Remaining: Remaining quota
  • X-RateLimit-Reset: ISO UTC reset time

SDKs & Schemas

OpenAPI Spec & Stack Templates

Generate strongly typed API clients automatically from our OpenAPI 3.1 document or copy the native templates in Quickstart.

OpenAPI 3.1 Schema

Complete machine-readable JSON OpenAPI specification for code generators, Insomnia, and Postman.

Open OpenAPI Spec
cURL & Shell Automation

Direct HTTP requests for cron jobs, monitoring probes, and quick sanity tests.

View Samples
Node.js / Next.js Route Handlers

Zero-dependency native Fetch examples with TypeScript safety and idempotency keys.

View Code
Python / PHP / Go / Java

Production-ready HTTP client examples with strict timeout and retry handling.

View Code