Error codes
Complete catalog of Aventopay API errors: code, cause, correction, example.
Standard format
All API errors return JSON
{error, message}. The HTTP code indicates the category, the message field details the cause.Response structure
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "Bad Request",
"message": "amount must be a positive integer in cents"
}Catalog
| Code | Cause | Fix |
|---|---|---|
400Bad Request | Missing parameter, invalid JSON, zero or negative amount. | Check request structure and JSON format. |
401Unauthorized | Missing/invalid API Key, incorrect HMAC signature, unknown merchant_id. | Check Authorization and X-Aventopay-Signature headers (signature on raw body, identical string). |
403Forbidden | Blocked request (velocity limits, suspended activity). | Check the dashboard for the reason; contact support if needed. |
404Not Found | Non-existent endpoint or resource (wrong URL, unknown session). | Check the path and the provided identifier. |
405Method Not Allowed | Unsupported HTTP verb. | Use POST on /api/payment/session. |
409Conflict | transaction_id already used for this merchant. | Use a unique identifier per transaction. |
413Payload Too Large | Request body exceeds accepted limit. | Reduce metadata and free fields size. |
422Unprocessable Entity | Valid format but inconsistent data (e.g. unsupported currency). | Check values against the API reference. |
429Too Many Requests | Rate limit exceeded or anti-fraud velocity. | Wait retry_after_minutes and retry with exponential backoff. |
500Internal Server Error | Unexpected error on Aventopay side. | Retry with backoff. Contact support if persistent. |
Best practices
- Never replay a 400/401/409 as-is — fix the request first.
- For 429 and 500, apply exponential backoff: 1s, 2s, 4s, up to 30s max.
- Log the response body for diagnosis — the
messagefield indicates the field involved. - Distinguish client errors (4xx) from server errors (5xx) in your monitoring.
See also Webhooks for the response codes expected on your server.
