answerLoopsanswerLoopsDocs

Stripe

How answerLoops connects billing to Stripe.

Your billing

answerLoops

What it unlocks

Your billing page reflects the subscription state Stripe reported
Your workspace. On the hosted service, every new account gets a 14-day free trial with no card. When it ends, you pick a plan and pay through Stripe Checkout. The card is charged when you confirm.

answerLoops uses Stripe Checkout for hosted-plan subscriptions. Stripe handles payment details, invoices, and the customer portal; the application stores the subscription state needed to grant access. The free trial is not a Stripe trial: it runs inside answerLoops, needs no card, and never touches Stripe.

The free trial

Accepting the terms on a new hosted account starts one 14-day trial with every feature included. The trial is a subscription record with the trialing status and no Stripe subscription behind it, so it ends on its own date: once that passes, the record reads as trial_expired, access stops, and the person is sent to checkout to subscribe. Checkout then charges the card immediately; Stripe sessions carry no trial period.

A trial is limited to one per person. Each trial is written to a ledger (trial_claims) keyed by a hash of the normalized email (case, +tag and Gmail dots folded, so the ledger never holds an address) and by the sign-in provider's own account id, each with a unique constraint, so the database refuses a second claim. The ledger is not removed when a workspace or account is deleted. Sign-in is refused for an email the provider has not verified. Included AI usage still applies during the trial. Three days and one day before the trial ends, a background sweep on the bot service emails the workspace owner a link straight to checkout, and the dashboard shows a banner for the last three days. Each email is recorded on the subscription so it is sent at most once.

Customer lifecycle

Signing in with Google creates an answerLoops user and workspace, but it does not create a Stripe Customer. Opening or abandoning Checkout also does not count as becoming a customer. A Stripe Customer is attached to the workspace when Stripe sends the successful checkout.session.completed webhook, at the same time the subscription is recorded as active. The welcome email is sent when the free trial starts.

When an existing subscriber changes plans, answerLoops reuses that workspace's Stripe Customer so the billing history stays together.

Webhook setup

For a cloud deployment, configure Stripe to send these events to /api/billing/webhook:

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

Set STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET in the deployment environment. The webhook is the source of truth for the local subscription record, so access can take a short moment to appear after Checkout redirects back to answerLoops.

On this page