← Developer Guides

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 TypePrefixUse Case
Secret Keysk_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
curl -X GET https://{your-domain}/api/v1/me \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Accept: application/json"
JavaScript
const response = await fetch("https://{your-domain}/api/v1/me", {
  headers: {
    Authorization: "Bearer sk_live_your_secret_key",
    Accept: "application/json",
  },
});
Python
import requests

response = requests.get(
    "https://{your-domain}/api/v1/me",
    headers={"Authorization": "Bearer sk_live_your_secret_key"},
)
PHP
$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#

  1. Store keys in environment variables — never hardcode them
  2. Use test keys for development — switch to live only in production
  3. Rotate keys periodically — regenerate keys if you suspect compromise
  4. Restrict server access — only your backend should use secret keys
  5. 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
JSON
{
  "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.