Skip to main content
When a request to the CWM Pay API fails, the response body contains a JSON error object with a code, message, and type that describe exactly what went wrong. Use this page to look up any error you encounter, understand its cause, and apply the right fix or retry strategy in your integration.

Error Response Format

Every failed request returns the same error envelope, regardless of the error type:

Error Types

Use the type field to determine the correct handling strategy at a high level before inspecting the specific code.

HTTP Status Codes

CWM Pay uses standard HTTP status codes alongside the JSON error body.

Card Error Codes

When error.type is card_error, use the code field to decide how to respond to your customer.

Authentication Error Codes

When error.type is authentication_error, your API key is missing, malformed, or invalid. These errors always return HTTP 401.

Invalid Request Error Codes

When error.type is invalid_request_error, one or more fields in your request body or URL are incorrect. Check error.param for the name of the offending field.

Handling Errors in Code

Wrap every API call in error handling logic that inspects error.type and error.code to decide whether to surface a message to the customer, retry the request, or escalate to your team.

Rate Limits

CWM Pay enforces the following request limits per API key:
  • Live mode: 100 requests per second
  • Test mode: 20 requests per second
When you exceed the limit, the API returns a 429 Too Many Requests response. Check the Retry-After header in the response for the number of seconds to wait before retrying. Implement exponential backoff with jitter in your retry logic to avoid thundering-herd issues during traffic spikes.
Every API error response includes a request_id field (for example, req_abc123). Always include this value when you contact support@cwmpay.com — it allows the CWM Pay support team to locate your exact request and diagnose the issue faster.