GuidesAPI ReferenceChangelog
Changelog
added

v2.1.112

Cost Centers management for contracts and legal entities

Assign Cost Centers

Register the allocation of active cost centers of a legal entity to an employment contract of that entity. The new configuration requires an effective day to become valid and the allocation must add up exactly to 1 (100% allocated). The returned id represents an employment term where this information is registered.

Endpoint: POST /rest/v2/contracts/:contract_id/cost-centers

Token scopes: contracts:write

API Reference: Assign cost centers to an employment contract

Request Example:

curl --request POST \
     --url https://api.letsdeel.com/rest/v2/contracts/contract_id/cost-centers \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'authorization: Bearer {{token}}'

Get cost centers for legal entity

Fetches a list of all available cost centers for a legal entity, which does not includes archived cost centers. Does not include cost centers allocations by contract, even if the legal entity is a part on these contracts.

Endpoint: GET /rest/v2/legal-entities/:legal_entity_id/cost-centers

Token scopes: legal-entity:read

API Reference: Get cost centers by legal entity

Request Example:

curl --request GET \
     --url https://api.letsdeel.com/rest/v2/legal-entities/id/cost-centers \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'authorization: Bearer {{token}}'

Synchronize cost centers for legal entity

Define the active cost center data for a legal entity. This will delete existing items that are not present on the payload, create new items, and finally update cost centers that maintain the same name. Please be aware that is not possible to delete cost centers that are currently allocated to one or more contracts.

Endpoint: POST /rest/v2/legal-entities/:legal_entity_id/cost-centers/synchronize

Token scopes: legal-entity:write

API Reference: Sync cost centers for legal entity

Request Example:

curl --request POST \
     --url https://api.letsdeel.com/rest/v2/legal-entities/id/cost-centers/synchronize \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'authorization: Bearer {{token}}'