> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Cancel delivery

> Cancels an Uber Direct delivery.

`uber.cancelDelivery` cancels a delivery and returns it with `status: "canceled"`.

```ts automations/cancel-uber-delivery.automation.ts theme={null}
import { automation, markSignificant, onDashboardRun } from "automate.ax"
import { uber } from "automate.ax/uber"

export default automation("Cancel a delivery", () => {
  onDashboardRun({ title: "Cancel delivery" })
  markSignificant(
    uber.cancelDelivery({
      deliveryId: "del_abc123",
      reason: "customer_called_to_cancel",
    }),
  )
})
```

`deliveryId` is required. `reason` is one of `out_of_items`, `store_closed`, `customer_called_to_cancel`, `store_too_busy`, `courier_delayed_en_route_to_pickup`, `too_expensive`, `delivery_vehicle_too_small`, `no_courier_assigned`, or `other`. Pass `description` when the reason is `other`; you can also add it to any other reason.

Uber returns `noncancelable_delivery` when the delivery can no longer be canceled.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.