# Create cost centre

`POST /api/configuration/cost-centres/`

- **Products:** Operator (`FOH`)
- **Features:** Front of House Generic Access (`FOHGENERIC`)

HTML version: [Create cost centre](https://support.gladstonesoftware.cloud/reference/configuration/create-cost-centre)

## 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](create-department.md).

**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](../../guides/authenticating-with-gladstone-apis.md).

## Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `id` | string | No | The 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`. |
| `description` | string | Yes | The 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. |
| `reference` | string | No | Your 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

```bash title="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

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | `description` 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. |
| `409` | Conflict | A cost centre already exists with the `id` you supplied — `Id {id} is already in use`. Nothing is changed. |
| `500` | Internal server error | An unexpected server-side failure while saving the cost centre. The body is empty. |
