Authentication

API keys

Generate API keys from your merchant dashboard:

  1. Log in to merchant.kawrie.com
  2. Go to Settings → API Keys
  3. Click Generate New Key
  4. Copy the key. It won't be shown again.

Include the key in the Authorization header of every request:

bash
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:

bash
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:

bash
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.