# Stripe

> Let your AI agent answer billing questions and manage subscriptions in Stripe for verified customers.

The Stripe integration lets your AI agent read a customer's own subscriptions and invoices from your Stripe account and, if you allow it, change them: switch plans, change quantity, cancel or undo a cancellation, update billing details, and send a secure link to update the card. It only ever works on the account of a customer it has verified.

<Callout type="info">

**Availability** — Stripe isn't available for workspaces in Indonesia.

</Callout>

It has two parts, managed in different places:

- **The connection** — a restricted Stripe key, connected once per workspace at [app.asks.app/integrations/stripe](https://app.asks.app/integrations/stripe). Connecting turns nothing on by itself.
- **Stripe actions** — what the AI agent may do, in the **Stripe** section of [app.asks.app/ai-agent/actions](https://app.asks.app/ai-agent/actions). Each action has its own instructions, rules and channels.

<Callout type="info">

**Plans and roles** — Stripe actions are part of every paid plan, with the same allowance as [custom actions](/ai-agent/actions) (5 on Starter, 15 on Business, 50 on Premium), counted separately. The Free plan doesn't include them. Only workspace owners and admins can connect Stripe or change Stripe actions.

</Callout>

## Connect Stripe

<Steps>

<Step title="Choose the actions you plan to use">

Go to **Integrations → Stripe**. Tick the actions you plan to turn on. The list of permissions below updates to exactly what those actions need.

<Frame src="/images/ai-agent/stripe-connection.png" alt="Integrations → Stripe before connecting: the Connect your Stripe account card with all four actions ticked under 1. Choose the actions you plan to use, the permissions the key needs under 2. Create a restricted key in Stripe with these permissions, and the Create a test-mode key and Create a live key buttons" caption="Integrations → Stripe. The permission list follows the actions you tick." />

</Step>

<Step title="Create a restricted key in Stripe">

Select **Create a test-mode key** or **Create a live key**. Stripe opens with those permissions already selected and everything else set to None. If Stripe first asks how you'll use the key, choose **Providing this key to a third-party application** and check that the permissions still match the list. Name the key, select **Create key**, and copy it.

</Step>

<Step title="Paste the key">

Paste the key (it starts with `rk_test_` or `rk_live_`) and select **Connect Stripe**. Asks checks what the key can do and shows the account, the mode and each action's permissions.

<Frame src="/images/ai-agent/stripe-connected.png" alt="Integrations → Stripe once connected: the Stripe account card marked Test mode and Connected with the account ID, the masked restricted key and the connection date, Check permissions again, Replace key and Disconnect; the Permissions card with all four actions Ready; and the Stripe actions card with 4 actions, 4 enabled" caption="A connected test-mode key with every action ready." />

</Step>

<Step title="Add Stripe actions">

Select **Set up Stripe actions** (or go to **AI Agent → Custom Actions** and select **Add Stripe action**), pick an action, and configure it as described below.

</Step>

</Steps>

Asks refuses secret keys (`sk_…`) and publishable keys (`pk_…`). The key is stored encrypted and never shown again; the page shows only its last four characters. A test-mode key works with your Stripe test data, so you can try everything before you connect a live key.

## The actions

<Frame src="/images/ai-agent/stripe-actions.png" alt="AI Agent → Custom Actions with the Stripe section at the top: Manage subscription and Change billing info marked Changes billing, Get subscription info and Get invoice history, each with its enable switch, recent calls, edit and delete buttons, its When to use text and its tool name" caption="AI Agent → Custom Actions. Actions that change billing are marked." />

| Action | What the agent can do |
| --- | --- |
| **Get subscription information** | Plan, status, price, renewal or cancellation date, trial end, and the card on file. |
| **Get invoice history** | Recent invoices with amount, status and date, and links to the invoice page and PDF. |
| **Manage subscriptions** | Switch plans, change quantity, cancel or undo a scheduled cancellation, and share a secure link to add or update the card. |
| **Change billing information** | Update the billing email, phone number, name or address. |

## Configure an action

<Params>

<Param name="Action name" type="string" required>What the action is called in your dashboard. The tool name the AI sees is derived from it.</Param>

<Param name="When to use" type="string" required>Tells the agent which requests this action is for. A sensible default is filled in; **Reset** restores it.</Param>

<Param name="Subscriptions" type="Manage subscriptions">**Customers can switch plans** and **Customers can change the quantity of their plan**, each on or off. **Products customers can choose**: customers can switch to the active recurring prices of these products, with an optional minimum and maximum quantity per product. **Prorate subscription updates** credits the time left in the billing period; choose **Invoice immediately** or **Issue invoice at the end of the billing period**.</Param>

<Param name="Cancellation" type="Manage subscriptions">**Customers can cancel**, then **Cancel at period end** (the subscription stays active until the end of the period it was paid for) or **Cancel immediately** (access ends right away and can't be undone; optionally credit the unused time to the customer's balance). **Customers can undo a scheduled cancellation** lets the subscription continue as if it was never canceled.</Param>

<Param name="Payment method" type="Manage subscriptions">**Customers can add or update their card.** The agent shares a secure Stripe page that expires after an hour; card details are never typed in the chat.</Param>

<Param name="Billing details" type="Change billing information">Which of billing address, billing email, phone number and name on the account customers can update.</Param>

<Param name="Invoices shown" type="number">How many recent invoices the agent can look at, up to 24.</Param>

<Param name="Channels" type="all | some">By default the action works on every channel where the customer can verify. Choose **Only on some channels** to limit it.</Param>

</Params>

<Frame src="/images/ai-agent/stripe-action-editor.png" alt="Edit Stripe action for Manage subscription: the General card with the Enabled switch, the Action name and the derived tool name manage_subscription, the When to use instructions, and the Subscriptions card with plan switching and quantity changes on and the Ritual Club product listed under Products customers can choose" caption="AI Agent → Custom Actions → a Stripe action." />

<Frame src="/images/ai-agent/stripe-action-cancellation.png" alt="Further down the same editor: Prorate subscription updates on with Invoice immediately selected, and the Cancellation card with Customers can cancel on, Cancel at period end selected, and Customers can undo a scheduled cancellation on" caption="Proration and cancellation rules for Manage subscriptions." />

New actions start **disabled**. Select **Save & enable**, or turn the action on later from the Actions page.

## Who the agent helps

Billing data is only for the verified account holder. The agent shares or changes nothing until one of these is true:

- **Signed in on your site.** The customer chats in the widget with a [verified login](/channels/widget#identity-verification) whose user ID is their Stripe customer ID, or matches the `asks_user_id` metadata on their Stripe customer.
- **Confirmed their billing email.** The customer gives the email on their Stripe account and replies with the six-digit code Asks emails to it. The confirmation lasts 30 minutes in that conversation.

A typed email alone never shows anything. When one email belongs to more than one Stripe customer, the agent asks which account by its name, never by an ID. Stripe IDs are never shown to the customer or the AI.

## What the agent does

- Answers from live Stripe data, and says plainly when a subscription won't renew, when it ends, or when a payment failed.
- Before any change, shows what changes and what the customer pays or is credited, from Stripe's own invoice preview. It makes the change only after the customer confirms in a new message, and each change is made once, even if the customer confirms twice.
- If the payment for a plan change is declined, nothing changes and the agent offers the card update link.
- Adds a note to the conversation for every change it makes, such as a plan switch or a scheduled cancellation, so your team can see it.
- Refunds aren't part of the integration. The agent hands those requests to your team.

<Callout type="tip">

**Verify it works** — in the [Playground](/ai-agent/testing), test as a customer with a verified login and turn on **Signed in**, then ask "When does my plan renew?". Lookups are real; changes are simulated, so nothing changes in Stripe. The Playground never sends an email code.

</Callout>

## In the inbox

When Stripe is connected, the customer panel has a **Billing** section: the customer's Stripe subscriptions and recent invoices, with **Open in Stripe**. It matches the customer by their verified login, or by their email address, marked "Matched by email address — the customer may not have verified it". A test-mode key shows a **Stripe test mode** badge.

<Frame src="/images/ai-agent/stripe-inbox-billing.png" alt="Inbox conversation in the Chat widget where the AI agent tells Mia Torres her plan, next payment date and card; the customer panel's Billing section shows the Stripe test mode badge and Mia Torres with Ritual Club Plus — Monthly ($49.00 / month), active, renews 15 December 2026, two paid invoices and Open in Stripe" caption="The Billing section next to a conversation the agent answered from Stripe." />

## Disconnecting and reconnecting

**Disconnect** makes Asks forget the key. Your Stripe actions are kept but paused until you connect again. Delete or roll the key in Stripe as well.

If Stripe stops accepting the key (it was rolled, deleted or expired), the integration shows **Needs reconnect** and the agent can't read or change billing until you connect a new restricted key. If you edit the key's permissions in Stripe, select **Check permissions again**. Connecting a key for a different Stripe account flags each **Manage subscriptions** action: open it, check its products and save, so customers are offered plans from the new account.

## Activity

Each action's **Recent calls** shows its last 20 Stripe calls, such as "Subscriptions read", "Cancellation previewed" or "Plan switched", with status and timing. Card details are never logged.

## Related

- [Custom actions](/ai-agent/actions) — call your own APIs.
- [Identity verification](/channels/widget#identity-verification) — sign customers in to the widget.
- [Playground](/ai-agent/testing) — test as a signed-in customer.
