BookbagBookbag

Stripe

Let signed-in customers self-serve billing in chat — view subscriptions and invoices, cancel or reactivate, and update billing details. Every Stripe action is bound to the customer's verified identity.

View as Markdown

The Stripe connector turns billing questions into self-service. A signed-in customer can ask "what plan am I on?", "show my invoices", "cancel my subscription", or "update my billing email" — and the agent answers and acts using live Stripe data, scoped to that one customer.

Identity verification is required

Stripe actions are only available to a verified, signed-in customer. The agent never accepts a customer id from the conversation — it resolves the Stripe customer from the signed identity you pass with identify(). A visitor with no verified Stripe account simply can't reach billing data.

How it works

  1. 1
    Connect Stripe
    On the agent's Integrations tab, connect Stripe with a restricted secret key. It's encrypted at rest and scoped to this agent.
  2. 2
    Verify the customer
    On your site, identify the logged-in user with window.bookbag("identify", …) and include their Stripe customer id in the signed claims. This links the chat visitor to their Stripe account — tamper-proof.
  3. 3
    Add the Stripe actions
    On the agent's Actions tab, add the Stripe capabilities you want (subscriptions, invoices, manage, change billing) and describe when the agent should use each.
Linking the Stripe customer

The verified Stripe account lives on the contact as stripe_accounts — a list of { label, stripe_id, stripe_email }. It's treated as sensitive: it's never echoed to the model, only used server-side to scope Stripe calls.

Available actions

ActionWhat it does
Get subscriptionReturns the customer's subscription(s): plan, status, price, renewal date, and whether it's set to cancel.
Get invoicesLists recent invoices with amount, status, and a link to the hosted invoice / PDF.
Manage subscriptionCancels at period end or reactivates a pending cancel. State-mutating — asks the customer to confirm first.
Change billingUpdates the customer's billing email, name, phone, or address.
Ownership is enforced

Before changing a subscription, Bookbag re-checks that it belongs to the verified customer. One customer can never read or modify another's billing — even if a subscription id leaks into the conversation.

Testing

Like Chatbase, Stripe actions don't run in the Playground or action preview — they need a real, identity-verified session. Embed the widget on your site, sign in a test customer with a Stripe id in the identity claims, and try the actions there. Use a Stripe test-mode key while you develop.

What's next