/v2/api/entity base and authenticated with a Bearer token.id in the request body is required and must match the id in the URL path. It is what identifies the record to update: if the body id is omitted, the request is treated as a new-record create instead of an update (and typically fails on the unique code or a missing required field).code must remain unique across the account. is_primary is:| Value | Meaning |
|---|---|
| 1 | Primary (root) cost center |
| 0 | Secondary (child) cost center |
cost_center_id is the parent cost center id (0 for a primary/root); cost_center_ids is the comma-separated ancestor path. branch_id, status, created and modified are managed by the server and are not settable through this endpoint.{ "message": "...", "id": <id> }. The message is localized to the caller's language (for example Cost center Updated Successfully in English).curl --location --globoff --request PUT 'https://.daftara.com/v2/api/entity/cost_center/2' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'apikey: ' \
--header 'Content-Type: application/json' \
--data '{
"id": 2,
"name": "Cost center name"
}'{
"message": "Cost center Updated Successfully",
"id": 37
}