Orders

Cancel Order

Cancel an order identified by the given order_handle. A cancelled order means that the shift did not occur as planned. Send cancellation_reason to say why, the worker's timesheets when the worker came and was sent home, and additional metadata (merged with the stored metadata), for example the handle of the order that replaces this one. The timesheets replace all stored customer timesheet entries; the HyperTrack location entry stays. An empty body cancels the order as before.

A completed order can be cancelled with a cancellation_reason not more than 7 days after completed_at. The status then changes from completed to cancelled, completed_at becomes null, and a cancelled webhook is sent. Without a cancellation_reason, or after 7 days, the response is 409.

post/orders/{order_handle}/cancel

Request

Path parameters

order_handlestring required

Query parameters

typestring nullable

Type of the order which can be drop or pick

type_indexinteger nullable

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

fulfillment_attemptinteger nullable

The attempt number for fulfilling the order

Request body

cancellation_reason'no_show' | 'worker_cancelled' | 'client_cancelled' | 'other' | 'null' nullable

Why the shift did not occur as planned. Consumers must accept new values. Different from cancellation_source, which is the channel that cancelled the order. Required to cancel a completed order (not more than 7 days after completed_at).

metadataobject nullable

Additional information about the order. Shallow merge with the stored metadata: keys sent overwrite, keys not sent stay. Limit on the merged object: 64 keys, 16 KB.

Response

Successful response

order_handlestring required

Unique customer provided identifier for an order

status'completed' | 'cancelled' | 'disabled' | 'ongoing' | 'unplanned' | 'assigned' | 'planned' | 'dispatched' | 'summarizing' required

Current state of the order

fulfillment_attemptinteger nullable

Number identifying the attempt count for the order

created_atstring nullable

Timestamp at which the order was created

rescheduled_marked_atstring nullable

Timestamp at which the order was rescheduled

risk_statusboolean nullable

Flag indicating whether the order is at risk

ops_group_handlestring nullable

Unique identifier for the ops group to which the order is associated

plan_mode'on_demand' | 'scheduled' | 'manual' | 'null' nullable

Value indicating how the order was planned - manual, scheduled

device_idstring nullable

Unique identifier for a device

driver_handlestring nullable

Unique customer provided identifier for the driver

worker_handlestring nullable

Unique customer provided identifier for the worker

started_atstring nullable

Timestamp at which the order tracking started

assigned_atstring nullable

Timestamp at which the order was assigned to a driver

planned_atstring nullable

Timestamp at which the order was planned into a route

scheduled_atstring nullable

Timestamp by which the order should be fulfilled to meet the customer promise

scheduled_afterstring nullable

Timestamp after which the order should be fulfilled to meet the customer promise

completed_atstring nullable

Timestamp at which the order was completed

cancelled_atstring required

Timestamp at which the order was cancelled

cancellation_sourceobject nullable

Detail about how order got cancelled

cancellation_reasonstring nullable

Customer-reported reason why the shift did not occur as planned: no_show, worker_cancelled, client_cancelled, other. Consumers must accept new values.

disabled_atstring nullable

Timestamp at which the order was disabled so that it can be fulfillment later

enabled_atstring nullable

Timestamp at which the disabled order was enabled for fulfillment

arrived_atstring nullable

Timestamp at which the driver arrived at the order fulfillment location

exited_atstring nullable

Timestamp at which the driver exited from the order fulfillment location

metadataobject nullable

Additional customer provided information about the order

risksobject nullable

Object containing different risk statuses for the order

expected_service_timeinteger nullable

Time in seconds that the driver is expected to spend at the location when fulfilling the order

product_typestring[] nullable

List of customer provided product/service types used when matching orders to a driver

type'pick' | 'drop' | 'null' nullable

Field to specify if the order is a pick/drop

type_indexinteger nullable

Field to specify if the order is a pick/drop

capacity_usedinteger nullable

Volumetric unit occupied by the order

distanceinteger nullable

Total distance in meters travelled by the driver to reach the order location

durationinteger nullable

Total time in seconds spent on the order.

share_urlstring nullable

Shareable URL for the consumer to track the live movement of the drive after the order is dispatched

embed_urlstring nullable

Embeddable URL for the ops team to view order timeline

route_handlestring nullable

Unique identifier for the route

plan_idstring nullable

Unique identifier of the plan

planning_failure_reasonstring nullable

Reason explaining why automated planning left the order unplanned. Present only when a planning attempt could not assign the order.

track_mode'full_shift' | 'on_shift' | 'pre_shift' | 'null' nullable

Value representing whether the order is tracked in flex, on_time, on_shift, full_shift or pre_shift mode

actual_service_timeinteger nullable

Time in seconds that the driver is actually spent at the location when fulfilling the order

tracked_service_timeinteger nullable

Total time tracked in seconds for the driver at the location when fulfilling the order

deviation_from_destinationinteger nullable

Distance in meters between the actual completion location to the order location

completed_at_destinationboolean nullable

Indicates whether the order was completed at destination

cancelled_at_destinationboolean nullable

Indicates whether the order was cancelled at destination

visited_destinationboolean nullable

Indicates whether the driver visited the destination

tracking_ratenumber nullable

Indicates the ratio of time tracked to expected tracking time of order. Values lie between 0.0 and 1.0

imagesstring[] nullable

List of URLs to be used to retrieve images associated with the order

order_scorenumber nullable
time_to_first_eventnumber nullable

Time in seconds to receive first location after device's tracking is initiated for the route

time_to_first_locationnumber nullable

Time in seconds to receive first event after device's tracking is initiated for the route

worker_namestring nullable

Name of the worker to whom order is assigned.

device_switch_modeunknown
place_handlestring nullable

Unique customer provided identifier of the place

priorityunknown

Changes

No recorded changes to this operation across all 1 revision of this API.