shipmentLiveLocation
Requires permission sales:shipment:read.
Returns the courier's live position, asked of the carrier and cached for 15 seconds per shipment. Null unless the carrier supports live location and a courier is carrying the shipment (picked up or out for delivery), or when the carrier has no position yet. A carrier failure is returned as an error carrying the carrier's own words. Needs the delivery partners feature on your plan and the shipment read permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query ShipmentLiveLocation($shipmentId: ID!) {
shipmentLiveLocation(shipmentId: $shipmentId) {
carrierName
latitude
longitude
updatedAt
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query ShipmentLiveLocation($shipmentId: ID!) {\n shipmentLiveLocation(shipmentId: $shipmentId) {\n carrierName\n latitude\n longitude\n updatedAt\n }\n}",
"variables": {
"shipmentId": "id"
}
}
EOF
Variables:
{
"shipmentId": "id"
}
Response:
{
"data": {
"shipmentLiveLocation": {
"carrierName": "string",
"latitude": 0,
"longitude": 0,
"updatedAt": "2025-01-15T00:00:00Z"
}
}
}
shipmentLiveLocation(
shipmentId: ID!
): ShipmentLiveLocation
Arguments
shipmentLiveLocation.shipmentId ● ID! non-null scalar
The ID of the shipment.
Type
ShipmentLiveLocation object
The courier's last reported position for a shipment on its way (WGS-84 degrees). Read on demand from the carrier and reused for up to 15 seconds.