Authentication

Authentication

Authentication

The e-invoice.be API uses API key authentication to secure all requests. This guide explains how to authenticate your requests.

API Keys

Each API request must include an API key in the Authorization header. You can obtain an API key by requesting access to our API.

Request Format

Authorization: Bearer YOUR_API_KEY

Example

curl -X GET "https://api.e-invoice.be/api/documents" \
     -H "Authorization: Bearer YOUR_API_KEY"

Security Best Practices

  1. Never share your API key

    • Keep your API key secure
    • Don’t commit it to version control
    • Don’t share it in public forums
  2. Use environment variables

    export E_INVOICE_API_KEY=your_api_key
  3. Rotate keys regularly

    • Generate new keys periodically
    • Revoke old keys when no longer needed
  4. Use different keys for different environments

    • Development
    • Testing
    • Production

Error Handling

If authentication fails, you’ll receive a 401 Unauthorized response:

{
  "detail": "Invalid or missing API key"
}

Common authentication errors:

  • Missing API key
  • Invalid API key
  • Expired API key
  • Insufficient permissions

Next Steps