Skip to main content

Error Response Format

All errors follow a consistent structure:

HTTP Status Codes

Client Errors (400-499)

Validation Errors

VALIDATION_ERROR

Status: 400
Meaning: Invalid request parameters
Common Causes:
  • Missing required fields
  • Invalid data types
  • Out of range values
  • Invalid format (email, phone, etc.)
Resolution:
  • Review request parameters
  • Check data types and formats
  • Ensure all required fields are included

Authentication Errors

UNAUTHORIZED

Status: 401
Meaning: Invalid or missing API key
Common Causes:
  • Missing or invalid x-api-key header
  • Wrong environment (sandbox key in production)
  • Incorrect header format
Resolution:
  • Verify your x-api-key is correct
  • Ensure using correct environment credentials

Resource Errors

NOT_FOUND

Status: 404
Meaning: Resource not found
Common Causes:
  • Invalid resource ID
  • Resource doesn’t exist
  • Wrong ID format
Resolution:
  • Verify the resource ID
  • Check if resource was deleted
  • Use the correct ID (Cheqpay ID or external ID)

DUPLICATE

Status: 409
Meaning: Resource already exists
Common Causes:
  • Duplicate externalId
  • Resource already created
Resolution:
  • Use the existing resource
  • Create resource with different ID
  • Check if idempotency is working as expected

Payment Errors

DECLINED

Status: 422
Meaning: Payment declined by issuing bank
Decline Reasons: 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: 422
Meaning: Customer has insufficient funds
Resolution:
  • Suggest trying different card
  • Offer alternative payment methods
  • Suggest lower amount if applicable

EXPIRED_CARD

Status: 422
Meaning: Card has expired
Resolution:
  • Request updated card information
  • Suggest using different card
  • Offer to update saved card

INVALID_CARD

Status: 422
Meaning: Invalid card number
Resolution:
  • Ask customer to re-enter card details
  • Validate card number client-side
  • Check for typos

INVALID_CVC

Status: 422
Meaning: Invalid or incorrect CVC
Resolution:
  • Ask customer to re-enter CVC
  • Show CVC location on card
  • Verify correct CVC length (3-4 digits)

3D Secure Errors

AUTHENTICATION_REQUIRED

Status: 422
Meaning: 3D Secure authentication is required
Note: This is not an error - it indicates 3DS is required. Resolution:
  • Display 3DS authentication challenge
  • Follow 3DS implementation guide

3D Secure Guide

Learn how to handle 3DS authentication

AUTHENTICATION_FAILED

Status: 422
Meaning: Customer failed 3D Secure verification
Resolution:
  • Show friendly message: “We couldn’t verify your identity”
  • Allow customer to retry
  • Offer alternative payment method

AUTHENTICATION_TIMEOUT

Status: 422
Meaning: 3DS authentication session expired
Resolution:
  • Start new payment request
  • Inform customer of timeout
  • Provide retry option

Rate Limiting

RATE_LIMIT_EXCEEDED

Status: 429
Meaning: Too many requests
Resolution:
  • Wait for retryAfter seconds
  • Implement exponential backoff
  • Reduce request frequency
  • Contact support for higher limits

Refund Errors

INVALID_OPERATION

Status: 400
Meaning: The payment order cannot be refunded in its current state
Common Causes:
  • Payment not yet authorized or captured
  • Payment already fully refunded
  • Missing amount in the request body (amount is required, in minor units)
  • Refund amount exceeds the remaining refundable amount
  • Split-tender order refund without a paymentId
Resolution:
  • Check the payment order status and refundedAmount
  • Pass a valid amount no greater than the remaining refundable amount
  • For split-tender orders, include the paymentId to refund

Server Errors (500-599)

INTERNAL_ERROR

Status: 500
Meaning: Internal server error
Resolution:
  • Retry request with exponential backoff
  • Contact support if persistent
  • Check API status page

SERVICE_UNAVAILABLE

Status: 503
Meaning: Temporary service disruption
Resolution:
  • 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