Errors

Stable customer-facing codes and HTTP status mapping.

Error responses are JSON. Validation failures typically use 400. Auth failures use 401. Business rules such as wallet balance use dedicated codes.

Response shape

{
  "code": "INSUFFICIENT_BALANCE",
  "message": "Insufficient wallet balance. Need 25 TZS, have 0"
}

HTTP status

StatusMeaning
400Invalid request, missing Sender ID, M-Pesa unavailable, or bad input
401Missing or invalid Bearer token / API key
402Insufficient prepaid balance
403Forbidden (e.g. manual wallet top-up disabled)
404Resource not found (e.g. message id)
502Payment could not be started (retry or try another number/network)
202SMS accepted and queued (success for send)
201Created (register, deposits, webhooks, etc.)

Application codes

CodeWhen
VALIDATION_ERRORRequest body failed schema validation
MISSING_SENDER_IDNo senderId provided and no org/platform default available
WALLET_MISSINGOrganisation wallet could not be found
INSUFFICIENT_BALANCEWallet balance lower than the send charge
MPESA_UNAVAILABLEDeposit/Buy SMS attempted with a Vodacom M-Pesa number — use another network for now
MANUAL_TOPUP_DISABLEDPOST /v1/wallet/top-up is disabled; use mobile money instead
PAYMENT_PROVIDER_ERRORMobile money payment could not be started (customer-safe message)
INVALID_PHONEPhone number is missing or not a valid MSISDN
INVALID_AMOUNTDeposit amount below the minimum (100 TZS)
NOT_FOUNDMessage, deposit, or resource id does not exist
MESSAGE_PROVIDER_ERRORCustomer-safe stand-in when delivery fails for infrastructure reasons
Provider noise is strippedFailed messages and payments expose Netnaunse codes and messages only. Upstream provider names and raw payloads are never returned on customer APIs.

Related: SMS API · Wallet · Webhooks