Authentication#
All API requests require authentication via API keys. This guide covers how keys work, how to manage them, and best practices for keeping them secure.
API Key Types#
| Key Type | Prefix | Use Case |
|---|---|---|
| Secret Key | sk_live_ / sk_test_ | Server-side requests — full API access |
There is one key per mode. Every endpoint authenticates with your secret key as a Bearer token; there is no separate client-side key.
Important: Your secret key grants full access to your account. Never expose it in client-side code, public repositories, or logs. Because there is no client-side key, the API is not designed to be called directly from a browser or mobile app — route those requests through your own backend.
Making Authenticated Requests#
Include your API key in the Authorization header as a Bearer token:
curl -X GET https://{your-domain}/api/v1/me \
-H "Authorization: Bearer sk_live_your_secret_key" \
-H "Accept: application/json"const response = await fetch("https://{your-domain}/api/v1/me", {
headers: {
Authorization: "Bearer sk_live_your_secret_key",
Accept: "application/json",
},
});import requests
response = requests.get(
"https://{your-domain}/api/v1/me",
headers={"Authorization": "Bearer sk_live_your_secret_key"},
)$response = Http::withToken('sk_live_your_secret_key')
->get('https://{your-domain}/api/v1/me');Test vs Live Mode#
Use test keys during development to avoid real charges:
- Test key (
sk_test_) — simulated transactions, no money moves - Live key (
sk_live_) — real transactions with real providers
Both environments use the same API endpoints. The key prefix determines the mode.
Managing API Keys#
You can view and manage your API keys in the Merchant Portal → Settings → API Keys tab. Keys are stored hashed, so a key's full value is shown only once, when it is created. From there you can:
- Generate a key you have not been shown yet (for example, when your account was created by your provider). Nothing can be using it, so there is no confirmation step
- View your current keys (masked: only the prefix is kept readable)
- Regenerate a key you have already been shown. The old key is immediately invalidated, so any integration still using it stops working
- Copy a newly shown key to your clipboard
Security Best Practices#
- Store keys in environment variables — never hardcode them
- Use test keys for development — switch to live only in production
- Rotate keys periodically — regenerate keys if you suspect compromise
- Restrict server access — only your backend should use secret keys
- Monitor usage — check your dashboard for unexpected activity
Rate Limiting#
API requests are rate-limited per key. If you exceed the limit, you'll receive a 429 response:
HTTP/1.1 429 Too Many Requests
Retry-After: 60
{
"message": "Too Many Attempts."
}The wait is in the Retry-After response header, in seconds — not in the body. Read the
header, back off for that long, then retry.