The Stripe integration works on two levels:
- For agents — payment history, subscription status, refunds and cancellations directly in the ticket view.
- For the AI chatbot — it can see a verified customer's billing state (plan, invoices, payments), send billing portal links, add VAT numbers, and request refunds or cancellations that you approve from an approvals inbox.
Connect it in Megadesk
- Go to Settings > Integrations > Stripe.
- Pick a connection tier:
- Read-only (recommended to start) — billing context for agents and the AI, no write access.
- Read + actions — additionally lets Megadesk issue refunds, cancel subscriptions, apply retention offers, add VAT numbers, and create billing portal links.
- Click Create key on Stripe. The Stripe dashboard opens with the key name and permissions pre-filled — just click Create key there.
- Copy the
rk_...key and paste it into Megadesk.
Megadesk validates the key against Stripe the moment you save it and shows a capability matrix of exactly what the key can do. If you unchecked a permission in Stripe's form, the matching Megadesk feature is disabled with a hint telling you which permission is missing.
Use the test mode toggle to connect a test-mode key first if you want to try everything risk-free.
Connected Stripe before the capability matrix existed? Click Re-check permissions once on the integration page to activate the new features.
Keep the API key secret — it is only used server-side. You can disconnect at any time, and rolling the key in the Stripe dashboard revokes Megadesk's access immediately.
Permissions per tier
The pre-filled links request these restricted-key permissions:
| Permission | Read-only | Read + actions | Used for |
|---|---|---|---|
| Customers — Read | ✓ | ✓ | Matching chat users to Stripe customers |
| Subscriptions — Read | ✓ | ✓ | Plan, MRR and renewal dates |
| Charges — Read | ✓ | ✓ | Payment history and receipts |
| Invoices — Read | ✓ | ✓ | Invoice questions and links |
| Products & Plans — Read | ✓ | ✓ | Showing plan names |
| Charges — Write | ✓ | Refunds | |
| Subscriptions — Write | ✓ | Cancellations and retention offers | |
| Customers — Write | ✓ | Adding VAT / tax IDs | |
| Customer portal — Write | ✓ | Billing portal links |
The ticket view (for agents)
When an agent opens a ticket, Megadesk fetches the customer's billing info from Stripe. The data appears in the ticket sidebar alongside the conversation.
From there, agents can:
- Refund a payment — issue a full refund on any succeeded payment intent
- Cancel a subscription — cancel immediately or at the end of the billing period, with an optional refund of the latest invoice
- View payment history — see the last payment intents and their statuses
The inbox also shows a revenue badge (plan name and monthly value) on tickets from paying customers, and you can sort the inbox by revenue — see Tickets.
The AI billing assistant
With Stripe connected you can enable, per feature, what the chatbot may do on the integration page:
- Billing context — the AI sees a verified customer's subscriptions, invoices and payments, so it can answer "what plan am I on?", "why was I charged?", or "did my payment go through?" with real data.
- Email verification — if a visitor isn't identified through Custom Data, the AI can show a verification form in the chat: the customer enters their email and a 6-digit code sent to it. Once verified, they're matched to their Stripe customer.
- Billing portal links — the AI sends a secure Stripe billing portal link where customers update card details or download invoices. Requires the customer portal to be configured in Stripe.
- VAT / tax IDs — the AI can add a VAT number to the customer's billing profile so it appears on future invoices. Off by default.
- Refunds — the AI validates the payment and files a refund request. You can auto-approve refunds up to a maximum amount (optionally only for the customer's most recent payment); everything else waits in the approvals inbox.
- Cancellations — always at the end of the billing period, never immediate. Can be auto-approved or held for review.
- Retention offers — configure a Stripe coupon and a description like "20% off for 3 months". When a customer asks to cancel, the AI presents the offer first; if they accept, the coupon is applied and the subscription stays active.
- High-value threshold — customers above a monthly revenue threshold get extra-attentive treatment, and the AI offers human escalation more readily.
Approvals inbox
AI-requested refunds and cancellations that aren't auto-approved land in Approvals. Your team gets an email, reviews the request (amount, customer, the AI's stated reason, a link to the conversation) and approves or denies it with one click. On approval the action executes and the customer is notified in the chat — and by email if there's a ticket.
Every action the AI takes, including auto-approved ones, is recorded in the approvals history for a full audit trail.
What the AI will never do
- Share billing data with, or act for, an unverified visitor. Verification means a
customerIdfrom your Custom Data endpoint or a completed email verification in the chat — an email address typed into the chat is never enough. - Cancel a subscription immediately (only at period end).
- Promise a refund before it has actually been executed.
Customer identification
Megadesk resolves the Stripe customer in three ways:
Verified (via Custom Data)
If you pass a customerId through your Custom Data endpoint, Megadesk uses it directly:
{
"userDetail": { ... },
"integrations": {
"stripe": {
"customerId": "cus_123abc"
}
}
}
This is the recommended approach — logged-in users get billing help with zero friction.
Verified (via email verification in chat)
If email verification is enabled, visitors prove ownership of their billing email with a 6-digit code. This unlocks the same AI billing features without any development work on your side.
Unverified (via email)
If neither is present, the agent ticket view falls back to looking up the Stripe customer by the ticket's email address. The data is shown in the sidebar but marked not verified — the match was made purely by email, which is not guaranteed to be unique or accurate. Agents should confirm the customer's identity before taking actions like refunds or cancellations. The AI never uses this fallback.
