/v2/api/entity base and authenticated with a Bearer token.1) is the data level — how deeply related records are loaded — not a page number. On this endpoint the data level has no visible effect, so /cost_center/list and /cost_center/list/1 return the same result. Pagination is controlled by the page and per_page query parameters.| Parameter | Purpose |
|---|---|
page | Page number (default 1). |
per_page | Items per page (default 20). |
filter[<field>] | Filter by a field's value, e.g. filter[code]=1 or filter[is_primary]=1. Filterable fields: name, code, is_primary, cost_center_id, cost_center_ids. |
version | Set to 2 to run each row through the listing formatter. For cost centers the formatted rows have the same fields as the default output. |
data is a flat cost-center record.is_primary flag is:| Value | Meaning |
|---|---|
| 1 | Primary (root) cost center |
| 0 | Secondary (child) cost center |
cost_center_id is the id of the parent cost center (0 for a primary/root cost center), and cost_center_ids is the comma-separated ancestor path.curl --location --globoff 'https://.daftara.com/v2/api/entity/cost_center/list/1?page=undefined&per_page=undefined&filter[%3Cfield%3E]=undefined&version=undefined' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'apikey: ' \
--header 'Content-Type: application/json'{
"current_page": 1,
"data": [
{
"id": 0,
"name": "string",
"code": "string",
"is_primary": 0,
"cost_center_id": 0,
"cost_center_ids": "string",
"created": "string",
"modified": "string",
"branch_id": 0
}
],
"per_page": 20,
"total": 0,
"last_page": 0,
"from": 0,
"to": 0,
"first_page_url": "string",
"last_page_url": "string",
"next_page_url": "string",
"prev_page_url": "string",
"path": "string",
"links": [
{}
]
}