> ## 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.

# On refund requested

> Starts an automation when a refund is requested for an Uber Direct delivery.

`uber.onRefundRequested` takes no filters. It starts when a refund is requested for one of your deliveries.

```ts automations/review-uber-refund.automation.ts theme={null}
import { automation, sendEmail, t } from "automate.ax"
import { uber } from "automate.ax/uber"

export default automation("Review a refund", () => {
  const refund = uber.onRefundRequested({})
  sendEmail({
    to: "*",
    subject: t`Refund requested for ${refund.deliveryId}`,
    text: t`You owe customers ${refund.refund.totalPartnerRefund} cents. Uber adjusts your invoice by ${refund.refund.totalUberRefund} cents.`,
  })
})
```

The event includes `id`, `deliveryId`, `customerId`, `externalId`, `externalStoreId`, `liveMode`, `created`, and `refund`. In `refund`, `totalPartnerRefund` is what you owe your customer and `totalUberRefund` is what Uber adjusts on your invoice, both in cents. Each `refundOrderItems` entry has a `reason` such as `UBER_DAMAGED_ITEM` or `PARTNER_MISSING_ITEMS`, the `partyAtFault`, and the refunded items.

Requires an Uber Direct connection with a webhook signing key and a dashboard webhook that sends `event.refund_request`. See [Connect Uber Direct](https://docs.automate.ax/reference/integrations/uber/index.md#connect-uber-direct).


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