Errors & Status Codes

Every Korba Xchange API call that cannot be completed successfully returns a structured JSON error body. This page lists the error format, all common error codes, and recommendations for handling failures gracefully in your integration.

Error Response Format

Error responses are always JSON with three fields: a boolean success flag, a numeric error_code, and a human-readable error_message. The HTTP status code is typically 200 — use error_code to determine the failure reason rather than relying on HTTP status alone.

Error Error response shape
{
  "success":       false,
  "error_code":    405,
  "error_message": "Invalid network code"
}

Common Error Codes

The following error codes can be returned by most Korba Xchange API endpoints. Use the error_code value in your application logic to distinguish between failure types and display the appropriate message to your users.

Code Message Description
400 Customer Number not provided The customer_number (or equivalent phone/account number) field is missing from the request body.
401 Transaction ID not provided The transaction_id field is absent on endpoints that use 401 for a missing reference, such as transaction status checks.
402 Amount not provided The amount field is missing from the request body.
403 Wallet Code not provided The wallet or network code required to route the transaction was not supplied.
404 Callback URL not provided The callback_url field is missing. A valid callback URL is required for all collection and disbursement requests.
405 Invalid Network Code The supplied network_code is not recognised. Common values are MTN, AIR, TIG, VOD, CRD, and ISP. Use the network lookup endpoint for the authoritative list enabled on your account.
407 Duplicate Transaction ID A transaction with the same transaction_id has already been submitted. Transaction IDs must be globally unique within your account.
408 Invalid Callback URL The callback_url provided is not a valid HTTP or HTTPS URL.
409 Invalid amount The amount value is not a positive numeric value, or exceeds the permitted maximum for the chosen service.
410 Invalid customer number format The customer number does not match the expected format: 10 digits starting with 02 — e.g. 0241234567.
411 Transaction ID not provided The transaction_id field is missing from a collection, topup, or service purchase request that requires your unique reference.
421 Transaction does not exist No transaction matching the supplied transaction_id was found for your account.

Service-Specific Errors

Some endpoints surface additional error codes beyond the common set above. Refer to the relevant service page for details:

Service Additional Error Details
Collections Network-specific decline codes are surfaced in error_message when a mobile money prompt is rejected by the subscriber.
Disbursements Insufficient OVA balance will result in a error_message indicating wallet funding is required before the disbursement can proceed.
Transactions Code 421 is exclusive to the Transaction Status endpoint when the reference is not found.
USSD OTP An error is returned if the phone_number does not begin with a recognised country code, or if the USSD session limit for the number has been exceeded.

Handling Errors

Follow these practices to build a resilient integration:

  • Check error_code, not HTTP status. The API returns HTTP 200 for both success and many application-level errors. Always inspect success and error_code in the response body.
  • Retry only transient errors. Errors like 407 (Duplicate Transaction ID) or 405 (Invalid Network Code) are permanent — retrying them will always fail. Only retry on network timeouts or genuine server errors (5xx).
  • Use unique transaction IDs. Generate a fresh UUID or timestamp-based reference for every API call. Reusing an ID from a previously submitted transaction will return error 407.
  • Validate inputs client-side first. Check phone number format (02xxxxxxxx, 10 digits), amount positivity, and URL validity before calling the API. This prevents avoidable roundtrips for codes 400, 408, 409, and 410.
  • Log the full response. Always log the complete JSON error body alongside the request payload. The error_message field often contains actionable detail beyond what the error_code alone conveys.
  • Surface user-friendly messages. Map error_code values to customer-facing strings in your UI. Displaying raw API error messages to end users degrades trust and complicates support.
Need help with a specific error? If you encounter an error code not listed here, or if a listed error persists despite correct request formatting, contact 911@korba365.com with the full request payload and response body. Our integration team typically responds within one business day.