The Cost Center object

Attributes

id string

Unique identifier for the object.

created_at string

ISO 8601 timestamp of when the object was created.

updated_at string

ISO 8601 timestamp of when the object was last updated.

parent_id string
is_group boolean

Default: false

cost_center_name string required
cost_center_number string
parent_cost_center string required
company string required
disabled boolean

Default: false

The Cost Center object
{
  "id": "cost-center_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "cost_center_name": "cost_center_name_example",
  "cost_center_number": "cost_center_number_example",
  "parent_cost_center": "parent_cost_center_example",
  "company": "Example Corp",
  "disabled": false
}
GET /api/accounts/cost-center/{id}

Retrieve a cost center

Retrieves the details of an existing cost center. Supply the unique cost center ID that was returned from a previous request.

Path parameters

id string required

The identifier of the cost center to retrieve.

Returns

Returns the cost center object if a valid identifier was provided.

GET /api/accounts/cost-center/{id}
curl https://api.overplane.dev/api/accounts/cost-center/cost-center_abc123 \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "cost-center_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "cost_center_name": "cost_center_name_example",
  "cost_center_number": "cost_center_number_example",
  "parent_cost_center": "parent_cost_center_example",
  "company": "Example Corp",
  "disabled": false
}
GET /api/accounts/cost-center

List all cost centers

Returns a list of cost centers. The results are sorted by creation date, with the most recently created appearing first.

Query parameters

limit integer

Maximum number of objects to return. Default: 20.

offset integer

Number of objects to skip for pagination. Default: 0.

Returns

A paginated list of cost center objects.

GET /api/accounts/cost-center
curl https://api.overplane.dev/api/accounts/cost-center \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "data": [
    {
      "id": "cost-center_abc123",
      "created_at": "2024-01-15T09: 30: 00Z",
      "updated_at": "2024-01-15T09: 30: 00Z",
      "parent_id": null,
      "is_group": false,
      "cost_center_name": "cost_center_name_example",
      "cost_center_number": "cost_center_number_example",
      "parent_cost_center": "parent_cost_center_example",
      "company": "Example Corp",
      "disabled": false
    }
  ],
  "has_more": false,
  "total": 1
}
POST /api/accounts/cost-center

Create a cost center

Creates a new cost center object.

Body parameters

parent_id string
is_group boolean

Default: false

cost_center_name string required
cost_center_number string
parent_cost_center string required
company string required
disabled boolean

Default: false

Returns

Returns the newly created cost center object if the call succeeded.

POST /api/accounts/cost-center
curl https://api.overplane.dev/api/accounts/cost-center \
  -H "Authorization: Bearer sk_test_..." \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"cost_center_name":"cost_center_name_example","parent_cost_center":"parent_cost_center_example","company":"Example Corp"}'
Response
{
  "id": "cost-center_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "cost_center_name": "cost_center_name_example",
  "cost_center_number": "cost_center_number_example",
  "parent_cost_center": "parent_cost_center_example",
  "company": "Example Corp",
  "disabled": false
}
PATCH /api/accounts/cost-center/{id}

Update a cost center

Updates the specified cost center by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Path parameters

id string required

The identifier of the cost center to update.

Body parameters

parent_id string
is_group boolean

Default: false

cost_center_name string
cost_center_number string
parent_cost_center string
company string
disabled boolean

Default: false

Returns

Returns the updated cost center object.

PATCH /api/accounts/cost-center/{id}
curl https://api.overplane.dev/api/accounts/cost-center/cost-center_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X PATCH \
  -H "Content-Type: application/json" \
  -d '{"parent_id":null,"is_group":false}'
Response
{
  "id": "cost-center_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "cost_center_name": "cost_center_name_example",
  "cost_center_number": "cost_center_number_example",
  "parent_cost_center": "parent_cost_center_example",
  "company": "Example Corp",
  "disabled": false
}
DELETE /api/accounts/cost-center/{id}

Delete a cost center

Permanently deletes a cost center. This cannot be undone.

Path parameters

id string required

The identifier of the cost center to delete.

Returns

Returns a confirmation that the cost center has been deleted.

DELETE /api/accounts/cost-center/{id}
curl https://api.overplane.dev/api/accounts/cost-center/cost-center_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X DELETE
Response
{
  "id": "cost-center_abc123",
  "deleted": true
}
GET /api/accounts/cost-center/{id}/children

Get children

Returns the direct children of the specified node in the tree.

Path parameters

id string required

The identifier of the cost center to act on.

Returns

A list of direct child objects.

GET /api/accounts/cost-center/{id}/children
curl https://api.overplane.dev/api/accounts/cost-center/cost-center_abc123/children \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "cost-center_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "cost_center_name": "cost_center_name_example",
  "cost_center_number": "cost_center_number_example",
  "parent_cost_center": "parent_cost_center_example",
  "company": "Example Corp",
  "disabled": false
}
GET /api/accounts/cost-center/{id}/ancestors

Get ancestors

Returns all ancestors from the immediate parent up to the root of the tree.

Path parameters

id string required

The identifier of the cost center to act on.

Returns

A list of ancestor objects from parent to root.

GET /api/accounts/cost-center/{id}/ancestors
curl https://api.overplane.dev/api/accounts/cost-center/cost-center_abc123/ancestors \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "cost-center_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "cost_center_name": "cost_center_name_example",
  "cost_center_number": "cost_center_number_example",
  "parent_cost_center": "parent_cost_center_example",
  "company": "Example Corp",
  "disabled": false
}
GET /api/accounts/cost-center/{id}/descendants

Get descendants

Returns all descendants of the specified node in the tree.

Path parameters

id string required

The identifier of the cost center to act on.

Returns

A list of all descendant objects.

GET /api/accounts/cost-center/{id}/descendants
curl https://api.overplane.dev/api/accounts/cost-center/cost-center_abc123/descendants \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "cost-center_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "cost_center_name": "cost_center_name_example",
  "cost_center_number": "cost_center_number_example",
  "parent_cost_center": "parent_cost_center_example",
  "company": "Example Corp",
  "disabled": false
}