Skip to main content
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 sandbox
Authorization: Bearer YOUR_ACCESS_TOKEN

API Keys

Sandbox Convenience: Additional option for quick testing
Authorization: Token YOUR_API_KEY

Bearer Token Authentication

1

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"}'
2

Use in requests

Authorization: Bearer YOUR_ACCESS_TOKEN
3

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

StatusErrorSolution
401Invalid tokenRefresh your Bearer token or check API key
403Permission deniedContact support for access permissions
Authentication failures count toward rate limits. Implement proper error handling.
Need help? Contact support@prezio.eu.
I