Credits
Check balances and buy SMS credit from your own system.
Check what you have left and buy more SMS credit from your own system — for example an automatic top-up when the balance drops, or a reseller shop where your customers pay by mobile money.
Check balance
Returns your SMS and WhatsApp balances, so you can check before a large send instead of reacting to a failure.
sms_balanceintegerrequiredwhatsapp_balancenumberrequiredwithdraw_balancenumberoptionalbalance_thresholdintegeroptionalcurl https://sms.nbmbrand.com/api/v1/users/self/balance \
-H "Authorization: Bearer $API_KEY"{
"success": true,
"status_code": 200,
"status_text": "OK",
"message": "balance has been fetched",
"data": {
"sms_balance": 8420,
"whatsapp_balance": 12.5,
"withdraw_balance": 0,
"balance_threshold": 100
}
}Browse bundles
Lists the price tiers you can buy at. Each bundle has items: tiers of { from, to, price }, where price is the price per SMS (TZS) for a purchase whose quantity is between from and to.
The bundle that applies to you is the one assigned to your account, otherwise the one for your account type, otherwise the platform default. The paginated GET /bundles?condition=buy takes the same filter.
conditionstringrequiredbuy for bundles you can purchase.curl "https://sms.nbmbrand.com/api/v1/bundles/all?condition=buy" \
-H "Authorization: Bearer $API_KEY"{
"success": true,
"status_code": 200,
"status_text": "OK",
"message": "bundles have been fetched",
"data": [
{
"id": "3f2a1e2a-4b0e-4e9a-9a2e-1a2b3c4d5e6f",
"name": "standard",
"items": [
{
"from": 1,
"to": 5000,
"price": 20
},
{
"from": 5001,
"to": 100000,
"price": 17
},
{
"from": 100001,
"to": 1000000,
"price": 15
}
],
"is_default": true,
"type": "customer"
}
]
}Buy credit
Creates a pending purchase. With customer_phone_number, a mobile-money payment prompt (USSD push) is sent to that phone; the payer approves it with their PIN. Without a phone number, arrange payment another way and confirm with Check purchase status.
quantityintegerrequiredamountnumberrequiredquantity × price for your tier, or the request is refused.customer_namestringoptionalcustomer_emailstringoptionalcustomer_phone_numberstringoptional| Status | error | When it happens |
|---|---|---|
| 400 | validation_error | quantity or amount missing or zero. |
| 400 | creation_error | Amount is below your tier price for this quantity, or no tier covers it. |
| 401 | invalid_token | Missing or invalid API key. |
curl -X POST https://sms.nbmbrand.com/api/v1/purchases \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"quantity": 10000,
"amount": 200000,
"customer_name": "Asha Mushi",
"customer_email": "asha@example.com",
"customer_phone_number": "0712345678"
}'{
"success": true,
"status_code": 201,
"status_text": "Created",
"message": "purchase has been created",
"data": {
"id": "6b2f6e2a-4b0e-4e9a-9a2e-1a2b3c4d5e6f",
"generated_number": "104822",
"reference": "104822",
"quantity": 10000,
"amount": 200000,
"status": "pending",
"customer_name": "Asha Mushi",
"customer_email": "asha@example.com",
"customer_phone_number": "255712345678",
"created_at": "2026-11-20T08:12:41Z"
}
}Check purchase status
Asks the payment provider again about a pending purchase. A background job already does this about every 30 seconds, so you only need it if you prefer polling to webhooks.
Returns 200 OK once paid. Still pending — or the payment failed — returns 400 with creation_error; wait and check later instead of retrying in a tight loop.
iduuidrequiredcurl -X POST https://sms.nbmbrand.com/api/v1/purchases/status \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "6b2f6e2a-4b0e-4e9a-9a2e-1a2b3c4d5e6f"
}'{
"success": true,
"status_code": 200,
"status_text": "OK",
"message": "purchase has been paid",
"data": {
"id": "6b2f6e2a-4b0e-4e9a-9a2e-1a2b3c4d5e6f",
"generated_number": "104822",
"reference": "104822",
"quantity": 10000,
"amount": 200000,
"status": "paid",
"customer_name": "Asha Mushi",
"customer_email": "asha@example.com",
"customer_phone_number": "255712345678",
"created_at": "2026-11-20T08:12:41Z"
}
}List purchases
Your purchases, newest first. GET /purchases/search?search=… accepts the same filters, and GET /purchases/{id} fetches one.
statusstringoptionalpending or paid.page / limit / sort_by / sort_dir—optionalcurl "https://sms.nbmbrand.com/api/v1/purchases?status=paid&limit=20" \
-H "Authorization: Bearer $API_KEY"