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

# Stripe

> Connect Stripe to let Decimal's AI agent verify customers, look up payments, and issue refunds during support ticket resolution.

The Stripe integration lets Decimal's AI agent investigate payment-related tickets — verifying the customer, finding the exact payment, and issuing a refund against it.

## What It Does

* **Verifies the customer** by matching the ticket's email to a Stripe customer before touching any payment
* **Looks up payments** to identify the specific charge a ticket is about, by amount, currency, and date
* **Issues refunds** against the matched charge, either recommended for human approval or automatically within configured caps
* **Investigates billing context** for disputes, duplicate charges, and cancellations that imply a refund

## Permissions Decimal Requests

Decimal connects with a Stripe **restricted key**. When you create the key, grant exactly these permissions and nothing more:

| Permission              | Access         | Why Decimal needs it                                                                                                                         |
| ----------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **Charges and Refunds** | Read and write | Refunds are created against the original charge — write access here is what lets the agent issue refunds and is required to enable Live mode |
| **Customers**           | Read only      | Match the ticket's customer to a Stripe customer by email before any payment is read or refunded                                             |
| **Payment Intents**     | Read only      | Find the customer's payments and resolve the exact charge to refund                                                                          |
| **Billing**             | Read only      | Read the invoices and subscriptions behind a charge to understand recurring-billing, dispute, and cancellation tickets                       |

<img src="https://mintcdn.com/decimalai/hGTTj_URNVOZpwp8/images/stripe-restricted-key-permissions.png?fit=max&auto=format&n=hGTTj_URNVOZpwp8&q=85&s=5c5ae61b5908eece5bd29d4a7ee0cf9b" alt="Stripe restricted key permissions" lightAlt="Stripe restricted key permissions" darkAlt="Stripe restricted key permissions" className="dark:hidden" width="591" height="304" data-path="images/stripe-restricted-key-permissions.png" />

<img src="https://mintcdn.com/decimalai/hGTTj_URNVOZpwp8/images/stripe-restricted-key-permissions-1.png?fit=max&auto=format&n=hGTTj_URNVOZpwp8&q=85&s=957f0b4506bab8cb1896be26263cf63b" alt="Stripe restricted key permissions" lightAlt="Stripe restricted key permissions" darkAlt="Stripe restricted key permissions" className="hidden dark:block" width="591" height="304" data-path="images/stripe-restricted-key-permissions-1.png" />

<Tip>
  Decimal only accepts restricted keys (`rk_…`). Secret keys (`sk_…`) are rejected — a restricted key keeps access scoped to exactly the permissions above.
</Tip>

## Connecting Stripe

