Migration v1 → v2
La v2 ne casse pas la v1 : les deux coexistent. Vous pouvez migrer endpoint par endpoint à votre rythme.
Coexistence
Les endpoints v1 (`/api/companies/*`, `/api/establishments/*`) restent disponibles indéfiniment. Vos clés API et secrets fonctionnent à l'identique sur les deux versions.
Correspondance des routes
| v1 | v2 |
|---|---|
| GET /api/companies/{id} | GET /api/v2/enterprise/{num} |
| GET /api/companies/{id}/establishments | GET /api/v2/enterprise/{num}/establishments |
| GET /api/companies/{id}/financials | GET /api/v2/enterprise/{num}/financial |
| — | GET /api/v2/enterprise/{num}/activities |
| — | GET /api/v2/enterprise/{num}/address |
| — | GET /api/v2/enterprise/{num}/contact |
| — | GET /api/v2/enterprise/{num}/denominations |
| — | GET /api/v2/enterprise/{num}/roles |
| GET /api/establishments/{id} | GET /api/v2/establishment/{num} |
| — | GET /api/v2/naces?q=... |
| — | GET /api/v2/juridical-forms |
| — | GET /api/v2/denominations?q=... |
| — | GET /api/v2/vat/{vatNumber} |
| — | GET /api/v2/me |
| — | ALL /api/v2/webhook[s]/* |
Changements à connaître
- Le préfixe URL change : `/api/companies/{id}` → `/api/v2/enterprise/{num}`.
- Les sous-ressources sont désormais des endpoints distincts (`/activities`, `/contact`, etc.) plutôt que des champs imbriqués.
- Le format de réponse `{success, data, timestamp}` reste identique.
Exemple de migration
diff
# Avant (v1) - GET /api/companies/1033022383 + GET /api/v2/enterprise/1033022383 # Granularité v2 — fetch uniquement le contact + GET /api/v2/enterprise/1033022383/contact # Auth identique : mêmes headers X-API-Key + X-API-Secret