Overview
The e-invoice.be API uses Bearer Token Authentication for all endpoints. You’ll need to include your API key in theAuthorization header of every request.
Getting Your API Key
If you haven’t already obtained your API key:- Log in to app.e-invoice.be
- Go to Settings → API Keys
- Click Create API Key
- Copy and securely store your key
Making Authenticated Requests
Include your API key in theAuthorization header with the Bearer prefix:
Request Format
YOUR_API_KEY with your actual API key.
Code Examples
Best Practices
Store API Keys Securely
Use environment variables or secure credential management systems:Never Hardcode Keys
Rotate Keys Regularly
For security best practices:- Generate a new API key
- Update your applications to use the new key
- Delete the old key once migration is complete
Use Different Keys per Environment
Create separate API keys for:- Development/staging environments
- Production environments
- Different applications or services
Error Responses
401 Unauthorized
If authentication fails, you’ll receive a 401 error:- Missing
Authorizationheader - Invalid API key format
- Expired or revoked API key
- API key from staging used in production (or vice versa)
Troubleshooting
- Verify the header format: Ensure you’re using
Bearer YOUR_API_KEY - Check for whitespace: Trim any extra spaces from your API key
- Confirm environment: Make sure you’re using the correct API key for production/staging
- Test with curl: Verify your key works with a simple curl command
Testing Your Authentication
Use the/api/me/ endpoint to verify your authentication is working:
Next Steps
Create Your First Invoice
Learn how to create and send e-invoices
Validate During Development
Test your invoice data before sending