Legal entities
Full CRUD on legal entities. Needs the Legal entity feature enabled for the company on top of External API; without it every verb here is 403.
The three link lists (delivery addresses, invoice addresses and payment methods) are writable, and isDefault is required on every entry: it decides the ordering of the list, so Hivebuy will not guess it. Note that accountingArea is what the d.velop integration reads as its company id.
Not available here: members, isGlobal, datevClient.
Operations
Reads need master-data:read, writes master-data:write.
- GET
/api/v2/{companyId}/legal-entities/: Paginated by name, with departments, users, categories and the three link lists nested in full. - POST
/api/v2/{companyId}/legal-entities/:nameis required, and so isisDefaulton every link entry. - GET
/api/v2/{companyId}/legal-entities/{id}/: One legal entity. Soft-deleted rows are returned here too. - PUT
/api/v2/{companyId}/legal-entities/{id}/: Replaces the writable fields. A link list you omit is cleared;PUTmeans replace, andnullmeans the same for the two address lists. - PATCH
/api/v2/{companyId}/legal-entities/{id}/: Changes only what you send; link lists you omit are left alone. - DELETE
/api/v2/{companyId}/legal-entities/{id}/: Soft delete; the row stays retrievable by id. - POST
/api/v2/{companyId}/bulk-upsert/legal-entities/: Bulk upsert, up to 50 rows, matched byidthenname. Needs the legal-entity feature,403otherwise. Shared rules under Bulk upserts in the Introduction.
Endpoints
/api/v2/{companyId}/legal-entities/?page=1&pageSize=25&ordering=name&fields=&omit=
/api/v2/{companyId}/legal-entities/
/api/v2/{companyId}/legal-entities/{id}/?fields=&omit=
/api/v2/{companyId}/legal-entities/{id}/
/api/v2/{companyId}/legal-entities/{id}/
/api/v2/{companyId}/legal-entities/{id}/
/api/v2/{companyId}/bulk-upsert/legal-entities/