Event: Cancellation Request

delivery_provider.cancellation_request — calling off a delivery that has not finished.

Event: Cancellation Request

event_type: delivery_provider.cancellation_request

Sent when a delivery is called off — the customer cancelled, the store cannot fulfil the order, or an operator intervened.

Request

{
  "event_id": "d3907c1e-8b52-4a7f-b0c4-72e5f1a93b60",
  "event_type": "delivery_provider.cancellation_request",
  "event_timestamp": 1785063000,
  "user_id": 12,
  "data": {
    "brand_id": null,
    "brand_guid": null,
    "provider_store_id": "STORE-8871",
    "order_guid": "6f1c2b18-3f4d-4f0e-9a6f-2f3b1a9c4d55",
    "order_id": 884213,
    "provider_delivery_id": "prv_dl_xyz789",
    "order_delivery_assignment_id": 5512
  }
}
FieldTypeNotes
provider_delivery_idstring | nullThe delivery to cancel — the id you returned at dispatch. Your primary key for this.
order_guidUUID | nullThe order the delivery belongs to.
order_idinteger | nullThe same order as a number, for platforms keyed on it.
provider_store_idstring | nullYour store identifier. Some platforms scope cancellation by store.
order_delivery_assignment_idintegerYUMBI Gateway's internal id for this delivery attempt. Useful for support correspondence.
brand_id, brand_guidnullInternal to YUMBI Gateway. Always null for you.

Unlike dispatch, this event carries no order detail — you already hold the delivery.

Response

Your status code is the answer. There is no body contract.

You returnYUMBI Gateway does
2xxMarks the delivery cancelled and stops expecting updates from you
non-2xxLeaves the delivery live; tells the channel it was not cancelled
HTTP/1.1 200 OK

{ "cancelled": true }

Return a non-2xx whenever you will not cancel — most often because the driver already has the food, or your own window has closed:

HTTP/1.1 422 Unprocessable Entity

{ "error": "driver_en_route", "message": "Courier has collected the order" }

The channel is shown that the cancellation did not take, so its operator knows the driver is still coming. It checks the flag rather than the status code, so a refusal is a normal outcome rather than an error.

Rules

Be idempotent. Cancelling something already cancelled is a 2xx, not an error. This event can be retried, and an operator may click twice.

A terminal delivery never reaches you. YUMBI Gateway checks first: a delivery already delivered, cancelled, failed or undeliverable is refused locally and no webhook is sent.

Push the terminal status anyway if you cancel out of band. If a delivery is cancelled on your side — driver no-show, your operations team pulled it — do not wait to be asked. Push delivery_status: "cancelled" to the status update endpoint. That is the only way YUMBI Gateway learns about it, and it also stops any polling still running against the delivery.

Fees are settled outside this API. If you charge for a late cancellation, that is a commercial matter between you and the brand. Nothing in the payload or the response carries a fee, and YUMBI Gateway does not surface one to the customer.


Did this page help you?