Skip to content

Restore a deleted cost centre

POST
/v1/branches/{branchId}/cost-centres/{id}/restore
curl --request POST \
--url https://api2.recruso.co.uk/v1/branches/1/cost-centres/1/restore \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "branchId": 4, "id": 31 }'

Reverses a soft delete, returning the cost centre to ListCostCentres and GetCostCentreById with its original name, Sage department and nominal code intact. There is no request body.

This is the resolution path for the 409 returned by CreateCostCentre and UpdateCostCentre: take the costCentreId from that response and call this endpoint with it.

If an active cost centre has since taken the same name in the branch, the restore returns 400 — rename or delete that one first. A cost centre that is not deleted, does not exist, is under a different branch, or is 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

Identifies the deleted cost centre to restore. Both values are bound from the route; the endpoint takes no request body.

object
branchId

The branch the deleted cost centre belongs to.

integer format: int16
Example
4
id

The deleted cost centre to restore. This is the costCentreId returned in the 409 body of CreateCostCentre or UpdateCostCentre.

integer format: int16
Example
31

OK

Media typeapplication/json

The restored cost centre, active again with the values it held when it was deleted.

object
costCentreId

The cost centre’s identifier. The original id is kept, not reallocated.

integer format: int16
branchId

The branch the cost centre belongs to.

integer format: int16
costCentreName

The cost centre name, as it was before the delete.

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"
}