These are explicit permissions: they must be checked one by one in External integrations; existing integrations do not receive them automatically.
id values are sent as cost_center_id in journal entries, sales, purchases, collections, payments, transfers and payrolls, and they serve as a filter in the financial statements.
For functional usage (policy per account, how centers reach the journal entry, reassignment), see Cost centers in the manual.
Cost center object
List cost centers
accounting.cost_centers
Returns the flat list (sorted by code) and the same set as a tree.
Get cost center
accounting.cost_centers
Responds 200 with the cost center object inside data, or 404 Cost center not found.
Create cost center
accounting.cost_centers.write
Behavior
- The level (
level) is calculated from the parent. - When you create a sub-center, its parent stops being a leaf: it can no longer be assigned to new documents, but it still groups its children in reports.
201: the created cost center object.
Edit cost center
accounting.cost_centers.write
Accepts the same fields as creation, all optional: only the ones you send change.
- If you change
parent_id, the level of the center and of all its sub-centers is recalculated. - A center cannot depend on itself or on one of its sub-centers.
- Deactivating a center (
is_active: false) prevents assigning it to new documents and journal entries; what is already recorded is preserved.
200: the updated cost center object.
Delete cost center
accounting.cost_centers.write
Behavior
- If the center has not been used in journal entries or documents, it is deleted:
{"deleted": true, "deactivated": false}. - If it already has movements or documents, it is not deleted: it is deactivated to preserve the history:
{"deleted": false, "deactivated": true}. - If it has sub-centers, it responds
422: delete them or move them to another parent first.
Distributions
A distribution splits an amount among several leaf centers by percentage (for example, rent 60% Sales and 40% Administration). Itsid is sent as cost_center_distribution_id instead of cost_center_id in journal entries, sales, purchases and payrolls. See Distributions in the manual.
Usage rules
cost_center_idandcost_center_distribution_idare mutually exclusive at the same level (document or line): sending both responds422Indique centro de costo o distribución, no ambos..- The distribution must be active and belong to the company.
- When posting, each line of an account that accepts a center is split into one line per center according to the percentage; rounding is adjusted on the part with the highest percentage (60/40 over 100.01 gives 60.01 and 40.00). On accounts with the None policy, a single line without a center is used.
- Changing the percentages does not modify journal entries that were already generated.
- Collections, payments and transfers do not accept distributions.
Distribution object
percentage has up to 4 decimals and the sum of the lines is exactly 100. Lines are returned from highest to lowest percentage.
List distributions
accounting.cost_centers
Returns in
data the list of distributions sorted by code.
Get distribution
accounting.cost_centers
Responds 200 with the distribution or 404 Distribution not found.
Create distribution
accounting.cost_centers.write
Response
201: the created distribution.
Edit distribution
accounting.cost_centers.write
Accepts the same fields, all optional. If you send lines, they replace all previous lines (with the same rules). Responds 200 with the updated distribution.
Delete distribution
accounting.cost_centers.write
- Not used in documents or journal entries: it is deleted,
{"deleted": true}. - Already used: it is deactivated to preserve the history,
{"deleted": false, "deactivated": true}.
Distribution errors
422 Validation errors when the code is repeated, there are fewer than 2 lines, the sum is not 100 (errors.lines), a center is repeated, belongs to another company, is inactive or has sub-centers (errors["lines.N.cost_center_id"]), or a percentage is 0 or negative.