Skip to content
Try Free →

How to connect Stripe to AskVault

Last updated: · 4 min read

What this integration unlocks

The Stripe integration powers two skills, both off until you enable them:

  • subscription_manager. Executes a refund, upgrade, or downgrade on a visitor's Stripe subscription — each action gated by a written policy match, a daily refund cap, and (for downgrades) an explicit policy check. It looks up the visitor's subscription internally to confirm ownership before acting; it doesn't currently expose a standalone "what plan am I on" status answer as a separate query.
  • discount_negotiator. Customer asks for a discount or shows hesitation. The bot applies a Stripe coupon within configurable bounds. Cap per visitor, cap per workspace, plus an upper-limit ceiling the model can't override.

Both skills are on the Business plan and above. Business+

Setup, step by step

The integration is OAuth-based. No API key management on your side.

  1. Open AI Agents > Skills > subscription_manager in AskVault. Click Enable.
  2. Click Connect Stripe. OAuth consent flow opens.
  3. Sign in with your Stripe account. Approve the connection.
  4. You're redirected back to AskVault. Connection shows active. AskVault automatically subscribes to the Stripe webhook events it needs (see Webhooks below) — no manual endpoint setup required.
  5. Test a refund or plan change with a known test-mode charge/subscription. The bot should confirm before executing, then return a confirmation once Stripe processes it.

Scopes requested

Stripe Connect's standard OAuth only offers two grant levels, not per-object scopes: AskVault requests read_write, which is what the refund and plan-change actions need to function. There's no separate, narrower "read-only" OAuth mode for this integration today — the safety boundary is AskVault's own layer: subscription_manager is disabled by default, gated to the Business plan, and every mutating action is checked against a written policy and a daily refund cap before it executes. Most customers should keep the skill disabled and route billing-change requests through escalate_to_human until they've configured policy bounds they're comfortable with.

How the bot resolves a customer

Stripe stores customers by email. When a visitor asks an account question, the bot needs to know which Stripe customer they are. Two patterns:

  1. Identity-verified widget. The visitor is signed in to your product. The widget passes their email via setUser({ email }) with a verified HMAC token. The bot uses that email to look up Stripe directly. Growth+
  2. Verify-by-email flow. The visitor isn't signed in. The bot asks for their email. It then sends a 6-digit code to that email. The visitor types the code back. Once verified, the bot proceeds.

The verify-by-email flow adds about 30 to 45 seconds to the conversation. It's the safer pattern for unauthenticated channels (a public website widget where you don't know who's chatting).

discount_negotiator bounds

The discount_negotiator skill applies pre-approved discount codes. Three configurable bounds keep it safe:

  • Per-visitor cap. Maximum discount any single visitor can receive. Default 15%.
  • Per-workspace cap. Aggregate discount value applied across all visitors per month. Default $5,000 USD equivalent.
  • Per-code cap. Maximum usage count per discount code. Once a code hits this, the bot stops offering it.

Configure under AI Agents > Skills > discount_negotiator > Bounds. The bounds are enforced by AskVault's policy layer; the model proposes a discount and the policy decides whether to apply it.

Webhooks (incoming events from Stripe)

You don't need to configure anything in Stripe Dashboard. When you connect, AskVault automatically registers a webhook endpoint on your Stripe account and subscribes to:

  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.paid
  • invoice.payment_failed
  • checkout.session.completed

Re-running the connect flow is idempotent — it reuses the existing endpoint instead of creating a duplicate.

Compliance

Mutating actions (refunds, plan changes) only happen through the subscription_manager skill, which is disabled by default and gated by written policy and a daily refund cap once enabled. AskVault doesn't store Stripe credentials beyond the encrypted OAuth token. PCI compliance stays with Stripe; we never see card numbers.

For audit purposes, every Stripe lookup is logged under Live Chat > [conversation] > Audit log with the customer email queried and the result returned.

Limits

  • Stripe API rate limits. 100 read operations per second in live mode, 25 in test mode. AskVault batches and caches where possible to stay well under this.
  • Lookup latency. About 200 to 400 ms per Stripe API call. The bot's response feels instant at this latency.
  • Multi-account. One Stripe account per AskVault workspace. For multi-account use, create separate workspaces.

Common pitfalls

Bot says "I couldn't find your account". The visitor's email doesn't match any Stripe customer record. They may have used a different email at signup. Bot offers to escalate to a human.

Live mode vs test mode confusion. AskVault connects to whichever mode you authorized. For staging environments, connect to Stripe test mode. Don't mix.

Subscription state shows stale. Stripe webhooks haven't fired since the change. Wait a few seconds, or force a manual lookup.

Discount code rejected. Code expired in Stripe, or per-code cap exhausted. Check Stripe Dashboard > Coupons.

FAQ

Can the bot cancel subscriptions?

The bot can downgrade or process a refund via subscription_manager on the Business plan and above, gated by a written policy match. It doesn't fully cancel a subscription outright — a "cancel" request routes to a downgrade or escalates to a human via the escalate_to_human skill. The skill is disabled by default; most customers should leave it off until policy bounds are configured.

Can the bot create refunds?

Yes, on the Business plan and above via subscription_manager, subject to a daily refund cap and a written policy match — both enforced outside the model's control. Disabled by default.

Does this work with Stripe Connect (platform accounts)?

Yes. Connect each connected account to its own AskVault workspace. The OAuth flow handles connected accounts natively.

What about Razorpay or PayPal?

Not yet as a customer-facing skill integration — Stripe is the only payment processor AskVault connects to a workspace today. For Razorpay, PayPal, or other processors, use the custom_webhook skill to call your backend that bridges to the processor.

Is there a sandbox?

Yes. Connect to Stripe test mode using your test-mode API keys during OAuth. Test customers and subscriptions don't affect production.

Was this page helpful?