Docs β€Ί Orders

Cancel an order

POST /v1/orders/{externalId}/cancel.

http
POST /v1/orders/{externalId}/cancel

Cancels an order before pickup.

bash
curl -s -X POST https://api.trydragonfly.com/v1/orders/cater-88412/cancel \
  -H "Authorization: Bearer $DRAGONFLY_API_KEY" -H 'content-type: application/json' \
  -d '{ "reason": "Customer cancelled" }'
json
{ "data": { "orderId": "cm…", "externalId": "cater-88412", "status": "CANCELLED", "cancelled": true, "alreadyCancelled": false } }

Rules

Order stateResult
PENDING or ASSIGNEDCancelled. The driver is notified, and delivery.canceled_by_merchant fires.
Already CANCELLED200 with alreadyCancelled: true. Safe to retry.
PICKED_UP, DELIVERED or FAILED409 CANCEL_NOT_ALLOWED. The food or package is already with a driver; call dispatch.
On a Dragonfly-built route (routing mode)409 CANCEL_NOT_ALLOWED with status: ROUTED. Contact support to pull it from the route.

reason (optional, ≀500 characters) is recorded on the order.

Something unclear or missing? Tell us.