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

> Run an automation for every event delivered by the managed Stripe webhook.

Use `stripe.onEvent` to run an automation for every event delivered by the managed Stripe webhook.

## Example

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

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

  event.transform(({ id, type }) => ({
    eventId: id,
    eventType: type,
  }))
})
```

Optional static `account` defaults to the project binding.

## Trigger data

Returns Stripe's complete Event envelope. `type` identifies the provider event and `data.object` contains the versioned Stripe resource.

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 `decimal_string` fields are lossless strings. Stripe doesn't guarantee event delivery order, so use `id`, resource IDs, and timestamps when coordinating related events.

Automate.ax provisions one managed webhook endpoint for the account. This broad trigger subscribes it to all ordinary Stripe events; semantic triggers subscribe only to their required event types.

If you connect a restricted key, grant it read access to Account and write access to Webhook Endpoints. The connection check needs Account access, and trigger deployment needs Webhook Endpoints access. See [Stripe's restricted-key guide](https://docs.stripe.com/keys#limit-access).
