Create cost centre

POST /api/configuration/cost-centres/

Overview

Creates a cost centre — the top-level bucket that financial postings are attributed to. Departments hang off cost centres, so create the cost centre first and then reference its id when calling Create department.

A successful call returns 201 with the body "Created" and the new identifier in the Location header, which points at the GET route for the cost centre. The body does not contain the id, so if you let the system generate one, read it from Location.

Supply your own id to make the call safely retryable. With an explicit id, a repeat request returns 409 rather than creating a duplicate. With id omitted, every attempt allocates a fresh generated code, so a retry after a timeout leaves two cost centres behind.

A new cost centre appears in subsequent reads immediately.

Endpoint

POST {base_url}/api/configuration/cost-centres/

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Request body

FieldTypeRequiredDescription
idstringNoThe cost centre code, unique within your tenant and quoted by departments and financial postings. Maximum 15 characters. Omit it, or send an empty string, and the system allocates the next code in the sequence CCTR followed by 11 digits, for example CCTR00000000001 — the value comes back in the Location header, not the body. A code already in use returns 409 with Id {id} is already in use.
descriptionstringYesThe human-readable name of the cost centre, as it appears in financial reporting. Required, and no longer than 255 characters — both are enforced by request validation and return 400 with a validation error object keyed by field name.
referencestringNoYour own cross-reference for the cost centre, typically the code it carries in the finance system you are reconciling against. Maximum 255 characters. Omit it, or send null, to leave it blank; the value is saved as given and is not validated against anything.

Sample request

cURL
curl -X POST '{base_url}/api/configuration/cost-centres/' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "string",
  "description": "string",
  "reference": "string"
}'

Errors

StatusMeaningWhen
400Bad requestdescription is missing or longer than 255 characters, id is longer than 15 characters, or reference is longer than 255 characters. The body is a validation error object keyed by field name.
409ConflictA cost centre already exists with the id you supplied — Id {id} is already in use. Nothing is changed.
500Internal server errorAn unexpected server-side failure while saving the cost centre. The body is empty.

This page as markdown · All pages · llms.txt