Register a webhook endpoint in the Duffel dashboard (or via POST /webhooks) subscribing to event types: order.airline_initiated_change_created, order.cancelled, order.updated.
When order.airline_initiated_change_created fires, fetch the change details via GET /air/airline_initiated_changes/{id}; the object includes slices with new departure/arrival times and an action_taken field.
Evaluate whether the change is acceptable by your policy (e.g. less than 2 hours shift = auto-accept, more = prompt human); to accept, POST /air/airline_initiated_changes/{id}/actions/accept.
If the change is unacceptable and the airline allows it, fetch the order's available_actions and check for cancel or change; initiate a voluntary cancel via POST /air/order_cancellations with order_id, then confirm it.
On order.cancelled webhook, update your internal booking record status and trigger any downstream refund or notification logic; check refund_to field on the cancellation object to know whether refund goes to original payment or Duffel balance.
Implement idempotent webhook handling — Duffel may deliver the same event more than once; use the event id to deduplicate before processing.
Known gotchas
Not all airline-initiated changes come through Duffel webhooks in real time; some low-cost carriers communicate changes only via email to the passenger — build a periodic poll of critical orders as a fallback.
Cancellation refund timelines vary by airline; a successful cancel response from Duffel does not mean the refund has been processed — it may take days to weeks to appear on the original payment method.
Webhook delivery is best-effort with retries; if your endpoint returns non-2xx, Duffel will retry with backoff, potentially delivering the event multiple times — always acknowledge with 200 before processing business logic.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp