The Click to Pay API uses standardized HTTP status codes and structured error responses to communicate issues during API processing.
All Click to Pay API error responses follow a consistent structure:
{
"status": "HTTP_STATUS_CODE",
"reason": "ERROR_CATEGORY",
"message": "Human-readable error description",
"errorDetail": [
{
"reason": "SPECIFIC_ERROR_CODE",
"source": "field_name_or_context",
"sourceType": "FIELD|HEADER|PARAMETER",
"message": "Detailed error explanation"
}
]
}
Response Fields:
The most frequently encountered error scenarios in Click to Pay API integrations:
| Authentication Failures | Invalid or expired tokens, missing API keys, or incorrect credentials |
| Validation Errors | Invalid request data, missing required fields, or format violations |
| Business Logic Errors | Consumer not found, card enrollment failures, or transaction confirmation issues |
| System Errors | Temporary service unavailability, timeout issues, or internal processing failures |
When encountering errors, follow this systematic approach:
Successful request processing with various completion states:
| Code | Status | Meaning | Click to Pay API Usage |
|---|---|---|---|
| 200 | OK | Request processed successfully | Standard success response for most API operations |
| 202 | Accepted | Request accepted for processing but not yet complete | Card enrollment pending validation, identity validation in progress |
Errors caused by client request issues:
| Code | Status | Common Causes | Resolution Actions |
|---|---|---|---|
| 400 | Bad Request | Invalid request format, missing required fields, validation failures | Review request structure, validate all required fields, check data formats |
| 401 | Unauthorized | Invalid token, expired token, missing authentication | Refresh token, verify API key, check authentication headers |
| 403 | Forbidden | Valid credentials but insufficient permissions | Verify client permissions, check SRC role configuration, contact support |
| 404 | Not Found | Consumer not found, invalid endpoint, resource doesn't exist | Verify consumer's identity, check endpoint URL, handle as business logic |
| 405 | Method Not Allowed | Incorrect HTTP method for endpoint | Use correct HTTP method (GET, POST) as specified in API documentation |
| 409 | Conflict | Consumer already exists, duplicate enrollment attempt | Check existing consumer status, use appropriate flow for existing consumers |
| 422 | Unprocessable Entity | Valid format but business logic validation failed | Review business rules, check data relationships, validate card information |
| 429 | Too Many Requests | Rate limit exceeded | Implement exponential backoff, respect Retry-After header, reduce request rate |
Errors caused by server-side processing issues:
| Code | Status | Common Causes | Resolution Actions |
|---|---|---|---|
| 500 | Internal Server Error | Unexpected server processing error | Retry with exponential backoff, contact support if persistent |
| 502 | Bad Gateway | Upstream service failure, network connectivity issues | Retry request, check service status, implement circuit breaker pattern |
| 503 | Service Unavailable | Temporary service overload, maintenance mode | Retry with exponential backoff, check service status page |
| 504 | Gateway Timeout | Request timeout, slow upstream processing | Retry with longer timeout, implement async processing if possible |
Different endpoints may return specific status codes based on their functionality:
| Endpoint | Success Codes | Common Error Codes |
|---|---|---|
| POST /identities/lookup | 200 | 400 (invalid identity), 401 (auth failure), 404 (consumer not found) |
| POST /cards | 200, 202 | 400 (invalid card data), 409 (consumer exists), 422 (enrollment failed) |
| POST /transaction/credentials | 200 | 400 (invalid request), 404 (card not found), 422 (transaction failed) |
| GET /transaction/credentials | 200 | 400 (missing parameters), 404 (card not found), 401 (auth failure) |
| POST /profiles/prepare | 200 | 400 (invalid identity), 404 (profile not found), 403 (access denied) |
| POST /confirmations | 200 | 400 (invalid confirmation data), 404 (transaction not found) |
| POST /identities/validation/initiate | 200 | 400 (invalid request), 404 (consumer not found), 422 (validation unavailable) |
| POST /identities/validation/complete | 200, 202 | 400 (invalid validation data), 422 (validation failed), 404 (session not found) |
Understanding common error response patterns helps with debugging:
Authentication Errors (401):
Validation Errors (400):
Business Logic Errors (404, 409, 422):
Server Errors (5xx):
Recommended retry strategies for different status codes:
Immediate Retry (No Delay):
Exponential Backoff Retry:
Limited Retry:
No Retry:
Set up monitoring for different status code patterns:
Critical Alerts:
Warning Alerts:
Informational Monitoring:
Systematic approach to diagnosing status code issues:
For 4xx Errors:
For 5xx Errors: