Get started

Test your integration in the sandbox

Use the dedicated test products and customer details to exercise purchases, validation and failure handling before going live.

Build confidence before switching to live
  1. Use test credentials

    Connect your server to the sandbox host.

  2. Use exact fixtures

    Select a test product and its matching customer details.

  3. Check the outcome

    Inspect metadata.code and verify each saved reference.

Sandbox connection

Keep testing separate from live.

Use your server-side sk_test_ key. Never send sandbox fixtures to the production host.

Base URL
https://sandbox.strongmb.ng/v1
Authorization header
Bearer YOUR_TEST_SECRET_KEY

Use the test customer numbers below. Other numbers, such as 0123456789 will not produce the same results.

Your test toolkit

Test products and customer details

Pick a service and copy the exact values below. Use these values on the sandbox host and a new reference for each purchase.

Data

Direct purchase
Product code
smb_mtn_test_0001
Phone number
0812345678

No amount field is needed. Change the product or phone to a non-test value to exercise failure handling.

View data examples

Airtime

Direct purchase
Product code
smb_mtn_test_vtu
Phone number
0812345678

Enter at least NGN 50 of airtime, as required by the test product’s min_amount.

View airtime examples

Cable TV

Validate before purchase
Product code
smb_test_cable_tv
Customer number
1212121212

Use the token from your validation response. Do not send an amount field in the purchase.

View cable tv examples

Electricity

Validate before purchase
Meter number
11111111111
Exact test amount
1000
Prepaid
Prepaid product code
smb_elec_pre_test

Set meter_type to prepaid.

Postpaid
Postpaid product code
smb_elec_post_test

Set meter_type to postpaid.

The amount must be exactly 1000. Retrieve prepaid tokens through transaction lookup; postpaid token and units are null.

View electricity examples
Request walkthrough

Test a data purchase

POST to /purchases/data with the matching product and phone fixture.

Data purchase request
{
  "phone": "0812345678",
  "product_code": "smb_mtn_test_0001",
  "reference": "SMBTESTDATA001"
}

To exercise failure handling, change the phone number or product code to a non-test value. Inspect metadata.code and data.status rather than assuming the HTTP status proves success.

Request walkthrough

Test an airtime purchase

POST to /purchases/airtime. Use the test product and phone number below. The example amount of NGN 100 is above the NGN 50 minimum.

Airtime purchase request
{
  "phone": "0812345678",
  "product_code": "smb_mtn_test_vtu",
  "amount": "100",
  "reference": "SMBTESTAIRTIME001"
}

Compare the outcome with the airtime response examples. Do not assume other services’ negative-test rules apply to airtime.

Request walkthrough

Test cable TV: validate, then purchase

1. Validate the test smart card

POST to /customer-validation/cable-tv.

Cable validation request
{
  "smart_card_number": "1212121212",
  "product_code": "smb_test_cable_tv"
}
Successful sandbox validation
{
  "status": true,
  "message": "Smart card number verified successfully.",
  "data": {
    "details": {
      "smart_card_number": "1212121212",
      "customer_name": "Strongmb User",
      "provider": "dstv",
      "renewal_amount": 1000,
      "due_date": "2026-09-25 03:14:22",
      "current_bouquet": "Sample Bouquet"
    },
    "verify_token": "Y2RmbTdjWngvWEE0Mk1EcFhEZ1BTOXdZbFNXMjg0UUl3UDlwVDVyTFBObz0="
  },
  "metadata": {
    "code": "CABLE_TV_ACCOUNT_VERIFIED",
    "timestamp": 1790302462,
    "trace_id": "BC600776B5"
  }
}

Use the actual verify_token returned by your request. The token printed here is an example and must not be treated as a reusable credential.

2. Exercise validation failures

With a non-test product code:

JSON
{
  "status": false,
  "message": "Invalid product code or the product is inactive.",
  "data": null,
  "metadata": {
    "code": "ERR_INVALID_PRODUCT_CODE_OR_INACTIVE",
    "timestamp": 1790302502,
    "trace_id": "35DE5AEEBA"
  }
}

With the correct test product but a non-test customer number:

JSON
{
  "status": false,
  "message": "Invalid smart card number or the account is inactive.",
  "data": null,
  "metadata": {
    "code": "ERR_INVALID_CABLE_TV_ACCOUNT",
    "timestamp": 1790302511,
    "trace_id": "0D38858F61"
  }
}

3. Submit the purchase

POST to /purchases/cable-tv. There is no amount field.

Cable purchase request
{
  "smart_card_number": "1212121212",
  "product_code": "smb_test_cable_tv",
  "reference": "SMBTESTCABLE001",
  "verify_token": "TOKEN_FROM_YOUR_VALIDATION_RESPONSE"
}
Successful sandbox purchase
{
  "status": true,
  "message": "Transaction completed successfully.",
  "data": {
    "transaction_status": "successful",
    "type": "cable_tv",
    "provider": "dstv",
    "title": "₦1,010 Subscription",
    "recipient": "1212121212",
    "recipient_name": "Strongmb User",
    "status": "successful",
    "package_name": "Sample Package",
    "package_amount": 1000,
    "fee": "10.00",
    "description": "This is a test cable tv purchase.",
    "reference": "SMBTESTCABLE001",
    "date": "2026-09-25 03:16:00",
    "currency": "NGN",
    "balance_before": "10000000000",
    "balance_after": "9999998990",
    "amount": "1010.00"
  },
  "metadata": {
    "code": "TRANSACTION_SUCCESSFUL",
    "timestamp": 1790302560,
    "trace_id": "234F209922"
  }
}

