HyperTrackDocs
Orders

Cancel Order

Cancel an order identified by the given order_handle

POST
/orders/{order_handle}/cancel

Cancel an order identified by the given order_handle

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/cancel" \  -H "Content-Type: application/json" \  -d '{}'
{  "order_handle": "order-1",  "fulfillment_attempt": 0,  "status": "cancelled",  "destination": {    "geometry": {      "type": "Point",      "coordinates": [        -121.8610066,        37.3263062      ]    },    "address": "748 Story Rd, San Jose, CA 95112",    "radius": 100  },  "ops_group_handle": "store-sf",  "track_mode": "on_time",  "plan_mode": "manual",  "risks": {    "moving_away_from_destination": "green",    "is_offline": "green",    "delayed_from_scheduled_at": "green",    "deviating_from_expected_route": "green",    "moving_too_slow": "green",    "in_outage": "green",    "delayed_from_initial_eta": "green",    "in_low_battery": "green"  },  "scheduled_at": "2023-10-26T02:30:00.000Z",  "started_at": "2023-10-26T01:28:22.016Z",  "type": "drop",  "type_index": 0,  "expected_service_time": 0,  "actual_service_time": 0,  "tracked_service_time": 0,  "capacity_used": 1,  "metadata": {    "customerID": "12654"  },  "region": {    "country": "United States",    "city": "San Jose",    "state": "California"  },  "share_url": "https://trck.at/gv2oZRGKqB",  "cancelled_at": "2023-10-26T01:37:03.650Z",  "disabled_at": "2023-10-26T01:32:43.721Z",  "device_id": "52193948-1A79-47CC-AB81-2FB0A59536D1",  "worker_handle": "James",  "created_at": "2023-10-25T17:54:42.233Z",  "assigned_at": "2023-10-26T01:27:40.170Z",  "route_handle": "812a1ea5-8c1e-407a-ba24-6cc46d783fef",  "plan_id": "0f3415f2-63b7-4727-83d2-010e88b48715",  "distance": 0,  "duration": 520,  "polyline": {    "type": "LineString",    "coordinates": [      [        -121.877261,        37.371918,        24.98,        "2023-10-26T01:28:23.916Z"      ],      [        -121.877261,        37.371918,        24.98,        "2023-10-26T01:28:24.045Z"      ],      [        -121.877246,        37.371916,        24.49,        "2023-10-26T01:29:24.055Z"      ],      [        -121.877246,        37.371916,        24.49,        "2023-10-26T01:31:24.080Z"      ],      [        -121.877246,        37.371916,        24.49,        "2023-10-26T01:34:24.103Z"      ]    ]  },  "start_location": {    "type": "Point",    "coordinates": [      -121.877261,      37.371918    ]  },  "end_location": {    "type": "Point",    "coordinates": [      -121.877246,      37.371916    ]  },  "visited_destination": false,  "cancelled_at_destination": false,  "timeline": [    {      "type": "order_created",      "recorded_at": "2023-10-25T17:54:42.233Z",      "order_handle": "order-2",      "metadata": {        "customerID": "12654"      }    },    {      "type": "order_assigned",      "recorded_at": "2023-10-26T01:27:40.170Z",      "order_handle": "order-2",      "driver_handle": "James",      "fulfillment_attempt": 0    },    {      "type": "order_started",      "recorded_at": "2023-10-26T01:28:22.016Z",      "order_handle": "order-2",      "route_handle": "812a1ea5-8c1e-407a-ba24-6cc46d783fef",      "order_type": "drop",      "fulfillment_attempt": 0    },    {      "type": "driver_activity_started",      "recorded_at": "2023-10-26T01:28:23.916Z",      "driver_handle": null,      "activity": "stop",      "location": {        "geometry": {          "type": "Point",          "coordinates": [            -121.877261,            37.371918          ]        },        "recorded_at": "2023-10-26T01:28:23.916Z"      },      "address": "1653, De Rome Drive, San Jose, Santa Clara County, California, 95131, United States"    },    {      "type": "order_disabled",      "recorded_at": "2023-10-26T01:32:43.721Z",      "order_handle": "order-2",      "route_handle": "812a1ea5-8c1e-407a-ba24-6cc46d783fef",      "fulfillment_attempt": 0    },    {      "type": "driver_activity_ended",      "recorded_at": "2023-10-26T01:34:24.103Z",      "driver_handle": null,      "activity": "stop",      "location": {        "geometry": {          "type": "Point",          "coordinates": [            -121.877246,            37.371916          ]        },        "recorded_at": "2023-10-26T01:34:24.103Z"      },      "distance": null,      "duration": 360,      "steps": 0    },    {      "type": "order_cancelled",      "recorded_at": "2023-10-26T01:37:03.650Z",      "order_handle": "order-2",      "route_handle": "812a1ea5-8c1e-407a-ba24-6cc46d783fef",      "fulfillment_attempt": 0    }  ]}
{  "detail": {},  "message": "string"}
{  "detail": {},  "message": "string"}
{  "detail": {    "<location>": {      "<field_name>": [        "string"      ]    }  },  "message": "string"}