Returns after load
A cancel that arrives after the order is loaded can now bring the order back to the store instead of being refused. Returns are enabled per site; ask your Autolane contact to switch them on.
What changed
PATCH /dd/v1/deliveries/{external_delivery_id}withstatus: CANCELLEDatLOADED,EN_ROUTE_TO_CUSTOMER, orARRIVED_AT_CUSTOMERanswers200withstatus: RETURN_IN_PROGRESSon sites with returns enabled, unless the trunk has already opened at the customer’s door, in which case the handoff wins instead. Sites without returns still get409. The body accepts an optionalcancellation_reason; any value is accepted, and an unrecognized or non-string value is recorded asOTHER.- Three new statuses,
RETURN_IN_PROGRESS,RETURN_ARRIVED,RETURNED, onpickup_status.changedand onGET. They always arrive in that order andRETURNEDis terminal. AfterRETURN_IN_PROGRESSa delivery never reportsEN_ROUTE_TO_CUSTOMER,ARRIVED_AT_CUSTOMER, orCOMPLETED. - New fields on the return statuses:
return_reason,return_stall_id(sites with stall reporting), andreturn_fee_centsonRETURNED.estimated_arrivalonRETURN_IN_PROGRESSis the arrival back at the store. 409 DELIVERY_ALREADY_COMPLETEDwhen a cancel lands after the handoff to the customer, or once the trunk has opened at the customer’s door.- A repeat cancel during or after a return answers
200with the current status and sends no new webhook. - Sandbox. The portal’s Advance button steps a returning delivery through
RETURN_ARRIVED(with an optional Return stall ID) andRETURNED.
Migration
No action is required unless you want returns. Integrations that reject a
status they do not know should add the three return statuses. Integrations that
de-duplicate webhook events on (external_delivery_id, status) should exempt
events whose previous_status equals status, as for stall corrections.