Skip to main content

Overview

The e-invoice.be API uses Bearer Token Authentication for all endpoints. You’ll need to include your API key in the Authorization header of every request.

Quick Start for New Users

If you’re just getting started:
  1. Use the production API: https://api.e-invoice.be
  2. Create a sandbox company: In app.e-invoice.be, click Create sandbox company to get a test-mode company and its own API key
  3. Start developing: A sandbox company prevents real Peppol transmission while you build your integration
For most users, you only need to know about api.e-invoice.be and test mode.

Understanding the Setup

What API Should I Use?

Answer: Use https://api.e-invoice.be - This single API works for both development and live transactions.

How Do I Test Without Sending Real Invoices?

Answer: Create a sandbox company. A sandbox company runs in test mode: documents are emailed instead of being sent via Peppol. This lets you:
  • Test your integration safely
  • Verify invoice data and UBL generation
  • See exactly what would be sent via Peppol
Create one from app.e-invoice.be — see Test Mode for the full walkthrough.

API Host

Production API: api.e-invoice.be

Base URL: https://api.e-invoice.be This is the only API host you need:
  • For development: With test mode enabled
  • For production: With test mode disabled
  • Stable features: Well-tested, production-ready
  • Standard rate limits: Suitable for most applications
Use https://api.e-invoice.be for everything. Test mode determines whether documents go out over Peppol, not the base URL.

Test Mode Explained

Test mode is delivered through a sandbox company — a dedicated company that changes how documents are transmitted:

Key Points About Test Mode

  • It’s determined by the company you authenticate as, not by which base URL you use
  • A sandbox company has its own API key, separate from your live company’s key
  • A sandbox company cannot be converted to a live one — create a separate regular company to go live
  • Everything else works the same (validation, webhooks, API endpoints, etc.)
Create a sandbox company from app.e-invoice.be. See Test Mode for details.

Getting Your API Key

If you haven’t already obtained your API key:
  1. Log in to app.e-invoice.be
  2. Go to SettingsAPI Keys
  3. Click Create API Key
  4. Copy and securely store your key
Your API key is sensitive. Never share it publicly, commit it to version control, or expose it in client-side code.

Making Authenticated Requests

Include your API key in the Authorization header with the Bearer prefix:

Request Format

Replace YOUR_API_KEY with your actual API key.
The same API key works whether or not test mode is enabled on your account.

Code Examples

Best Practices

Store API Keys Securely

Use environment variables or secure credential management systems:

Never Hardcode Keys

Don’t do this:
Do this instead:

Development Workflow

  1. Create a sandbox company in app.e-invoice.be and use its API key
  2. Use the production API (api.e-invoice.be) for development
  3. Switch to your live company’s API key when you’re ready to go live
You don’t need to change your base URL or code when switching from development to production - just use your live company’s API key and documents will be sent via Peppol instead of email. Learn more about test mode →

Rotate Keys Regularly

For security best practices:
  1. Generate a new API key in your dashboard
  2. Update your applications to use the new key
  3. Delete the old key once migration is complete

Use Multiple API Keys

Create separate API keys for:
  • Sandbox companies (test mode) and real companies (production)
  • Different applications or services
  • Different team members or departments
  • Programmatic access vs. manual testing
This allows you to rotate or revoke keys without affecting all systems.

Error Responses

401 Unauthorized

If authentication fails, you’ll receive a 401 error:
Common causes:
  • Missing Authorization header
  • Invalid API key format
  • Expired or revoked API key
  • Typo in API key
  • Using a sandbox company’s API key for production sends (or vice versa)

Troubleshooting

  1. Verify the header format: Ensure you’re using Bearer YOUR_API_KEY
  2. Check for whitespace: Trim any extra spaces from your API key
  3. Confirm the workspace: Make sure you’re using the correct API key (sandbox company vs. real company)
  4. 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:
Successful response:
If you see this response, your authentication is working correctly!

Next Steps

Create Your First Invoice

Learn how to create and send e-invoices

Validate During Development

Test your invoice data before sending