Skip to main content

API Authentication

All API requests require authentication using your API credentials in the request headers.

Using Your API Credentials

Authenticate every request with your API key in the x-api-key header. You can also include your merchant ID in the x-merchant-id header:
x-merchant-id is optional.

Example Request

Keep your API keys secure. Never share them publicly or commit them to version control.

Best Practices

Store Keys Securely

Always use environment variables to store your API credentials:

Use Different Keys for Each Environment

You’ll receive separate API keys for:
  • Sandbox - For testing and development
  • Production - For live payments
Never use production keys in your development environment.

Rotate Keys Regularly

For security, periodically rotate your API keys:
  1. Generate a new key in your dashboard
  2. Update your application with the new key
  3. Test thoroughly
  4. Deactivate the old key

Getting Your API Keys

  1. Sign up for a Cheqpay account
  2. Navigate to your dashboard
  3. Go to Settings → API Keys
  4. Copy your keys for sandbox and production
Contact our support team at support@cheqpay.mx if you need help setting up your API keys.