Prezio API uses Bearer token authentication as the standard method for both environments. API keys are available as a convenience option in sandbox.
Authentication Methods
Bearer Tokens
Standard Method: For both production and sandboxAuthorization: Bearer YOUR_ACCESS_TOKEN
API Keys
Sandbox Convenience: Additional option for quick testingAuthorization: Token YOUR_API_KEY
Bearer Token Authentication
Obtain Bearer tokens
curl -X POST "https://api.prezio.eu/api/auth/token/" \
-H "Content-Type: application/json" \
-d '{"username": "your_username", "password": "your_password"}'
Use in requests
Authorization: Bearer YOUR_ACCESS_TOKEN
Refresh when needed
curl -X POST "https://api.prezio.eu/api/auth/token/refresh/" \
-H "Content-Type: application/json" \
-d '{"refresh": "YOUR_REFRESH_TOKEN"}'
API Key Authentication (Sandbox)
Get API keys from dashboard.prezio.eu or contact support@prezio.eu.
Authorization: Token YOUR_API_KEY
API keys are a sandbox convenience feature. Bearer tokens are the standard method for both environments.
Example Usage
curl -X GET "https://api.prezio.eu/api/live/?country=DK&tariff_id=tar_123" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Security Best Practices
- Store tokens securely, never expose in client-side code
- Implement token refresh logic before expiration
- Use HTTPS for all requests
- Rotate API keys periodically
Common Errors
| Status | Error | Solution |
| 401 | Invalid token | Refresh your Bearer token or check API key |
| 403 | Permission denied | Contact support for access permissions |
Authentication failures count toward rate limits. Implement proper error handling.
Need help? Contact support@prezio.eu.