Error Response Format
All errors follow a consistent structure:HTTP Status Codes
Client Errors (400-499)
Validation Errors
VALIDATION_ERROR
Status: 400Meaning: Invalid request parameters
- Missing required fields
- Invalid data types
- Out of range values
- Invalid format (email, phone, etc.)
- Review request parameters
- Check data types and formats
- Ensure all required fields are included
Authentication Errors
UNAUTHORIZED
Status: 401Meaning: Invalid or missing API key
- Missing or invalid
x-api-keyheader - Wrong environment (sandbox key in production)
- Incorrect header format
- Verify your
x-api-keyis correct - Ensure using correct environment credentials
Resource Errors
NOT_FOUND
Status: 404Meaning: Resource not found
- Invalid resource ID
- Resource doesn’t exist
- Wrong ID format
- Verify the resource ID
- Check if resource was deleted
- Use the correct ID (Cheqpay ID or external ID)
DUPLICATE
Status: 409Meaning: Resource already exists
- Duplicate
externalId - Resource already created
- Use the existing resource
- Create resource with different ID
- Check if idempotency is working as expected
Payment Errors
DECLINED
Status: 422Meaning: Payment declined by issuing bank
Resolution:
- Show customer-friendly error message
- Suggest trying different payment method
- Allow customer to retry
- Consider offering SPEI, PAYCASH, or CIE Cash Net as alternatives
INSUFFICIENT_FUNDS
Status: 422Meaning: Customer has insufficient funds
- Suggest trying different card
- Offer alternative payment methods
- Suggest lower amount if applicable
EXPIRED_CARD
Status: 422Meaning: Card has expired
- Request updated card information
- Suggest using different card
- Offer to update saved card
INVALID_CARD
Status: 422Meaning: Invalid card number
- Ask customer to re-enter card details
- Validate card number client-side
- Check for typos
INVALID_CVC
Status: 422Meaning: Invalid or incorrect CVC
- Ask customer to re-enter CVC
- Show CVC location on card
- Verify correct CVC length (3-4 digits)
3D Secure Errors
AUTHENTICATION_REQUIRED
Status: 422Meaning: 3D Secure authentication is required
- Display 3DS authentication challenge
- Follow 3DS implementation guide
3D Secure Guide
Learn how to handle 3DS authentication
AUTHENTICATION_FAILED
Status: 422Meaning: Customer failed 3D Secure verification
- Show friendly message: “We couldn’t verify your identity”
- Allow customer to retry
- Offer alternative payment method
AUTHENTICATION_TIMEOUT
Status: 422Meaning: 3DS authentication session expired
- Start new payment request
- Inform customer of timeout
- Provide retry option
Rate Limiting
RATE_LIMIT_EXCEEDED
Status: 429Meaning: Too many requests
- Wait for
retryAfterseconds - Implement exponential backoff
- Reduce request frequency
- Contact support for higher limits
Refund Errors
INVALID_OPERATION
Status: 400Meaning: The payment order cannot be refunded in its current state
- Payment not yet authorized or captured
- Payment already fully refunded
- Missing
amountin the request body (amountis required, in minor units) - Refund amount exceeds the remaining refundable amount
- Split-tender order refund without a
paymentId
- Check the payment order status and
refundedAmount - Pass a valid
amountno greater than the remaining refundable amount - For split-tender orders, include the
paymentIdto refund
Server Errors (500-599)
INTERNAL_ERROR
Status: 500Meaning: Internal server error
- Retry request with exponential backoff
- Contact support if persistent
- Check API status page
SERVICE_UNAVAILABLE
Status: 503Meaning: Temporary service disruption
- Wait and retry after specified time
- Implement exponential backoff
- Check status page for incidents
Error Handling Best Practices
1. Show User-Friendly Messages
2. Implement Retry Logic
3. Log Errors Appropriately
4. Handle Specific Error Types
Complete Error Reference
Need Help?
Error Handling Guide
Complete error handling patterns
Testing Guide
Test error scenarios
API Reference
Complete API documentation
Contact Support
Get help with errors