# Stripe (/docs/integrations/stripe)

> Connect Stripe with a restricted API key (use test mode while building) so the agent can look up customers, invoices and charges, and optionally cancel a subscription.

Type: how-to | Status: beta | Last reviewed: 2026-11-21 | Minimum role: builder

Connect Stripe so the agent can look up a customer's invoices and charges and, if you allow it, cancel a subscription.

<Screenshot src="/media/integrations/stripe-connect.png" alt="The Stripe connect page" caption="Connect Stripe" captured="2026-11-02" />

## How do I connect Stripe to my AI agent? [#how-do-i-connect-stripe-to-my-ai-agent]

In Integrations, add Stripe and paste a restricted API key, using test mode while you build. Enable the lookups you want for customers, invoices and charges. Turn on Cancel subscription only if the agent should do it. Every Stripe capability needs a verified customer by default.

## What the agent can do [#what-the-agent-can-do]

| Capability | Type | Default minimum trust | Confirmation |
|---|---|---|---|
| **Lookup customer** | Source | Verified | No |
| **Search customers** | Source | Verified | No |
| **Lookup invoice** | Source | Verified | No |
| **Search invoices** | Source | Verified | No |
| **List charges** | Source | Verified | No |
| **Cancel subscription** | Action | Verified | Yes (now or at period end) |

All need a verified customer by default, and results are limited to that customer.

## Connect [#connect]

Stripe connects with a restricted API key (there is no sign-in option).

1. **Integrations → Add integration → Stripe**. The page is headed **Connect Stripe**: "Paste a restricted API key. Prefer test mode for Try and Approve."
2. Optionally set a **Display name**, for example "Stripe test account".
3. Paste the **Restricted API key**. Loopwix detects test or live mode from the key's prefix.
4. In Stripe, create the key with **Customers** and **Invoices** read access; charges need read access too. Add **Subscriptions** write only if the agent may cancel subscriptions.
5. Select **Test connection**, then **Verify capabilities**.

If Stripe says the key is missing a permission, Loopwix shows "Stripe denied this request. Your restricted key may be missing the required permission." Add it in Stripe and test again.

## Safety [#safety]

- Use **test mode** until you are confident.
- Give the key the minimum permissions. For read-only support, grant read access only and leave **Cancel subscription** off.
- Keep trust at **Verified** so customers see only their own data; see [Security and verification](/docs/security).
- Do not paste a full secret key if a restricted key will do.

## What customers can ask [#what-customers-can-ask]

After they verify their email, customers can ask about their own billing:

- "When is my next invoice due?" or "Can you send my last invoice?" The agent finds their invoices.
- "Was I charged twice?" The agent lists their recent charges.
- "Cancel my subscription." With **Cancel subscription** on, the agent asks them to confirm first. It cancels at the end of the billing period unless the customer asks for an immediate cancellation.

A short example:

> **Customer:** I think I was charged twice this month.
>
> **Agent:** I need you to verify your identity before I can help with that.
>
> *The customer verifies their email with a code.*
>
> **Agent:** I can see one charge of 29.00 EUR on 1 March, and no second charge. Would you like me to pass this to the team to check further?

## Limits and status [#limits-and-status]

- Stripe is in beta.
- The agent cannot issue refunds through Stripe; there is no refund capability. Route refund requests to your team with [Refunds with human approval](/docs/guides/refund-requests-with-approval).
- Results are limited to the Stripe customer that matches the verified email.
- The agent cannot change prices, plans or payment methods.

Stripe explains restricted keys and their permissions in its [API keys guide](https://docs.stripe.com/keys).

### Should I use a secret key or a restricted key?

A restricted key. Give it read access to customers, invoices and charges, and write access to subscriptions only if the agent may cancel them.

### Can the agent refund a payment?

No. Stripe refunds are not a capability today. The agent can record a refund request for a person to approve.

### Can I test without real customers?

Yes. Paste a test mode key. Loopwix detects test mode from the key, and you can test with Stripe's test customers.

[Enable and attach](/docs/integrations/connect-and-attach) when ready. Problems: [Troubleshooting](/docs/integrations/troubleshooting).

---

Used for: [Billing questions](https://loopwix.com/use-cases/billing-questions)
