Error format
See Common error codes for the codes and their statuses.
HTTP status codes
Business limits
Afriex sets limits on your business. A transaction that would take you over a limit returns403 with BUSINESS_LIMIT_EXCEEDED, and details.friendlyMessage names the limit and the period. A transaction below the smallest amount a limit allows returns 400 with BUSINESS_TRANSACTION_MIN_AMOUNT_NOT_MET.
Usage for daily, weekly, and monthly limits resets on a fixed schedule, in UTC:
After usage resets, a transaction that went over a daily, weekly, or monthly limit can go through. To ask about your limits, contact support@afriex.com.
Retrying
Retry only the errors that can succeed on a second attempt:- Retry:
429,500,503, and requests that time out or lose their connection. Treat a502or504the same way. - Don’t retry: the other
4xxerrors. They fail the same way until you change the request.
- Wait before each attempt, and wait longer each time. For example, start at one second and double the wait, with a little random jitter so many clients don’t retry together.
- Use
Retry-Afterwhen the response has it, instead of your own wait. - Stop after a few attempts, and surface the error.
- For
POST /transaction, retry with the samemeta.idempotencyKey. A retry can never create a second transaction, and a409tells you the first attempt went through. See Idempotency.
Request IDs
Every API response, successful or not, carries anx-request-id header. It identifies that one request in Afriex’s logs, including a 503 Afriex returns when the API is briefly unavailable. Log it next to each request you send, so you can find it again when something goes wrong.
Getting help
If a500 or 503 persists, or a response doesn’t make sense, contact support@afriex.com with the x-request-id of the request. Add the endpoint, the time, and the code you received.
For a webhook question, send the event’s id from the webhook body instead. See Webhooks.