Skip to content

Update a cost centre

PUT
/v1/branches/{branchId}/cost-centres/{id}
curl --request PUT \
--url https://api2.recruso.co.uk/v1/branches/1/cost-centres/1 \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "branchId": 4, "id": 31, "costCentreName": "Warehouse Operatives", "sageDepartmentId": 21, "nominalCode": 4001 }'

Replaces the name and accounting fields of a cost centre. This is a full replacement — sageDepartmentId and nominalCode omitted from the request are written as null, so send the complete object.

A cost centre cannot be moved between branches; branchId identifies it, it does not reassign it.

The new name must stay unique within the branch: a clash with another active cost centre returns 400, and a clash with a deleted one returns 409 carrying that record’s costCentreId. A cost centre outside your agency, already deleted, or under a branch you cannot access returns 404.

Access. Requires a client-credentials access token. Tokens issued through the interactive user login are rejected.

branchId
required
integer format: int32

The branchId path parameter

id
required
integer format: int32

The id path parameter

Media typeapplication/json

The replacement state of a cost centre. This is a full replacement, not a merge: an omitted sageDepartmentId or nominalCode is written as null rather than left alone, so send the complete object.

object
branchId

The branch the cost centre belongs to. Bound from the route. This identifies the cost centre; it does not move it to a different branch.

integer format: int16
Example
4
id

The cost centre to update. Bound from the route.

integer format: int16
Example
31
costCentreName

The cost centre name. Required, up to 50 characters, and unique among the branch’s cost centres including deleted ones: a clash with another active one returns 400, a clash with a deleted one returns 409. Leading and trailing whitespace is trimmed.

string
Example
Warehouse Operatives
sageDepartmentId

The cost centre’s Sage department. Not verified against Sage by this endpoint — an unknown department is accepted here and fails later at posting time.

integer format: int32
nullable
Example
21
nominalCode

The nominal (general-ledger) code this cost centre posts against.

integer format: int64
nullable
Example
4001

OK

Media typeapplication/json

The cost centre as it stands after the update.

object
costCentreId

The cost centre’s identifier. Unchanged by the update.

integer format: int16
branchId

The branch the cost centre belongs to. Unchanged by the update.

integer format: int16
costCentreName

The cost centre name, trimmed. Unique among the branch’s cost centres, deleted ones included.

string
sageDepartmentId

The cost centre’s Sage department. The parent branch carries a sageDepartmentId of its own; which one a posting uses is decided by the Sage integration, not by this endpoint.

integer format: int32
nullable
nominalCode

The nominal (general-ledger) code this cost centre posts against.

integer format: int64
nullable
Example
{
"costCentreId": 31,
"branchId": 4,
"costCentreName": "Warehouse Operatives",
"sageDepartmentId": 21,
"nominalCode": 4001
}

Bad Request

Media typeapplication/problem+json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Unauthorized

Media typeapplication/problem+json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Forbidden

Media typeapplication/problem+json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Not Found

Media typeapplication/problem+json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Conflict

Media typeapplication/json

Returned with 409 when a cost centre name is already held by a deleted cost centre in the same branch. Restore that record or choose a different name.

object
costCentreId

The identifier of the deleted cost centre holding the name. Pass it to RestoreCostCentre to bring that record back instead of creating a new one.

integer format: int16
message

A human-readable explanation of the conflict. Diagnostic text, not a stable machine-readable code — branch on the 409 status and costCentreId instead.

string
Example
{
"costCentreId": 31,
"message": "A cost centre with this name was previously deleted for this branch."
}