List a branch's cost centres
const url = 'https://api2.recruso.co.uk/v1/branches/1/cost-centres';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api2.recruso.co.uk/v1/branches/1/cost-centres \ --header 'Authorization: <Authorization>'Returns the active cost centres belonging to one branch. Deleted cost centres are excluded — use RestoreCostCentre to bring one back.
Cost centres are always scoped to a branch; there is no agency-wide list. A branch outside your agency or outside your accessible-branch list returns 404, and an accessible branch with no cost centres returns an empty array.
The response is not paged.
Access. Requires a client-credentials access token. Tokens issued through the interactive user login are rejected.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The branchId path parameter
Responses
Section titled “Responses”OK
The active cost centres belonging to one branch.
object
The cost centres. Empty if the branch has none.
One cost centre in a ListCostCentres result. Carries the same fields as GetCostCentreById.
object
The cost centre’s identifier. Unique within the agency, not within the branch.
The branch the cost centre belongs to. The same for every item in the list.
The cost centre name. Unique among the branch’s cost centres, deleted ones included.
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.
The nominal (general-ledger) code this cost centre posts against.
Example
{ "costCentres": [ { "costCentreId": 31, "branchId": 4, "costCentreName": "Warehouse Operatives", "sageDepartmentId": 21, "nominalCode": 4001 } ]}Unauthorized
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
