Authentication
API keys
Generate API keys from your merchant dashboard:
- Log in to merchant.kawrie.com
- Go to Settings → API Keys
- Click Generate New Key
- Copy the key. It won't be shown again.
Include the key in the Authorization header of every request:
Authorization: Bearer kw_live_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Environment | Key prefix | Use |
| --- | --- | --- |
| Live | kw_live_sk_ | Production traffic, real money |
| Sandbox | kw_sandbox_sk_ | Testing, no real money moves |
JWT authentication
Dashboard-facing endpoints (not covered in this API reference) use short-lived JWT tokens issued at login instead of API keys:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Idempotency
Every POST endpoint that moves money accepts an Idempotency-Key header. Send the same key on a
retried request and Kawrie returns the original result instead of creating a duplicate:
Idempotency-Key: unique-key-123
Generate a fresh, unique key per logical operation (for example, per order or per payout) and reuse it only when retrying that exact request after a timeout or network error.
Key rotation
Rotating a key does not invalidate the old one immediately. Both keys work for 24 hours so you can deploy the new key without downtime, then the old key is revoked automatically.