> ## 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 Stripe refund failed

> Run an automation when a Stripe refund fails.

Use `stripe.onRefundFailed` to run an automation when a Stripe refund fails.

## Example

```ts automations/stripe-on-stripe-refund-failed.automation.ts theme={null}
import { automation } from "automate.ax"
import { stripe } from "automate.ax/stripe"

export default automation("On Stripe refund failed", () => {
  const event = stripe.onRefundFailed()

  event.transform(({ id, data }) => ({
    eventId: id,
    stripeObjectId: data.object.id,
  }))
})
```

Optional static `account` defaults to the project binding.

## Trigger data

Returns the complete Stripe Event envelope with `type: "refund.failed"`. The typed `data.object` contains the Stripe resource for this event.

Automate.ax verifies Stripe's signature against the exact request body before accepting an event. Event fields use camel case, while metadata keys remain unchanged. Stripe doesn't guarantee event delivery order, so use `id`, resource IDs, and timestamps when coordinating related events.

See [On Stripe event](/reference/integrations/stripe/triggers/on-stripe-event) for the shared envelope and delivery behavior.
