Authentication
How to authenticate API requests with secret keys.
Every request authenticates with a secret key in the Authorization header:
curl https://api.ouipay.com/v1/transactions \
-H "Authorization: Bearer sk_test_51M2s..."Key types
| Prefix | Environment | Permissions |
|---|---|---|
sk_test_ | Sandbox | Full API, simulated providers |
sk_live_ | Live | Full API, real money |
Secret keys grant full access to your account's resources. They are secrets : store them in a secrets manager, never in source control, client bundles, or mobile apps.
Requests that need extra proof
Money-moving endpoints additionally require an Idempotency-Key header (see
Idempotency): this is not authentication but a
replay guard.
Rotating keys
Dashboard → Developers → API keys → Rotate. Rotation is two-phase:
- A new key is issued; the old key remains valid for a grace period.
- Update your integrations to the new key, then revoke the old one.
Key leaked?
Rotate immediately from the dashboard. A leaked live key can move real money : do not wait to investigate first.
IP allowlisting
Optionally restrict live keys to a set of source IPs in the dashboard.
Requests from other addresses return 403 with error.code = "FORBIDDEN".
Recommended for production.
Errors
| HTTP | error.code | Cause |
|---|---|---|
| 401 | UNAUTHENTICATED | Missing, malformed, or revoked key |
| 403 | FORBIDDEN | Valid key, disallowed IP or scope |
| 403 | ACCOUNT_SUSPENDED | Account suspended by operations |