Docs βΊ Orders
Cancel an order
POST /v1/orders/{externalId}/cancel.
http
POST /v1/orders/{externalId}/cancelCancels 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 state | Result |
|---|---|
PENDING or ASSIGNED | Cancelled. The driver is notified, and delivery.canceled_by_merchant fires. |
Already CANCELLED | 200 with alreadyCancelled: true. Safe to retry. |
PICKED_UP, DELIVERED or FAILED | 409 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.