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

# Create billing portal session

> Create a short-lived Stripe-hosted billing portal session.

Use `stripe.createBillingPortalSession` to create a short-lived Stripe-hosted billing portal session.

## Example

```ts automations/stripe-create-billing-portal-session.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { stripe } from "automate.ax/stripe"

export default automation("Create billing portal session", () => {
  onDashboardRun({ title: "Create billing portal session" })

  stripe.createBillingPortalSession({
    customer: "cus_123",
    returnUrl: "https://example.com/account",
  })
})
```

## Inputs

`customer` is required. Configure the portal in Stripe or pass a configuration ID. Redirect the customer to the returned URL promptly because sessions are short-lived. `idempotencyKey` is optional.

Inputs use camel case and accept compatible signals. Automate.ax converts provider fields to Stripe's wire format. Metadata keys remain unchanged.

## Output

Returns the created billing portal Session, including its URL. Output fields use camel case.
