DocumentationAuthentication
Authentication
One header, on every request:
Authorization: Bearer sk_live_xxxxxxxxxxxx
Accept: application/json
Content-Type: application/json <- POST only
sk_test_...operates in sandbox;sk_live_...in production. The routes are identical: the environment is determined solely by the key prefix.- The secret key is server-side only. Never in a browser, a mobile app, a repository or a log.
- A publishable key (
pk_...) also exists in the portal, andGET /mereturns it aspublishable_key. Only the browser SDK uses it (modes 2 and 4); it never authenticates a secret-key route. - A partner connected through Continue with Roki sends an OAuth access token in the same
header instead of
sk_*; it behaves like the merchant's key for that environment, limited to the scopes granted (403 insufficient_scopeotherwise). See 32.
Authentication errors (two distinct messages, useful for diagnosis):
| Situation | HTTP | message |
|---|---|---|
Header missing |
401 |
Encabezado Authorization ausente o invalido. Use: Bearer sk_test_... o Bearer sk_live_... |
Key invalid or revoked |
401 |
Clave API invalida. |