1. **Create a restricted key**: In your [Stripe Dashboard](https://dashboard.stripe.com/apikeys/create), create a restricted key with the permissions listed above.
2. **Navigate to Integrations**: Go to **Settings** in the sidebar, then select the **Integrations** tab.
3. **Click Stripe**: Click on the Stripe integration row to open the configuration modal.
4. **Paste your restricted key**: Enter the `rk_…` key and click **Connect**.
   <img src="https://mintcdn.com/decimalai/hGTTj_URNVOZpwp8/images/stripe-connect-modal-1.png?fit=max&auto=format&n=hGTTj_URNVOZpwp8&q=85&s=661827f5c246f45b043b065ea407b576" alt="Connect Stripe modal" lightAlt="Connect Stripe modal" darkAlt="Connect Stripe modal" className="dark:hidden" width="948" height="921" data-path="images/stripe-connect-modal-1.png" />
   <img src="https://mintcdn.com/decimalai/hGTTj_URNVOZpwp8/images/stripe-connect-modal-2.png?fit=max&auto=format&n=hGTTj_URNVOZpwp8&q=85&s=05475cf18756a37525646c2d43b0e830" alt="Connect Stripe modal" lightAlt="Connect Stripe modal" darkAlt="Connect Stripe modal" className="hidden dark:block" width="948" height="921" data-path="images/stripe-connect-modal-2.png" />
5. **Test permissions**: Once connected, use **Test permissions** to confirm the key has the access the agent needs. The badges show which scopes are present and whether the key is refund-capable.
   <img src="https://mintcdn.com/decimalai/hGTTj_URNVOZpwp8/images/stripe-connection-status.png?fit=max&auto=format&n=hGTTj_URNVOZpwp8&q=85&s=0b8a3ef1d1d27fff8a2dde9cef8465e9" alt="Stripe connection status" lightAlt="Stripe connection status" darkAlt="Stripe connection status" className="dark:hidden" width="920" height="1242" data-path="images/stripe-connection-status.png" />
   <img src="https://mintcdn.com/decimalai/hGTTj_URNVOZpwp8/images/stripe-connection-status-1.png?fit=max&auto=format&n=hGTTj_URNVOZpwp8&q=85&s=b7444df7cc2c8c416a78d189f3658418" alt="Stripe connection status" lightAlt="Stripe connection status" darkAlt="Stripe connection status" className="hidden dark:block" width="920" height="1242" data-path="images/stripe-connection-status-1.png" />

*The connected mode (Test or Live) is detected from the key. A live-mode key (`rk_live_…`) is required to refund real payments.*

## Refund Modes

Refund behavior is configured per agent under **Refund Controls** in the support agent settings.

* **Shadow mode** (default): the agent records a refund recommendation on the ticket for an operator to approve. Nothing is charged back until a human approves it.
* **Live mode**: the agent issues refunds directly, within the caps you set:
  * **Maximum amount per refund** — the most the agent can refund on a single payment without operator approval
  * **Maximum refunds per day** — after this many refunds in a calendar day, the agent stops issuing them automatically

<img src="https://mintcdn.com/decimalai/hGTTj_URNVOZpwp8/images/stripe-refund-controls.png?fit=max&auto=format&n=hGTTj_URNVOZpwp8&q=85&s=455e99ed0f6a151de34d29b32f6dcbc3" alt="Refund controls" lightAlt="Refund controls" darkAlt="Refund controls" className="dark:hidden" width="1778" height="766" data-path="images/stripe-refund-controls.png" />

<img src="https://mintcdn.com/decimalai/hGTTj_URNVOZpwp8/images/stripe-refund-controls-1.png?fit=max&auto=format&n=hGTTj_URNVOZpwp8&q=85&s=0ed1ee7a6f19c42a8ccffaae165752b5" alt="Refund controls" lightAlt="Refund controls" darkAlt="Refund controls" className="hidden dark:block" width="1778" height="766" data-path="images/stripe-refund-controls-1.png" />

<Note>
  Live mode is only available when the connected key has **Charges and Refunds: write**. A lookup-only key keeps the agent in Shadow mode.
</Note>

## Approving a Refund

In Shadow mode, a recommended refund appears on the ticket for review. An operator confirms the amount and approves it, and Decimal issues the refund through Stripe. The agent always tells the customer their refund is **under review** — never that it has already been processed — until a human approves it.

<img src="https://mintcdn.com/decimalai/hGTTj_URNVOZpwp8/images/stripe-refund-approval.png?fit=max&auto=format&n=hGTTj_URNVOZpwp8&q=85&s=4f14bb8fa924f00cb2b38b888425f3ba" alt="Approve refund on a ticket" lightAlt="Approve refund on a ticket" darkAlt="Approve refund on a ticket" className="dark:hidden" width="994" height="724" data-path="images/stripe-refund-approval.png" />

<img src="https://mintcdn.com/decimalai/hGTTj_URNVOZpwp8/images/stripe-refund-approval-1.png?fit=max&auto=format&n=hGTTj_URNVOZpwp8&q=85&s=bd1de1290f18d1d0235be71596c67566" alt="Approve refund on a ticket" lightAlt="Approve refund on a ticket" darkAlt="Approve refund on a ticket" className="hidden dark:block" width="994" height="724" data-path="images/stripe-refund-approval-1.png" />
