API Key Authentication
All API requests must include your API key in theX-API-Key header.
Key Types
Getting Your API Key
1
Login to Dashboard
Visit dashboard.crbtrack.com
2
Go to API Keys
Navigate to Settings → API Keys
3
Generate Key
Click Generate New Key and configure:
- Name: A descriptive name (e.g., “Production Website”)
- Countries: Which countries this key can ship to
- IP Whitelist: Optional IP restrictions
4
Save Securely
The full key is shown only once. Save it immediately.
Key Security Best Practices
Use Environment Variables
Use Environment Variables
Never hardcode API keys in your source code.
Restrict by IP
Restrict by IP
In the dashboard, add your server’s IP addresses to the whitelist. Requests from other IPs will be rejected.
Rotate Keys Regularly
Rotate Keys Regularly
Generate new keys periodically and revoke old ones. This limits exposure if a key is compromised.
Never Expose Client-Side
Never Expose Client-Side
API keys should only be used server-side. Never include them in:
- Browser JavaScript
- Mobile app bundles
- Public repositories
Country Access Control
Each API key is restricted to specific destination countries. This is configured when generating the key.
If you try to create an order to a country not in your key’s whitelist:
Rate Limiting Headers
Every response includes rate limit information:Error Responses
Invalid API Key
401 Unauthorized
Missing API Key
401 Unauthorized
Rate Limit Exceeded
429 Too Many Requests