Reference
Error Codes
Aurax Pay uses standard HTTP status codes. All error responses return JSON with an error field and an optional details object for validation errors.
Error response format
Error response
{
"error": "Validation failed",
"details": {
"amount": ["Number must be greater than or equal to 500"],
"buyerPhone": ["Invalid phone number format"]
}
}HTTP status codes
| Status | Meaning | Common cause |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created (payment initiated) |
| 400 | Bad Request | Validation error, missing field, or invalid value |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Key lacks required permission, or merchant not active |
| 404 | Not Found | Transaction or resource does not exist |
| 409 | Conflict | Duplicate idempotency key with different parameters |
| 429 | Too Many Requests | Rate limit exceeded — back off and retry |
| 500 | Internal Server Error | Something went wrong on our end — contact support |
| 503 | Service Unavailable | Temporary outage — retry with exponential backoff |
Rate limits
API endpoints are rate-limited to protect platform stability:
| Endpoint group | Limit |
|---|---|
| POST /v1/payments | 100 requests / minute |
| GET /v1/payments | 300 requests / minute |
| All other /v1/* routes | 200 requests / minute |
When rate limited, the response is 429 with a Retry-After header indicating when you can retry.
Handling errors in code
Node.js — robust error handling
"token-keyword">async "token-keyword">function collectPayment(data) { "token-keyword">const res = "token-keyword">await fetch("token-string">'https://api.auraxpay.net/v1/payments', { method: "token-string">'POST', headers: { "token-string">'Content-Type': "token-string">'application/json', "token-string">'x-api-key': process.env.AURAX_API_KEY, }, body: JSON.stringify(data), }) "token-keyword">const body = "token-keyword">await res.json() "token-keyword">if (res.status === 400) { // Validation error — fix your request "token-keyword">throw "token-keyword">new Error("token-string">'Validation: ' + JSON.stringify(body.details)) } "token-keyword">if (res.status === 401 || res.status === 403) { // Auth error — check your API key and permissions "token-keyword">throw "token-keyword">new Error("token-string">'Auth error: ' + body.error) } "token-keyword">if (res.status === 429) { // Rate limited — wait and retry "token-keyword">const retryAfter = Number(res.headers.get("token-string">'Retry-After') || 60) "token-keyword">await "token-keyword">new Promise(r => setTimeout(r, retryAfter * 1000)) "token-keyword">return collectPayment(data) // retry } "token-keyword">if (!res.ok) { "token-keyword">throw "token-keyword">new Error("token-string">'Aurax API error ' + res.status + "token-string">': ' + body.error) } "token-keyword">return body.transaction }