The Orafi API uses conventional HTTP status codes and returns a consistent JSON error body so you can handle failures programmatically.Documentation Index
Fetch the complete documentation index at: https://docs.orafi.app/llms.txt
Use this file to discover all available pages before exploring further.
Error response format
Every error response follows this structure:HTTP status codes
Client errors (4xx)
| Code | Meaning | What to do |
|---|---|---|
400 | Bad Request — Invalid parameters or malformed body. | Check the request payload against the docs. |
401 | Unauthorized — Missing or invalid API key. | Verify the x-api-key header. |
403 | Forbidden — Your account lacks permission. | Complete onboarding or check mode. |
404 | Not Found — The resource doesn’t exist. | Verify the ID or path. |
429 | Too Many Requests — Rate limit exceeded. | Back off and retry after the Retry-After header. |
Server errors (5xx)
| Code | Meaning | What to do |
|---|---|---|
500 | Internal Server Error — Unexpected failure on our side. | Retry with exponential backoff. |
502 | Bad Gateway — An upstream dependency failed. | Retry after a short delay. |
503 | Service Unavailable — Temporary maintenance. | Retry after a short delay. |
Never retry 4xx errors automatically (except
429). Fix the request first.Common failure scenarios
Payment failures
| Scenario | Cause | Resolution |
|---|---|---|
| Insufficient balance | Payout or refund exceeds available funds. | Check balances before initiating. |
| Network congestion | On-chain confirmation delayed. | Wait and poll or rely on webhooks. |
| Expired payment | Customer didn’t pay within the time window. | Create a new payment. |
| Invalid address | Deposit address format incorrect. | Verify the address before submitting. |
Retry strategy
Idempotency via txRef
Every payment accepts a txRef (transaction reference) that acts as an idempotency key. Sending the same txRef twice returns the original payment — no duplicate charge is created.
Exponential backoff
For server errors (5xx) and rate limits (429), implement exponential backoff:
Webhook retry behavior
Orafi automatically retries failed webhook deliveries. To ensure reliable processing:- Return a
2xxstatus within 10 seconds to acknowledge receipt. - Handle duplicates — your handler should be idempotent. Use the
transactionIdto deduplicate. - Check delivery history — Use the Webhook Deliveries endpoint to inspect attempt counts and response statuses.
