Balance

Check your SMS credit balance programmatically. Wire it into your monitoring so a marketing blast never drains the credits your OTPs need.

GEThttps://api.mobilesasa.com/v1/get-balance/
# Paste your token once (it starts with mbs_):
export MOBILESASA_TOKEN="mbs_your_token_here"

curl "https://api.mobilesasa.com/v1/get-balance/" \
  -H "Authorization: Bearer $MOBILESASA_TOKEN"
Response
{
  "status": true,
  "responseCode": "0200",
  "message": "Balances loaded successfully.",
  "balance": 14250,
  "localAccountNumber": "ABC123",
  "walletAccountNumber": "wl-ABC123"
}

balance is in SMS units (message parts). localAccountNumber is the account number to pay against on M-Pesa paybill 4078003 to buy SMS units; walletAccountNumber is the one that tops up your KES wallet instead.

Account details

GEThttps://api.mobilesasa.com/v1/get-balance/account-details
# Paste your token once (it starts with mbs_):
export MOBILESASA_TOKEN="mbs_your_token_here"

curl "https://api.mobilesasa.com/v1/get-balance/account-details" \
  -H "Authorization: Bearer $MOBILESASA_TOKEN"

Returns the same fields as the balance, plus how to pay: the M-Pesa instruction and our bank accounts. Useful for showing customers where to top up. It does not include your account name or SMS rate; both are on the dashboard.

Response
{
  "status": true,
  "responseCode": "0200",
  "message": "Balances loaded successfully.",
  "balance": 14250,
  "localAccountNumber": "ABC123",
  "walletAccountNumber": "wl-ABC123",
  "ussdAccount": { "info": [] },
  "paymentDetails": {
    "mpesa": "use paybill 4078003 & the respective destination account number for the intended account",
    "bank": {
      "NCBA": {
        "bankName": "NCBA",
        "accountName": "Bitwise Digital Solutions Limited",
        "branch": "Mama Ngina",
        "accountNumber": "8470290017"
      },
      "Cooperative Bank of Kenya": {
        "bankName": "Cooperative Bank of Kenya",
        "accountName": "Bitwise Digital Solutions Limited",
        "branch": "Hilton",
        "accountNumber": "01148579421000"
      }
    }
  }
}

Alerting pattern

  • Poll every 5–15 minutes from your monitoring (the endpoint is cheap).
  • Alert at a threshold that covers ~2 days of your normal volume.
  • The platform also sends low-balance reminders by SMS to your account phone and alert contacts: when your balance drops below your threshold (set it in the portal), and, if you send 100 or more messages a day, when about 3 days of sending are left at your average rate over the last 14 days.