Buy Airtime
DashboardGet API Keys →
Getting Started

Status Codes

Understand the HTTP and transaction statuses returned by the Buy Airtime API.

HTTP status codes

CodeNameMeaning
200OKRequest was accepted or completed successfully.
400Bad RequestRequest syntax or required data is invalid.
401UnauthorizedAuthentication is missing, invalid or expired.
403ForbiddenCredentials are valid but the operation is not permitted.
404Not FoundThe requested resource or transaction does not exist.
409ConflictRequest conflicts with the current state, including an idempotency payload mismatch.
422Unprocessable EntityRequest is structurally valid but validation fails.
429Too Many RequestsRate limit has been exceeded. Respect Retry-After.
500Internal Server ErrorUnexpected server-side failure.
502Bad GatewayUpstream provider communication failed or returned an invalid response.
503Service UnavailableService is temporarily unavailable.

Transaction statuses

HTTP 200 does not necessarily mean airtime has already been delivered. A transaction may continue processing after the initial request.

StatusMeaning
pendingTransaction has been created and is waiting to be processed.
processingTransaction is currently being sent to or confirmed by the provider.
completedAirtime delivery completed successfully.
failedTransaction could not be completed.

Error response

JSON
{{"error":"invalid_request","message":"The amount must be greater than zero."}}

Recommended handling

  • Handle HTTP status first, then inspect the response body.
  • Do not treat every HTTP 200 as final transaction delivery.
  • For 429, follow the rate-limit guidance.
  • For timeouts, retry the same intended transaction with the same idempotency key.
  • Use transaction status or webhooks to determine the final outcome.
Backend contract note

The HTTP and transaction status pages are being designed before backend implementation. The exact error-code names and final transaction state machine should be kept synchronized when the API server is implemented.