Track service requests
Find the service request items that Deel IT services create, such as a delivery or a collection, and follow their status and courier tracking until the service ends. In the Deel app, the IT Logistics Tracker shows the same items as cards on a kanban board.
The service request item endpoints are in Beta and require the X-Beta: true header. See API versioning.
Prerequisites
- An organization or personal token with the
it-service-requests:readscope. See Authentication. ReplaceYOUR_API_TOKENin the samples with it. - An organization onboarded to Deel IT. See Getting Started with Deel IT.
- At least one Deel IT service in progress, for example a delivery created with
POST /it/assets/{asset_id}/deliver.
Treat the token like a password. Store it in an environment variable or a secrets manager, never in source code.
Track service requests
Find the service request items that are in progress
Filter the list by statuses, and repeat the key once per value. See GET /it/service-request-items for every field.
When has_more is true, pass the next_cursor value as the cursor query parameter on the next request. Read every page before you group the items.
Items with the same type and grouping_key belong to one service request, which the IT Logistics Tracker shows as one card.
To find the items of a service you created, filter by the ID you already have:
- For a service for an asset, add
asset_id. This is theasset_idin the path of the call that created the service, such asPOST /it/assets/{asset_id}/deliver. Each item returns it asasset.id. - For an order, add
grouping_keywith theidof the order fromPOST /it/orders, andtypes=ORDER:?grouping_key=9c2c387f-6c90-499a-85fb-0216fa7bb7a4&types=ORDER. The list returns an order’s items once they are approved, and theassetof an order item isnulluntil the ordered device is scanned.
Take the type and grouping_key of the service request you want to follow. You need them in the next step.
List the items of one service request
Filter the list by grouping_key and types together.
Save the id of each item. You need it in the next step. The id stays the same for the life of the item, while its grouping_key and type can change, for example when a shipment is booked.
Check an item's status and courier tracking
Replace {service_request_item_id} with the id of an item from the previous response. See GET /it/service-request-items/{service_request_item_id} for every field.
The service has ended when status is COMPLETED, DECLINED, or CANCELED. Every other status means it is still in progress.
shipment is null until a shipment exists for the item. Its tracking_link and courier_reference are null until the courier provides them.
Deel sends the it-asset.location-updated webhook when the location of an asset changes, for example when the courier picks it up and when it arrives. Match the event to the item by asset.id, then retrieve the item. For an order, Deel sends the it-order.updated webhook when the order is updated. Match the event to the order’s items by the order id, which is their grouping_key. See Webhooks for how to register an endpoint and verify signatures.
For a service that isn’t an order, these changes send no event: a booked courier, a new tracking link, a cancellation, and the end of an inspection. Retrieve the item when you need its current state.
Verify the result
Retrieve the item after the delivery arrives. An item that Deel collects can be UNDER_INSPECTION after it arrives, and is COMPLETED when the inspection ends.
status is COMPLETED and shipment.status is DELIVERED.