Error Response Format
API errors are returned in the following format.Error type (
authentication_error, invalid_request_error, payment_error, api_error)Error code (see below)
Error description
Request ID (use when contacting support)
Parameter that caused the error (for validation errors)
Detailed error information (for validation errors)
Authentication Errors
| Code | HTTP Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Authorization header is invalid or missing |
FORBIDDEN | 403 | Merchant account is deactivated |
Validation Errors
| Code | HTTP Status | Description |
|---|---|---|
VALIDATION_ERROR | 400 | Invalid request parameters. Details are in the details field |
INVALID_AMOUNT | 400 | Invalid amount |
AMOUNT_BELOW_MINIMUM | 400 | Amount is below minimum |
AMOUNT_ABOVE_MAXIMUM | 400 | Amount exceeds maximum |
UNSUPPORTED_CURRENCY | 400 | Unsupported currency |
Payment Errors
| Code | HTTP Status | Description |
|---|---|---|
PAYMENT_FAILED | 400 | Payment processing failed |
INVALID_STATUS | 400 | Operation cannot be performed in current status |
INVALID_STATE | 400 | Invalid transaction state |
Refund Errors
| Code | HTTP Status | Description |
|---|---|---|
INVALID_AMOUNT | 400 | Refund amount exceeds payment amount |
INVALID_STATUS | 400 | Not in refundable status (only completed can be refunded) |
Resource Errors
| Code | HTTP Status | Description |
|---|---|---|
NOT_FOUND | 404 | Specified resource not found |
FLOW_NOT_FOUND | 404 | Payment flow not found |
NO_DEFAULT_FLOW | 404 | Default payment flow not configured |
FLOW_NOT_ACTIVE | 400 | Payment flow is disabled |
CONNECTOR_CONFIG_NOT_FOUND | 404 | Connector configuration not found |
CONNECTOR_CONFIG_DISABLED | 400 | Connector is disabled |
Idempotency Errors
| Code | HTTP Status | Description |
|---|---|---|
IDEMPOTENCY_KEY_MISMATCH | 400 | Different request sent with same idempotency key |
IDEMPOTENCY_KEY_IN_USE | 409 | Idempotency key is currently being processed |
System Errors
| Code | HTTP Status | Description |
|---|---|---|
INTERNAL_ERROR | 500 | Internal error occurred. Please contact support |
Error Handling Best Practices
1
Check HTTP Status Code
4xx: Client error (request needs modification)5xx: Server error (retriable)
2
Branch Logic by Error Code
Use
error.code to implement error-type-specific handling3
Retry Strategy
For
5xx errors or IDEMPOTENCY_KEY_IN_USE, retry with exponential backoffSample Code
Node.js