Authorization header:
Environments
| Environment | Base URL |
|---|---|
| Production | https://api.toffeepay.com |
| Sandbox | https://api.sandbox.toffeepay.com |
Best Practices
- Server-side only: Never expose access tokens in client-side code
- Use HTTPS: All API requests must be made over HTTPS
- Store securely: Use environment variables or a secrets manager to store access tokens
Error Handling
If authentication fails, the API returns a401 Unauthorized response. Common causes:
- Missing or malformed
Authorizationheader - Invalid or expired access token
- Using a sandbox token against production (or vice versa)