Guide
Stripe billing events
Connect your Stripe account with one restricted key: customers, checkouts, subscriptions, invoices and refunds update contacts and start journeys.
Connect each product to the Stripe account that bills its customers. HelpWell then reads every existing customer, keeps billing fields on the matching contacts (subscription status, plan, MRR, last payment) so active customers can be told from cancelled ones, and starts journeys on Stripe events: trial ending, payment failed, subscription cancelled. Nothing to code.
#Connect with one restricted key
- In HelpWell open Settings → Integrations → Stripe → Connect Stripe and choose the product.
- Click Create the key in Stripe (test mode first). Stripe's "Create restricted key" form opens with the name HelpWell journeys and these permissions already set; every other row stays None:
| Section | Resource | Access | Used for |
|---|---|---|---|
| Core resources | Customers | Read | match customers to contacts |
| Core resources | Charges and Refunds | Read | refund events |
| Core resources | Products | Read | plan names |
| Checkout resources | Checkout Sessions | Read | checkout events |
| Billing resources | Invoices | Read | payment events |
| Billing resources | Subscriptions | Read | plan, status and MRR |
| Connect resources | Accounts | Read | show which Stripe account is connected |
| Webhook resources | Webhook Endpoints | Write | create, check and remove HelpWell’s endpoint |
The direct links: test mode and live mode.
- Click Create key in Stripe and copy the key (
rk_test_…). - Paste it into Restricted key in HelpWell and click Connect.
HelpWell checks the key, creates its own webhook endpoint (https://app.helpwell.ai/webhooks/stripe/<product id>) subscribed to exactly the events below, stores the endpoint's signing secret encrypted and checks it. You never copy a signing secret. The page then shows Webhook created by HelpWell with the endpoint id, and the connection's health: the last event received, deliveries refused, and events that failed.
Manual setup stays available under "Set up the webhook yourself": create the endpoint in Stripe Workbench with the URL and events HelpWell shows, then paste the key and the endpoint's whsec_… signing secret.
#Sync every existing customer
Connecting starts a sync of everything already in Stripe, and Sync all customers now on the connection's card runs it again whenever you like. It is a background job that pages through every customer and subscription (all statuses, cancelled included), 100 at a time, and shows its progress on the card. It needs only read access: Customers and Subscriptions, which a key made for the manual setup has too. Products: Read names plans (otherwise the price's nickname, lookup key or id does), and Charges: Read adds the lifetime value; without them the sync carries on without those fields.
- Each Stripe customer is matched to a contact of the product by the Stripe customer id, the
helpwell_contact_idmetadata, or an email that matches exactly one contact (contacts you imported earlier are matched this way and keep their tags). A customer nobody matches becomes a new contact; one without an email is skipped, and so is one whose email several contacts share. - Several Stripe customers with one email are one person: their best subscription wins (active, then trialing, past due, unpaid, paused, incomplete, cancelled), "customer since" is the earliest, and what they paid adds up.
- It never changes an existing contact's email consent (an unsubscribe stays), never adds an address on the suppression list (the card counts them: "N skipped (unsubscribed/bounced)"; a contact that already exists is still updated), never starts a journey (old customers do not get a "Customer created" welcome), and never overwrites a subscription a webhook updated after it started. A contact it adds is subscribed by default, like one a webhook adds (below).
- A sync that stops (a deploy, a Stripe error, a rate limit) resumes at the page it was on. One stopped by a missing permission says which, and Resume sync carries on once the key is fixed.
Connecting also adds four segments you can edit or delete; connecting again never makes them twice:
| Segment | Who is in it |
|---|---|
| Active customers | stripe.status is active or trialing |
| Cancelled customers | stripe.status is canceled, or stripe.cancelAtPeriodEnd is true |
| Trialing | stripe.status is trialing |
| Past due | stripe.status is past_due |
Use them as a newsletter's audience (include or exclude), in journey conditions, or as a journey trigger (Entered a segment, for example "Entered Cancelled customers" for a win-back). Webhook events keep every field current after the sync.
#Send a test event
In test mode, open Stripe → Customers → Add customer, enter a name and an email address you own, and save. Within a minute Recent deliveries in HelpWell shows customer.created as processed and the person appears in Contacts. With the Stripe CLI, stripe trigger customer.subscription.created sends a subscription. In live mode, wait for a real event rather than creating customers.
#Events and journey triggers
| Stripe event | Journey trigger | Updates |
|---|---|---|
customer.created | stripe.customer.created | customer id, customer since, delinquent (status none until a subscription starts); fills a missing name or email |
customer.updated | stripe.customer.updated | customer id, customer since, delinquent (status none until a subscription starts); fills a missing name or email |
checkout.session.completed | stripe.checkout.completed | last checkout, its amount; a one-off payment adds to lifetime value |
customer.subscription.created | stripe.subscription.created | status, plan, MRR, quantity, started, cancelled at, trial and period end |
customer.subscription.updated | stripe.subscription.updated | status, plan, MRR, quantity, started, cancelled at, trial and period end |
customer.subscription.deleted | stripe.subscription.cancelled | status, plan, MRR, quantity, started, cancelled at, trial and period end |
customer.subscription.trial_will_end | stripe.subscription.trial_ending | status, plan, MRR, quantity, started, cancelled at, trial and period end |
invoice.paid | stripe.invoice.paid | last invoice status and amount, last payment or failed payment; a paid invoice adds to lifetime value |
invoice.payment_failed | stripe.invoice.payment_failed | last invoice status and amount, last payment or failed payment; a paid invoice adds to lifetime value |
charge.refunded | stripe.charge.refunded | last refund, its amount; takes the refund off lifetime value |
Each event is processed once (retries from Stripe are recognised by event id), older states never overwrite newer ones, and a journey starts once per checkout, subscription or paid invoice.
#Every subscription and product
A customer can hold several subscriptions, each with several products. HelpWell keeps every one, cancelled ones included, one row per product: its name (Products: Read; otherwise the price's nickname or id), the price's nickname, status, MRR, currency, start date, current period end, trial end, whether it cancels at the period end, when it was cancelled and any coupon. The sync backfills them and webhooks keep them current. Contacts shows them as chips in the Plan / product column ("BrandWell Pro · active", "AI Detector · cancelled") and the profile lists each one.
From them, every contact carries lists you can filter on like any field:
| Field | Holds |
|---|---|
stripe.products | products on subscriptions still running (active, trialing, past due, unpaid, paused, incomplete) |
stripe.productsActive | products on active subscriptions |
stripe.productsTrialing | products on trialing subscriptions |
stripe.productsPastDue | products on past-due subscriptions |
stripe.productsCanceled | products on cancelled subscriptions |
stripe.allProducts | every product they ever subscribed to |
stripe.productHistory | every product with its status, such as "AI Detector · cancelled" |
- Has a subscription to a product with a status:
stripe.productsCanceledincludes "AI Detector" (likewiseproductsActive,productsTrialing,productsPastDue). - Does not have an active subscription to a product:
stripe.productsActiveexcludes "AI Detector". - Past subscribers of a product:
stripe.productsCanceledincludes "AI Detector" andstripe.productsexcludes it. - A subscription to a product changed status is a journey trigger,
stripe.subscription.product_status, raised once per product whose status is new or changed, withproduct,productId,status,previousStatus,subscriptionIdandmrr. Filter it on Product and New status, for example "Product is AI Detector and New status includes canceled" for a cross-sell.
Choosing fields. The four main fields (Plan / product, Subscription status, MRR, Total revenue paid) are on as soon as Stripe is connected. See more on the connection's card lists the other fields below to tick (country, customer since, current period end, cancels at period end, trial end, last payment and its amount, currency, coupon, Stripe customer ID, delinquent, billing interval, product history…); each ticked field shows in columns, filters and the profile. Every field is synced either way.
#Fields on the contact
| Field | Label | Type |
|---|---|---|
stripe.products | Plan / product | List |
stripe.status | Subscription status | List |
stripe.mrr | MRR | Number (cents) |
stripe.lifetimeValue | Total revenue paid | Number (cents) |
stripe.productsActive | Products with an active subscription | List |
stripe.productsTrialing | Products with a trialing subscription | List |
stripe.productsPastDue | Products with a past-due subscription | List |
stripe.productsCanceled | Products with a cancelled subscription | List |
stripe.allProducts | Products ever subscribed | List |
stripe.productHistory | Product history | List |
stripe.country | Country | List |
stripe.customerSince | Customer since | Number (Unix seconds) |
stripe.currentPeriodEnd | Current period ends | Number (Unix seconds) |
stripe.cancelAtPeriodEnd | Cancels at period end | Yes or no |
stripe.trialEnd | Trial ends | Number (Unix seconds) |
stripe.lastPaymentAt | Last payment | Number (Unix seconds) |
stripe.lastPaymentAmount | Last payment amount | Number (cents) |
stripe.currency | Currency | List |
stripe.discount | Coupon or discount | Text |
stripe.customerId | Stripe customer ID | Text |
stripe.delinquent | Delinquent | Yes or no |
stripe.interval | Billing interval | List |
stripe.plan | Plan | Text |
stripe.amount | Price | Number (cents) |
stripe.quantity | Quantity | Number |
stripe.subscriptionStartedAt | Subscription started | Number (Unix seconds) |
stripe.canceledAt | Cancelled at | Number (Unix seconds) |
stripe.lastInvoiceStatus | Last invoice status | List |
stripe.lastInvoiceAmount | Last invoice amount | Number (cents) |
stripe.lastPaymentFailedAt | Last failed payment | Number (Unix seconds) |
stripe.lastCheckoutAt | Last checkout | Number (Unix seconds) |
stripe.lastCheckoutAmount | Last checkout amount | Number (cents) |
stripe.lastRefundAt | Last refund | Number (Unix seconds) |
stripe.lastRefundAmount | Last refund amount | Number (cents) |
Amounts are in the currency's smallest unit (cents) and times in Unix seconds, as Stripe sends them; the contact profile shows them as money and dates. Subscription status is Stripe's (active, trialing, past_due, unpaid, paused, incomplete, canceled, incomplete_expired) or none for a customer without a subscription, and the fields describe the person's main subscription: the best status, so an old cancelled subscription never hides a live one. MRR counts active and past-due subscriptions per month (yearly prices divided by 12); trials and cancelled subscriptions count 0, and discounts are not included. The contact profile and the inbox's contact panel show the status as a badge (Active customer, Trialing, Past due, Cancelling, Cancelled customer).
Use these fields in segments and newsletter audiences, journey If/else branches, entry conditions and goals, and in email: {{plan}}, {{subscription_status}} (active, trialing, past due, cancelled), {{customer_since}} and {{trial_ends}}, each with a fallback.
#How customers become contacts
HelpWell finds the contact by the Stripe customer id it saw before, by helpwell_contact_id in the customer's metadata, or by an email that matches exactly one contact of the product; otherwise it creates one. A guest checkout without a customer is matched by its email. Billing never changes an existing contact's email consent. A contact Stripe creates (a webhook or the sync) is recorded as subscribed, with the statement "Paying customer in Stripe" and the time: this is on by default, and an owner or admin can turn it off or change the statement by asking an AI assistant connected to HelpWell (Settings → Integrations → AI assistants) to update the marketing consent settings. An address on the suppression list (unsubscribed, bounced or complained) never becomes a contact. A contact a webhook creates also raises the journey trigger Contact created (source: Stripe customers); the sync of existing customers starts no journey.
To be certain a Stripe customer joins the right person, set the customer's metadata when you create it in your app:
await stripe.customers.create({
email: user.email,
metadata: { helpwell_contact_id: contactIdFromHelpWell },
});
#Disconnect
Disconnect stops the connection and deletes the webhook endpoint HelpWell created. If Stripe cannot delete it (for example, the key was revoked first), HelpWell links to it so you can delete it in Workbench. An endpoint you made by hand is yours to delete. Then revoke the key in Stripe → Developers → API keys.
See also Custom fields and Webhooks from HelpWell.