Resources

Errors

The API reports errors in three forms.

1. HTTP 401 from the auth layer. The bearer token is missing, invalid or expired. This is not a JSON-RPC envelope:

json
{ "status": 401, "message": "Failed, Not authorized" }

2. JSON-RPC error. The request failed:

json
{ "jsonrpc": "2.0", "error": { "code": 400, "message": "{\"sender_phone\":[\"The sender phone field is required.\"]}" }, "id": "1" }

For validation errors, message is a JSON string that maps each field to its errors.

3. A business status inside result. The request was processed, but the operation was not completed:

json
{ "jsonrpc": "2.0", "result": { "transaction_id": "in8447D7EC98", "status": 409, "message": "..." }, "id": "1" }

Error Codes

CodeMessageMeaning
400{"field":["..."]}A required field is missing or badly formatted
400Can only send KES or USDUnsupported sender currency
400Recipient currency not available for inbound transactionsUnsupported recipient currency
400Error getting currency detailsNo active exchange rate for the currency pair
400Partner balance and overdraw limit surpassedInsufficient funds at commit
400Top up partner balanceInsufficient funds at commit
401Failed, Not authorizedThe token is missing, invalid or expired. Log in again
401Error Logging inThe credentials are incorrect
404transaction not foundUnknown transaction_id or request_id
409A transaction with a similar request_id has already been recorded.request_id reused. The response returns the original transaction_id
409A similar transaction was logged within the last hour. Please verify your transaction details before retrying.Possible duplicate. See Idempotency
409Transaction already committedThe transaction is not LOGGED
422Currency not allowed for <type> transactionsWrong currency for the channel
422Amount exceeds the limitAbove your limits
422Amount below allowed limitBelow your limits
500Internal Server error / Something went wrongAfrisend error. Retry with backoff, then contact support

Some messages continue with request-specific details.

Retry Guidance

SituationRetry?
Network timeout on a log requestYes, with the same request_id
Network timeout on commitTransactionCall checkTransactionStatus first. Commit again only if the status is still LOGGED.
401Log in again, then retry once
400 / 409 / 422No. Fix the request first.
500Yes, with exponential backoff
© 2026 Afrisend