> ## Documentation Index
> Fetch the complete documentation index at: https://wiredesk.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Stripe

> Connect Stripe with a restricted key, so the agent can answer a customer's billing questions about their own account.

Connecting Stripe lets an agent look up one customer's plan and invoices, cancel at the end of the paid period, and send a link to update the card on file. What it may do is set on the [Stripe billing](https://wiredesk.ai/docs/actions/stripe-billing.md) action. Connecting alone changes nothing.

## Make a restricted key

Wiredesk takes a **restricted key** (`rk_live_…` or `rk_test_…`), never your secret key. A secret key can do anything in your Stripe account; a restricted key can only do what you allow.

**1. Create the key**

In Stripe: **Developers → API keys → Create restricted key**. Name it Wiredesk.

**2. Give it exactly these permissions**

| Resource | Permission | Used for |
| - | - | - |
| **Customers** | Read | Finding the customer by email |
| **Products** | Read | Saying the plan's name |
| **Invoices** | Read | Listing invoices and their links |
| **Subscriptions** | Write | Cancelling at the end of the period |
| **Customer portal** | Write | The link to update the card |

Leave everything else at **None**. If you won't use cancelling or the card link, Subscriptions can be Read and Customer portal None.

**3. Turn on the customer portal**

For the card link: **Settings → Billing → Customer portal**, and allow customers to update payment methods.

**4. Connect**

In Wiredesk, **Agents → your agent → Actions › Connections → Stripe → Connect**, and paste the key.

Before saving, we read one customer, one subscription and one invoice with the key, so a key missing a read permission fails here with Stripe's reason. A missing **write** permission can't be checked without changing something, so it shows on the Stripe card as **Last request failed** the first time the agent tries.

The card names the connection by mode and the key's last four characters, for example **Live key ····9f2c**. Test the setup with a test-mode key and Stripe's test customers first.

## Related

* [Stripe billing action](https://wiredesk.ai/docs/actions/stripe-billing.md)
* [Verified visitors](https://wiredesk.ai/docs/widget/verified-visitors.md)
* [Integrations](https://wiredesk.ai/docs/integrations/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.