GuidesAPI ReferenceChangelog
Changelog
added

v.2.1.18

Time Tracking

New endpoint for adding and managing time tracking shifts and shift rates.

Shifts

Create Shifts

Create multiple shifts for a particular contract.

Endpoint: [POST /rest/v2/time_tracking/shifts]

https://developer.deel.com/reference/createtimetrackingshift

curl --location --request POST 'https://api.letsdeel.com/rest/v2/time_tracking/shifts' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
    "data": {
        "contract_id": "123456",
        "shifts": [
            {
                "external_id": "shift_123456",
                "description": "This is a sample shift description.",
                "date_of_work": "2023-10-01",
                "meta": {
                    "start": {
                        "date": "2023-10-01",
                        "time": "08:00",
                        "is_rest_day": false,
                        "is_public_holiday": false
                    },
                    "end": {
                        "date": "2023-10-01",
                        "time": "17:00",
                        "is_rest_day": false,
                        "is_public_holiday": false
                    },
                    "breaks": [
                        {
                            "start": {
                                "date": "2023-10-01",
                                "time": "12:00"
                            },
                            "end": {
                                "date": "2023-10-01",
                                "time": "12:30"
                            },
                            "is_paid": true
                        }
                    ],
                    "approval_date": "2023-10-02"
                },
                "summary": {
                    "shift_rate_external_id": "rate1234",
                    "shift_duration_hours": 8,
                    "total_break_hours": 1,
                    "payable_break_hours": 0.5,
                    "total_payable_hours": 7.5
                }
            }
        ]
    }
}'

Get shifts

List shifts for the particular organization

Endpoint: [GET /rest/v2/time_tracking/shifts]

https://developer.deel.com/reference/gettimetrackingshifts

curl --location --request GET 
'https://api.letsdeel.com/rest/v2/time_tracking/shifts?limit=10&offset=20' \
--header 'Authorization: Bearer {{token}}

Get Shift

Get single shift using shift external id

Endpoint: [GET /rest/v2/time_tracking/shifts/{{external_id}}]

https://developer.deel.com/reference/gettimetrackingshiftbyexternalid

curl --location --request GET 'https://api.letsdeel.com/rest/v2/time_tracking/shifts/{{external_id}}' \
--header 'Authorization: Bearer {{token}}'

Update shift

Update single shift

Endpoint: [PATCH /rest/v2/time_tracking/shifts/{{external_id}}]

https://developer.deel.com/reference/updatetimetrackingshift

curl --location --request PATCH 'https://api.letsdeel.com/rest/v2/time_tracking/shifts/{{external_id}}' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
    "data": {
        "description": "This is a sample shift description.",
        "date_of_work": "2023-10-01",
        "meta": {
            "start": {
                "date": "2023-10-01",
                "time": "08:00",
                "is_rest_day": false,
                "is_public_holiday": false
            },
            "end": {
                "date": "2023-10-01",
                "time": "17:00",
                "is_rest_day": false,
                "is_public_holiday": false
            },
            "breaks": [
                {
                    "start": {
                        "date": "2023-10-01",
                        "time": "12:00"
                    },
                    "end": {
                        "date": "2023-10-01",
                        "time": "13:00"
                    },
                    "is_paid": false
                }
            ],
            "approval_date": "2023-10-01"
        },
        "summary": {
            "shift_duration_hours": 8,
            "total_break_hours": 1,
            "payable_break_hours": 0.5,
            "total_payable_hours": 7.5
        }
    }
}'

Delete shift

Delete single shift

Endpoint: [DELETE /rest/v2/time_tracking/shifts/{{external_id}}]

https://developer.deel.com/reference/deletetimetrackingshift

curl --location --request DELETE 'https://api.letsdeel.com/rest/v2/time_tracking/shifts/{{external_id}}' \
--header 'Authorization: Bearer {{token}}'

Rate

Create shift rate

Create single shift rate for your organization

Endpoint: [POST /rest/v2/time_tracking/shift_rates]

https://developer.deel.com/reference/createtimetrackingshiftrate

curl --location --request POST 'https://api.letsdeel.com/rest/v2/time_tracking/shift_rates' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
    "data": {
        "external_id": "regular_rate_1",
        "name": "Regular Shift rate 1",
        "type": "PER_HOUR_FLAT_RATE",
        "value": 150
    }
}'

Get shift rates

List shift rates for a particular org

Endpoint: [GET /rest/v2/time_tracking/shift_rates]

https://developer.deel.com/reference/gettimetrackingshiftrates

curl --location --request GET 'https://api.letsdeel.com/rest/v2/time_tracking/shift_rates?limit=10&offset=5' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Get shift rate

Retrieve single shift rate

Endpoint: [GET /rest/v2/time_tracking/shift_rates/{{external_id}}]

https://developer.deel.com/reference/gettimetrackingshiftratebyexternalid

curl --location --request GET 'https://api.letsdeel.com/rest/v2/time_tracking/shift_rates/{{external_id}}' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Update shift rate

Update single shift rate

Endpoint: [PATCH /rest/v2/time_tracking/shift_rates/{{external_id}}]

https://developer.deel.com/reference/updatetimetrackingshiftrate

curl --location --request PATCH 'https://api.letsdeel.com/rest/v2/time_tracking/shift_rates/{{external_id}}' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
    "data": {
         "name": "On-call shift rate",
        "type": "PER_HOUR_FLAT_RATE",
        "value": 150
    }
}'

Delete shift rate

Delete single shift rate

Endpoint: [DELETE /rest/v2/time_tracking/shift_rates/{{external_id}}]

https://developer.deel.com/reference/deletetimetrackingshiftrate

curl --location --request DELETE 'https://api.letsdeel.com/rest/v2/time_tracking/shift_rates/{{external_id}}' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'