Categories
Full CRUD on purchase categories. One field set serves read and write, and children carries the whole subtree of a category, so a single list call returns the complete tree.
Two things to know: this is the only resource whose list defaults to newest first (-createdAt) rather than by name, and a delete has permanent side effects that restoring the row does not undo, see the DELETE operation.
Operations
Reads need master-data:read, writes master-data:write.
- GET
/api/v2/{companyId}/categories/: Paginated, newest first. Each row carries its whole subtree inchildren. - POST
/api/v2/{companyId}/categories/:namesis required;parentmust be a category of the same company. - GET
/api/v2/{companyId}/categories/{id}/: One category with its subtree. Soft-deleted rows are returned here too, withdeletedset. - PUT
/api/v2/{companyId}/categories/{id}/: Replaces the writable fields; anything you omit falls back to its default. - PATCH
/api/v2/{companyId}/categories/{id}/: Changes only the fields you send. - DELETE
/api/v2/{companyId}/categories/{id}/: Soft delete with permanent side effects: approval-flow conditions naming the category are cleared, the category is removed from every legal entity, supplier and preferred-vendor assignment, and a surviving child'sparentbecomesnull. Restoring the row undoes none of it. - POST
/api/v2/{companyId}/bulk-upsert/categories/: Bulk upsert, up to 50 rows, matched byidonly. Rows carrynames; the English name must be unique per company, a duplicate fails the row. Shared rules under Bulk upserts in the Introduction.
Endpoints
/api/v2/{companyId}/categories/?page=1&pageSize=25&ordering=-createdAt&fields=&omit=
/api/v2/{companyId}/categories/
/api/v2/{companyId}/categories/{id}/?fields=&omit=
/api/v2/{companyId}/categories/{id}/
/api/v2/{companyId}/categories/{id}/
/api/v2/{companyId}/categories/{id}/
/api/v2/{companyId}/bulk-upsert/categories/