Data
Direct purchasesmb_mtn_test_0001
0812345678
No amount field is needed. Change the product or phone to a non-test value to exercise failure handling.
View data examplesUse the dedicated test products and customer details to exercise purchases, validation and failure handling before going live.
Connect your server to the sandbox host.
Select a test product and its matching customer details.
Inspect metadata.code and verify each saved reference.
Use your server-side sk_test_ key. Never send sandbox fixtures to the production host.
https://sandbox.strongmb.ng/v1
Bearer YOUR_TEST_SECRET_KEY
Use the test customer numbers below. Other numbers, such as 0123456789 will not produce the same results.
Pick a service and copy the exact values below. Use these values on the sandbox host and a new reference for each purchase.
smb_mtn_test_0001
0812345678
No amount field is needed. Change the product or phone to a non-test value to exercise failure handling.
View data examplessmb_mtn_test_vtu
0812345678
Enter at least NGN 50 of airtime, as required by the test product’s min_amount.
View airtime examplessmb_test_cable_tv
1212121212
Use the token from your validation response. Do not send an amount field in the purchase.
View cable tv examples11111111111
1000
The amount must be exactly 1000. Retrieve prepaid tokens through transaction lookup; postpaid token and units are null.
View electricity examplesPOST to /purchases/data with the matching product and phone fixture.
{
"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.
POST to /purchases/airtime. Use the test product and phone number below. The example amount of NGN 100 is above the NGN 50 minimum.
{
"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.
POST to /customer-validation/cable-tv.
{
"smart_card_number": "1212121212",
"product_code": "smb_test_cable_tv"
}
{
"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.
With a non-test product code:
{
"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:
{
"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"
}
}
POST to /purchases/cable-tv. There is no amount field.
{
"smart_card_number": "1212121212",
"product_code": "smb_test_cable_tv",
"reference": "SMBTESTCABLE001",
"verify_token": "TOKEN_FROM_YOUR_VALIDATION_RESPONSE"
}
{
"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.
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.
{
"meter_number": "11111111111",
"meter_type": "prepaid",
"product_code": "smb_elec_pre_test"
}
{
"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]"
}
{
"meter_number": "11111111111",
"meter_type": "postpaid",
"product_code": "smb_elec_post_test"
}
{
"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.
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.
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}.
SMBDATABUNDLEREF
A successful MTN data bundle.
SMBAIRTIMEREF
A successful MTN airtime purchase.
SMBCABLETVREF
A successful DStv subscription.
SMBELECPREPAIDREF
Includes a sample token and units. The token cannot load a real meter.
SMBELECPOSTPAIDREF
Token is null. Postpaid does not require a recharge token.
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.
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.
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.
metadata.code, not only HTTP status.Continue with Going live when your integration is ready.
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.
Up to 100 characters. Please leave out personal details, account information and API keys.