All requests to the ToffeePay API must be authenticated using a Bearer token in theDocumentation Index
Fetch the complete documentation index at: https://docs.toffeepay.com/llms.txt
Use this file to discover all available pages before exploring further.
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)