> ## 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 Checkout Session completed

> Run an automation when a Stripe Checkout Session completes.

Use `stripe.onCheckoutSessionCompleted` to run an automation when a Stripe Checkout Session completes.

## Example

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

export default automation("On Stripe Checkout Session completed", () => {
  const event = stripe.onCheckoutSessionCompleted()

  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: "checkout.session.completed"`. 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.

For delayed payment methods, completion can arrive with `data.object.paymentStatus: "unpaid"`. Wait for [On Stripe Checkout delayed payment succeeded](/reference/integrations/stripe/triggers/on-stripe-checkout-session-async-payment-succeeded) before fulfillment. Use [On Stripe Checkout delayed payment failed](/reference/integrations/stripe/triggers/on-stripe-checkout-session-async-payment-failed) to handle a later failure.

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