This test fixture has a package amount of 1000, a fee of 10 and a total debit of 1010. These are sandbox values, not live prices. transaction_status is shown for compatibility; read data.status in new integrations.

Request walkthrough

Test electricity: prepaid and postpaid

Validate the meter through /customer-validation/electricity before purchasing. Keep the meter type and product code matched. The sandbox amount must be exactly 1000, no more and no less.

Prepaid validation

POST /customer-validation/electricity
{
  "meter_number": "11111111111",
  "meter_type": "prepaid",
  "product_code": "smb_elec_pre_test"
}

Prepaid purchase

POST /purchases/electricity
{
  "meter_number": "11111111111",
  "meter_type": "prepaid",
  "product_code": "smb_elec_pre_test",
  "amount": "1000",
  "reference": "SMBTESTELECPREPAID001",
  "verify_token": "TOKEN_FROM_YOUR_VALIDATION_RESPONSE",
  "phone": "081234567899",
  "email": "[email protected]"
}

Postpaid validation

POST /customer-validation/electricity
{
  "meter_number": "11111111111",
  "meter_type": "postpaid",
  "product_code": "smb_elec_post_test"
}

Postpaid purchase

POST /purchases/electricity
{
  "meter_number": "11111111111",
  "meter_type": "postpaid",
  "product_code": "smb_elec_post_test",
  "amount": "1000",
  "reference": "SMBTESTELECPOSTPAID001",
  "verify_token": "TOKEN_FROM_YOUR_VALIDATION_RESPONSE",
  "phone": "081234567899",
  "email": "[email protected]"
}

phone and email are optional notification destinations, not success-test triggers. Use a contact you control if you need to test delivery, or omit both fields. The email shown above is a placeholder.

Use non-test inputs to exercise failure handling. This includes a wrong test product, meter details or an amount other than exactly 1000. Read the returned metadata code; a validation rejection and a failed purchase are different outcomes.

Retrieve the token after purchase

The initial purchase response does not include the prepaid token. Always query GET /transactions/{reference}. For prepaid, read data.transaction.details.token and units after checking the outcome. For postpaid, token field is null; no token is required. See the complete prepaid and postpaid responses.

Transaction lookup

Explore sample transactions

Use GET /transactions to view all samples. The response contains data.count and data.transactions. To retrieve one sample, pass its exact reference to GET /transactions/{reference}.

Data

Lookup reference
SMBDATABUNDLEREF

A successful MTN data bundle.

Airtime

Lookup reference
SMBAIRTIMEREF

A successful MTN airtime purchase.

Cable TV

Lookup reference
SMBCABLETVREF

A successful DStv subscription.

Electricity prepaid

Lookup reference
SMBELECPREPAIDREF

Includes a sample token and units. The token cannot load a real meter.

Electricity postpaid

Lookup reference
SMBELECPOSTPAIDREF

Token is null. Postpaid does not require a recharge token.

List the sample transactions

Run these examples on your server as Node.js modules (.mjs) with built-in fetch. Set STRONGMB_API_KEY to your test secret key; never expose it in browser code.

Node.js - list transactions
const apiKey = process.env.STRONGMB_API_KEY;
if (!apiKey) throw new Error('Set STRONGMB_API_KEY to your test secret key.');

const response = await fetch('https://sandbox.strongmb.ng/v1/transactions', {
  headers: { Authorization: `Bearer ${apiKey}` }
});
const payload = await response.json();

if (!response.ok || payload.metadata?.code !== 'TRANSACTIONS_RETRIEVED') {
  throw new Error(payload.message || 'Transaction request failed.');
}

console.log(payload.data.transactions);

A successful list request returns metadata.code: TRANSACTIONS_RETRIEVED. Each item includes its reference, status, amount and service-specific details.

Find the postpaid transaction by reference

Node.js - get a transaction
const apiKey = process.env.STRONGMB_API_KEY;
if (!apiKey) throw new Error('Set STRONGMB_API_KEY to your test secret key.');

const reference = 'SMBELECPOSTPAIDREF';
const response = await fetch(`https://sandbox.strongmb.ng/v1/transactions/${encodeURIComponent(reference)}`, {
  headers: { Authorization: `Bearer ${apiKey}` }
});
const payload = await response.json();

if (!response.ok || payload.metadata?.code !== 'TRANSACTION_DETAILS_RETRIEVED') {
  throw new Error(payload.message || 'Transaction request failed.');
}

console.log(payload.data.transaction);

Replace SMBELECPOSTPAIDREF with any reference above to view that product’s sample. A successful lookup returns metadata.code: TRANSACTION_DETAILS_RETRIEVED. Read its status and details; do not rely on HTTP status alone.

To test a missing transaction, use SMBUNKNOWNREF. The sandbox returns HTTP 404, status: false, data: null and metadata.code: ERR_TRANSACTIONS_NOT_FOUND.

See the transaction list response and transaction details response fields. In live integrations, query the reference you supplied for the actual purchase.

What to verify before going live

  • Your app checks metadata.code, not only HTTP status.
  • Successful, failed and processing outcomes have separate handling.
  • Processing orders remain pending, without premature refunds.
  • Every purchase reference is saved before the request and reused for lookup.
  • Customer-validation tokens come from the matching validation response.
  • Prepaid receipts get token details from transaction lookup; postpaid receipts handle null values.

Continue with Going live when your integration is ready.

Questions? Let’s work through them.

Having an issue or need help with your integration? Join the Strongmb Slack community to ask questions and get assistance from our team and other developers.

Keep API keys and customer details private when sharing examples.

Experiencing a service issue? Check Strongmb’s service status for incident updates.

Join our Slack community

Did this page help you?

Search documentation