Skip to content
شعار البي شعار البي El-BDevelopers

Getting started

Errors

Errors use the HTTP status, and a JSON body with a stable code to branch on and a readable message.

422 Unprocessable Content
{
    "error": {
        "code": "validation_failed",
        "message": "Some fields are invalid.",
        "fields": {
            "amount_dzd": [
                "The amount dzd field must be at least 500."
            ]
        }
    }
}

Codes

StatusCodeMeaning
401unauthenticatedNo key, an unknown key, or a paused one.
402insufficient_creditsNot enough credits to create the payment. missing_credits says how many.
403account_not_verifiedThe account is not verified by an official document, or has no RIP.
403account_suspendedThe account is suspended.
404not_foundNo such resource in your account. Another account's payment answers 404 too.
405method_not_allowedThis method is not allowed on this endpoint.
409invalid_stateThe payment is not in a status that allows this action (confirming a payment without a transaction number, cancelling one that ended). message says why.
422validation_failedA field is invalid. fields lists each field and its messages.
422limit_reachedYou already have the most webhook endpoints allowed.
429rate_limitedToo many requests. Wait for Retry-After seconds.
500server_errorSomething went wrong on our side. Retry later.

Handling them

  • Branch on error.code, not on the message: messages may be reworded.
  • Retry 429 and 5xx later; never retry a 4xx unchanged.
  • Creating a payment is not idempotent: if a request times out, list your latest payments (created_after) before creating it again.