HyperTrackDocs
Orders

Complete Order

POST
/orders/{order_handle}/complete

Complete an order identified by the given order_handle. A completed order means that the shift occurred. Send the worker's timesheets from your system and additional metadata (merged with the stored metadata). The timesheets replace all stored customer timesheet entries; the HyperTrack location entry stays. A timesheet_updated webhook is sent when the stored timesheets change. An empty body completes the order as before.

Authorization

AuthorizationBasic <token>

In: header

Path Parameters

order_handle*string

Query Parameters

type?|

Type of the order which can be drop or pick

type_index?|

Integer representing the pick or drop order index when having a pick/drop scenario

fulfillment_attempt?|

The attempt number for fulfilling the order

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/orders/string/complete" \  -H "Content-Type: application/json" \  -d '{    "completed_at": "2026-10-14T23:05:00Z",    "timesheets": [      {        "type": "system",        "start_time": "2026-10-14T14:58:00Z",        "end_time": "2026-10-14T23:02:00Z",        "breaks": [          {            "start_time": "2026-10-14T18:00:00Z",            "end_time": "2026-10-14T18:30:00Z",            "type": "meal"          }        ]      }    ],    "metadata": {      "supervisor": "D. Chen",      "pay_hours": 8,      "shift_id": "S-55120"    }  }'
{  "order_handle": "order-1",  "fulfillment_attempt": 0,  "status": "completed",  "destination": {    "geometry": {      "type": "Point",      "coordinates": [        -121.8871193,        37.390611      ]    },    "address": "1709 Automation Pkwy, San Jose, CA 95101",    "radius": 100  },  "ops_group_handle": "store-SF",  "track_mode": "full_shift",  "plan_mode": "manual",  "risk_status": true,  "risks": {    "is_offline": "green",    "moving_away_from_destination": "green",    "delayed_from_scheduled_at": "green",    "deviating_from_expected_route": "green",    "in_outage": "green",    "moving_too_slow": "yellow",    "delayed_from_initial_eta": "green",    "in_low_battery": "green"  },  "scheduled_at": "2023-10-26T02:00:00.000Z",  "started_at": "2023-10-26T01:28:21.925Z",  "type": "pick",  "type_index": 0,  "expected_service_time": 0,  "actual_service_time": 0,  "tracked_service_time": 0,  "capacity_used": 1,  "metadata": {    "customerID": "12654",    "supervisor": "D. Chen",    "pay_hours": 8,    "shift_id": "S-55120"  },  "timesheets": [    {      "type": "system",      "source": "api",      "start_time": "2023-10-26T01:28:00Z",      "end_time": "2023-10-26T01:39:00Z"    },    {      "type": "location",      "source": "hypertrack-location",      "start_time": "2023-10-26T01:29:10.000Z",      "end_time": "2023-10-26T01:38:50.000Z",      "total_duration_on_premises": 580,      "total_break_duration": 0,      "finalized": false    }  ],  "region": {    "country": "United States",    "city": "San Jose",    "state": "California"  },  "share_url": "https://trck.at/xvgK2DRQvl",  "completed_at": "2023-10-26T01:39:45.503Z",  "device_id": "52193948-1A79-47CC-AB81-2FB0A59536D1",  "worker_handle": "James",  "created_at": "2023-10-25T17:54:42.233Z",  "assigned_at": "2023-10-25T18:08:44.892Z",  "route_handle": "812a1ea5-8c1e-407a-ba24-6cc46d783fef",  "planned_at": "2023-10-25T18:08:44.659Z",  "plan_id": "0f3415f2-63b7-4727-83d2-010e88b48715",  "distance": 0,  "duration": 21,  "tracking_rate": 0,  "polyline": {    "type": "LineString",    "coordinates": [      [        -121.877246,        37.371916,        24.49,        "2023-10-26T01:39:24.125Z"      ]    ]  },  "start_location": {    "type": "Point",    "coordinates": [      -121.877246,      37.371916    ]  },  "end_location": {    "type": "Point",    "coordinates": [      -121.877246,      37.371916    ]  },  "visited_destination": false,  "completed_at_destination": false,  "deviation_from_destination": 2254,  "timeline": [    {      "type": "driver_order_created",      "recorded_at": "2023-10-25T17:54:42.233Z",      "order_handle": "order-1",      "driver_handle": "James"    },    {      "type": "driver_order_assigned",      "recorded_at": "2023-10-25T18:08:44.892Z",      "order_handle": "order-1",      "driver_handle": "James"    },    {      "type": "driver_order_completed",      "recorded_at": "2023-10-26T01:39:45.503Z",      "order_handle": "order-1",      "driver_handle": "James"    }  ]}
{  "title": "string",  "detail": "string"}
{  "code": "string",  "title": "string",  "detail": "string"}
{  "code": "string",  "title": "string",  "detail": "string"}