API BCE versioning: v1, v2, compatibility and migration
API BCE versioning: how the version appears in the URL, what changed between v1 and v2, and our rule: no breaking change without a new version.
API BCE is versioned in the URL path. We never make breaking changes to a released version: new fields may be added, but existing fields keep their meaning.
v2 (current)#
Base URL https://companybelgium.be/api/v2. Richer data model, sub-resources, financials, beneficial owners, reference data, VAT validation and webhooks. Use v2 for all new integrations.
v1 (legacy)#
Base URL https://companybelgium.be/api. A smaller surface focused on search and company lookup. Still available, but new features land in v2 only.
curl "https://companybelgium.be/api/companies/search?q=espero" \
-H "X-API-Key: $API_BCE_KEY"Legacy v1 endpoints: /health, /companies/search, /companies/address, /companies/{id}, /stats, /peppol/check.
Why the version lives in the URL#
Because the version is part of the path, every request states which contract it expects. Therefore, an upgrade is an explicit change in your configuration, never a surprise. Within a released version, new fields may appear, but existing fields keep their meaning. As a consequence, your parser should ignore unknown fields instead of rejecting the response.
Migrating from v1 to API BCE v2#
- First, list every v1 call in your code:
/companies/search,/companies/address,/companies/{id},/peppol/check,/healthand/stats. - Then, map each one to its closest v2 equivalent:
/enterprise/{num}for details,/search/addressfor addresses and/denominationsfor names. - Add the
X-API-Secretheader, because v2 calls send both the key and the secret. - Update your parser for the v2 envelope with
success,dataanderror. - Finally, run your regression tests against the test API, which mirrors v2.
The v2 reference pages do not list a Peppol endpoint. So, if you rely on /peppol/check, keep that single call on v1 while the rest moves to v2.
Plan the migration in small steps. For example, move the detail lookup first, because it is often the most used call. Then, move the address search, and finally the name search. After each step, compare v1 and v2 answers for a sample of known companies. As a result, you catch mapping differences early and can roll back a single endpoint if needed.
Staying compatible over time#
A few habits keep an integration stable for years. First, read fields by name and never by position. Second, treat every field as optional, since fields without a value are omitted. Third, configure generated clients to accept extra properties. In addition, watch the changelog so you can adopt new data when it helps your product.
Also, keep the base URL in one place. When a future version ships, you can then test it on one service before you switch the others.
Frequently asked questions about API BCE versions#
Is v1 being switched off?
The documentation states that v1 is still available, while new features land in v2 only. Even so, plan your migration now, because v2 offers far more data.
Can a field disappear from a v2 response?
Existing fields keep their meaning in a released version. However, a field without a value is omitted for a given company, so your code must handle its absence.
Can I use API BCE v1 and v2 at the same time?
Yes. The two versions have different base URLs, therefore you can migrate endpoint by endpoint and test each step.