Skip to main content

Error Response Format

All error responses follow this format:
The HTTP status code indicates the error category.

HTTP Status Codes

400 Bad Request Errors

Invalid Amount

Cause: Payment amount is below the $0.50 minimum Solution:

Invalid Currency

Cause: Unsupported currency code Solution:

Missing Return URL

Cause: No return_url provided in payment creation Solution:

Invalid Return URL

Cause: Return URL is not a valid HTTPS URL Solution:

Invalid Metadata

Cause: Too many keys in metadata object Solution:

Missing Required Fields

Cause: Required parameter not provided Solution:

401 Unauthorized Errors

Invalid API Key

Causes:
  • API key doesn’t exist
  • API key format is incorrect
  • API key was deleted
  • Shop is inactive
Solutions:
  1. Check API key format:
  1. Verify API key in dashboard:
  1. Ensure proper authentication header:

Missing API Key

Cause: No Authorization header provided Solution:

Shop Inactive

Cause: Your shop has been deactivated Solution: Contact support or check dashboard for shop status

404 Not Found Errors

Payment Not Found

Causes:
  • Payment ID is incorrect
  • Payment belongs to different shop
  • Payment was deleted (rare)
Solutions:
  1. Verify payment ID format:
  1. Ensure payment exists:

429 Rate Limit Errors

Rate Limit Exceeded

Cause: Too many requests in short time period Limit: 100 requests per minute per API key Solutions:
  1. Implement exponential backoff:
  1. Implement request queuing:
  1. Cache responses:

500 Internal Server Error

Server Error

Cause: Something went wrong on Card2Crypto’s servers Solutions:
  1. Retry the request:
  1. Log the error and contact support if it persists

Network Errors

Connection Timeout

Cause: Request took too long to connect Solution:

Network Failure

Cause: No internet connection or DNS failure Solution:

Error Handling Best Practices

1. Implement Proper Error Handling

2. Provide User-Friendly Error Messages

3. Log All Errors

4. Implement Retry Logic

Debugging Errors

Enable Debug Logging

Inspect API Responses

Common Mistakes

1. Exposing API Keys

2. Not Handling Errors

3. Ignoring Rate Limits

Next Steps

API Reference

Complete API documentation

Rate Limits

Learn about rate limiting

Testing Guide

Test your error handling

Node.js Guide

See complete integration examples