API Keys
Card2Crypto uses API keys to authenticate requests. All requests must include your production API key in theAuthorization
header.
Key Format
Production API keys follow this format:Getting Your API Key
- Log in to your Dashboard
- Navigate to API Keys
- Create your shop (one per account)
- Copy your production API key
Your API key is shown only once during shop creation. Store it securely - if you lose it, you’ll need to delete and recreate your shop.
Making Authenticated Requests
Include your API key in theAuthorization
header using the Bearer scheme:
Security Best Practices
Keep Keys Server-Side
Keep Keys Server-Side
Never expose your API key in client-side JavaScript, mobile apps, or public repositories.Bad:Good:
Use Environment Variables
Use Environment Variables
Store your API key in environment variables, never hard-code it:Then access it in your code:
.env
Rotate Keys if Compromised
Rotate Keys if Compromised
If your API key is exposed:
- Delete your shop in the dashboard
- Create a new shop to get a fresh API key
- Update your integration with the new key
Deleting your shop will invalidate all existing API keys immediately.
Restrict Access
Restrict Access
Only grant access to your API key to trusted team members. Consider:
- Using a secrets manager (AWS Secrets Manager, HashiCorp Vault)
- Implementing role-based access control
- Auditing who has access to production credentials
Authentication Errors
401 Unauthorized
Returned when the API key is missing, invalid, or malformed.- Missing
Authorization
header - Incorrect key format (not
c2c_live_...
) - Using a deleted or expired key
- Key belongs to inactive seller account
403 Forbidden
Returned when the seller account is inactive or suspended.Testing Authentication
Use this simple test to verify your API key works:One Shop Per Account
Card2Crypto enforces a one shop per seller account limit. This means:
- You get one production API key
- All payments go through this single shop
- If you need multiple shops, create separate seller accounts
Next Steps
Now that you understand authentication, learn how to create payments:Create a Payment
Learn how to process your first payment