Skip to navigation

Update a delivery: cancel it, or edit its pickup or dropoff instructions

Send { "status": "CANCELLED" } on its own, optionally with cancellation_reason, to cancel; an instruction field set to null or an empty string next to status is ignored. Before the order is loaded the delivery is cancelled. Once it is loaded, a cancel starts a return for stores with returns enabled: the response carries status: RETURN_IN_PROGRESS, or RETURN_ARRIVED when the vehicle is still at the store, and the delivery then reports RETURN_IN_PROGRESS, RETURN_ARRIVED, and RETURNED. A repeated cancel during or after a return answers 200 with the current status. A cancel that lands after the handoff, or once the trunk has opened at the customer’s door, answers 409 with code DELIVERY_ALREADY_COMPLETED. For stores with returns enabled, a cancel on a delivery that already failed records the cancel instead of a no-op: the response carries status: CANCELLED and the pickup and order both move to CANCELLED. Send pickup_instructions and/or dropoff_instructions to edit them; null or an empty string clears a field, an absent field is left unchanged. Instructions can be edited until the delivery reaches COMPLETED, FAILED, CANCELLED, EXPIRED, or a return status.

Authentication

AuthorizationBearer

Autolane Platform API key. Org-scoped with granular permissions. Deliveries endpoints additionally require an x-retailer-id header containing the site UUID from the Autolane Portal; webhooks endpoints do not.

Path parameters

external_delivery_idstringRequired

Headers

x-retailer-idstringRequiredformat: "uuid"

Site ID (UUID) from the Autolane Portal identifying the store location

Request

Send status alone (with an optional cancellation_reason) to cancel, or one or both instruction fields to edit them. null or an empty string clears a field. Absent fields are left unchanged.

statusenumOptional

Send CANCELLED on its own (optionally with cancellation_reason) to cancel the delivery. Once the order is loaded, a cancel starts a return for stores with returns enabled and the response carries status: RETURN_IN_PROGRESS, or RETURN_ARRIVED when the vehicle is still at the store. Once the trunk has opened at the customer’s door, the handoff wins instead: 409 DELIVERY_ALREADY_COMPLETED. For stores with returns enabled, a cancel on a FAILED delivery records the cancel: the response carries status: CANCELLED. A cancel never edits instructions: an instruction field sent next to status must be null or an empty string, and is ignored.

Allowed values:
cancellation_reasonstring or nullOptional

Why the delivery is being cancelled: CUSTOMER_CANCELLED, COLD_CHAIN_EXPIRED, or OTHER. Any other value is recorded as OTHER. Optional. The reason never decides what happens; the delivery status does. Once the order is loaded, a cancel starts a return for stores with returns enabled (statuses RETURN_IN_PROGRESS, RETURN_ARRIVED, RETURNED), and the reason is echoed as return_reason.

pickup_instructionsstring or nullOptional<=2000 characters

Store-side instructions for the driver at pickup, such as a pickup or driver code. Shown to the driver from assignment until the order is loaded. Max 2000 characters. Integrations created before dropoff_instructions existed may be in legacy mode, where pickup_instructions is treated as the dropoff note and both fields read back the same value; when both are sent, dropoff_instructions is used unless it is null or empty. Ask Autolane to switch your account to the current behavior.

dropoff_instructionsstring or nullOptional<=2000 characters

Customer-side delivery instructions, such as a gate code or where to leave the order. Shown to the driver on the way to and at the customer. Max 2000 characters. Integrations created before dropoff_instructions existed may be in legacy mode, where pickup_instructions is treated as the dropoff note and both fields read back the same value; when both are sent, dropoff_instructions is used unless it is null or empty. Ask Autolane to switch your account to the current behavior.

Response

Delivery updated
successboolean
dataobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error