Returns the list of cost centers
[ { "id": 3, "name": "Alternative Cost Center", "dimension_name": "Alternative", "assignee_ids": [9,13,15], "deactivated": 0, "send_to_accounting": 1, "external_id": "ABC", required_dimension: true }, { "id": 10, "name": "And Another Cost Center", "dimension_name": "BLAA", "assignee_ids": [9,13], "deactivated": 0, "send_to_accounting": 1, "external_id": "ABC", required_dimension: false } ]
Param name | Description |
---|---|
page
optional |
Page number Validations:
|
per_page
optional |
Number of records per page. Can be set to 1000 for getting more cost centers in one page. Default: 500 Validations:
|
skip_pagination
optional |
Pass true to skip pagination and receive all the cost centers in one request, no pagination. Validations:
|
name
optional |
Return the list of cost centers with names/dimension name matching the provided substring Validations:
|
deactivated
optional |
Filter the collection by “deactivated” field Validations:
|
required_dimension
optional |
Filter the collection by “required_dimension” field Validations:
|
Returns the list of authenticated user’s current company cost centers.
Each cost center in the list includes the same fields as each cost center in GET /api/cost_centers + the following additional fields:
Param name | Description |
---|---|
name
optional |
Return the list of cost centers with names/dimension name matching the provided substring Validations:
|
deactivated
optional |
Filter the collection by “deactivated” field Validations:
|
required_dimension
optional |
Filter the collection by “required_dimension” field Validations:
|
Create cost center
{ cost_center: { name: 'Blaname', dimension_name: 'Bla Dimension', assignee_ids: [1, 2, 55], deactivated: 0, send_to_accounting: 1, external_id: "ABC", required_dimension: true procountor: { dimension_id: 1, item_id: 1 }, netsuite: { internalid: '1' } } } Example curl request: curl -H "Authorization: Bearer token" -H "Content-Type: application/json" -X POST -d '{"cost_center": {"name": "foo", "dimension_name": "bar"}}' https://app.bezala.com/api/cost_centers
Param name | Description |
---|---|
cost_center
required |
Validations:
|
cost_center[name]
required |
Cost center name. Validations:
|
cost_center[dimension_name]
required |
Cost center dimension name. Cost centers with similar dimension name are grouped into one drop down in transaction form. Please note, name change entails required_dimension value change of Cost Centers with the same name with the value of the required_dimension of the current Cost Center Validations:
|
cost_center[assignee_ids]
optional , nil allowed |
Ids of users assigned to this cost center. Passing nil here will remove all assignees. Validations:
|
cost_center[deactivated]
optional , nil allowed |
Whether cost center should be hidden from transaction form. Default: false. Possible values: either 1 or 0. Validations:
|
cost_center[send_to_accounting]
optional , nil allowed |
Whether cost center should be sent to accounting. It doesn’t affect the UI. Default: true. Possible values: 1, 0 Validations:
|
cost_center[external_id]
optional , nil allowed |
Cost Center’s External ID, used in external services. Validations:
|
cost_center[required_dimension]
optional , nil allowed |
Make Dimension of current Cost Center required in Expense forms (Receipt, Per Diem, Daily Allowance, Reward). By setting this value in one Cost Center, all Cost Centers with the same Dimension name will be updated with the same value in required_dimension field. Default: false. Validations:
|
cost_center[netsuite]
optional , nil allowed |
NetSuite settings in hash Validations:
|
cost_center[procountor]
optional , nil allowed |
Procountor settings in hash Validations:
|
cost_center[approvers_attributes]
optional , nil allowed |
Add/Remove cost center approvers Validations:
|
cost_center[approvers_attributes][id]
optional , nil allowed |
Cost center approver id, required if user approver already exists. If it’s not supplied, new cost center approver will be added Validations:
|
cost_center[approvers_attributes][approver_id]
required |
Approver id Validations:
|
cost_center[approvers_attributes][operator]
required |
Operator specifying approver process logic Validations:
|
cost_center[approvers_attributes][_destroy]
optional , nil allowed |
Pass “true” here to delete an existing approver Validations:
|
Update cost centers. It is possible to edit any of its fields
Param name | Description |
---|---|
cost_center
required |
Validations:
|
cost_center[name]
optional |
Cost center name. Validations:
|
cost_center[dimension_name]
optional |
Cost center dimension name. Cost centers with similar dimension name are grouped into one drop down in transaction form. Please note, name change entails required_dimension value change of Cost Centers with the same name with the value of the required_dimension of the current Cost Center Validations:
|
cost_center[assignee_ids]
optional , nil allowed |
Ids of users assigned to this cost center. Passing nil here will remove all assignees. Validations:
|
cost_center[deactivated]
optional , nil allowed |
Whether cost center should be hidden from transaction form. Default: false. Possible values: either 1 or 0. Validations:
|
cost_center[send_to_accounting]
optional , nil allowed |
Whether cost center should be sent to accounting. It doesn’t affect the UI. Default: true. Possible values: 1, 0 Validations:
|
cost_center[external_id]
optional , nil allowed |
Cost Center’s External ID, used in external services. Validations:
|
cost_center[required_dimension]
optional , nil allowed |
Make Dimension of current Cost Center required in Expense forms (Receipt, Per Diem, Daily Allowance, Reward). By setting this value in one Cost Center, all Cost Centers with the same Dimension name will be updated with the same value in required_dimension field. Default: false. Validations:
|
cost_center[netsuite]
optional , nil allowed |
NetSuite settings in hash Validations:
|
cost_center[procountor]
optional , nil allowed |
Procountor settings in hash Validations:
|
cost_center[approvers_attributes]
optional , nil allowed |
Add/Remove cost center approvers Validations:
|
cost_center[approvers_attributes][id]
optional , nil allowed |
Cost center approver id, required if user approver already exists. If it’s not supplied, new cost center approver will be added Validations:
|
cost_center[approvers_attributes][approver_id]
optional |
Approver id Validations:
|
cost_center[approvers_attributes][operator]
optional |
Operator specifying approver process logic Validations:
|
cost_center[approvers_attributes][_destroy]
optional , nil allowed |
Pass “true” here to delete an existing approver Validations:
|
Toggle deactivated field of cost center