How to (Properly & Sustainably) Integrate Stripe & HubSpot with Your SaaS
A HiiBo Case Study
Building a SaaS product (B2C) that takes payments and needs CRM synchronization can get complicated, fast.
Mix in the fact that you want to manage tokens, subscription plans, and a user console for admins to tweak and troubleshoot, well now you’ve just whipped up a recipe for chaos.
We’re currently navigating these murky waters with HiiBo, our memory-first AI platform. I’m sharing the approach that keeps it all sane and scalable, at least as much as it can be (this shit is complicated!)
Note: We use Hubspot as our CRM and Stripe as our payment portal — not exactly cheap but highly recommended if you want a smooth user experience. That said, any reputable CRM / payment platform will have similar APIs as outlined below.
Start with a Process Diagram (DO NOT SKIP)
Before writing a single line of code, visualize your user’s entire lifecycle:
Freemium sign-up → user tries out your product, sees limited features or tokens.
Upgrade → user hits Stripe Checkout to buy a paid plan (e.g. HiiBo monthly).
Manage Billing → existing subscribers use the embedded Stripe Customer Portal if they need to update payment info or cancel their subscription.
Token Top-ups → user might need to buy extra tokens (HiiBo is selling packs of tokens for those who need more usage).
CRM Sync (HubSpot) → every step (sign-up, upgrade, cancellation) updates your marketing/sales data.
Admin Console → SuperAdmin can view user accounts, adjust tokens, disable users, etc.
At HiiBo, we mapped these out in detail with nothing left to ambiguity. That single chart helps product, development and marketing see exactly what’s going on in each scenario.
Payment Integration
First-Time Purchase: Stripe Hosted Checkout
For initial plan purchases (or token packs), we rely on Stripe’s Hosted Checkout. It’s a secure, user-friendly way to get them paying without building custom payment forms.
Docs: Stripe Hosted Checkout
Why We Like It for HiiBo:
We can quickly generate a link with the relevant price (for example, $20/month for the Alpha subscription or $10 for 10k tokens).
The user is redirected to pay in a fully hosted page using deep link integration.
On success, they return to HiiBo with a completed session ID.
We finalize the transaction in the backend — grant monthly tokens or top-ups — then show them a “Congrats on upgrading!” modal.
Implementation Details:
Create a Checkout Session (via Stripe’s API) with line items describing the subscription or one-time token pack.
Redirect the user to .
User Pays — they see Stripe’s secure page, fill in card details, complete purchase.
Stripe Webhook — on , your server finalizes the purchase, updates HiiBo DB and creates a Contact & a Deal in HubSpot.
Redirect user to your success page, e.g., .
Implementation Tip:
Use the to preserve user context (like ).
Have a dedicated Stripe Webhook for , ensuring even if the user closes their browser, you can still finalize everything.
Existing Subscribers: Stripe Customer Portal
Once a user has subscribed, they might need to update payment methods, see invoice history, or cancel their subscription (noooo). That’s where Stripe’s Customer Portal comes into play.
Note: This portal is for existing customers only. That’s why the initial purchase must be via the Hosted Checkout approach.
Docs: Stripe Customer Portal
HiiBo Approach:
In the user’s profile (if they’re on a paid plan), we have a “Billing” button that opens the Portal.
Freemium users can’t open it; they’re first directed to the Hosted Checkout to upgrade.
Implementation Tip:
Spend some time clicking through all the options in the Stripe Customer Portal builder to make sure you’ve got it set up exactly as you need to (Settings -> Billing -> Customer Portal).
Again, rely on webhooks for subscription changes or cancellations. If a user kills their subscription or if payment fails, we get a “subscription.updated” or “invoice.payment_failed.”
We use these webhooks to gently remind the user through a grace period (on payment failure) and/or move them back to a freemium account.
Keeping CRM in the Loop
HubSpot is our tool for marketing and sales tracking. It’s a great CRM, but I’ll acknowledge that there are cheaper options. Whether it’s a new HiiBo freemium sign-up or an upgrade to the monthly plan, we want that data reflected in our CRM.
Docs:
HubSpot in HiiBo:
New freemium sign-up: We create or update a Contact with the user’s email, name, plan type (“Freemium” or “Alpha”), and sign-up date.
Upgrade to monthly: We create a Deal (or update an existing one) in the “Subscriptions” Pipeline. For us, the deal name will be “HiiBo Alpha — [UserEmail],” with the Stage “Active Subscription.” You’ve got a lot of flexibility with naming here, use it.
If user cancels or is disabled, we move that deal to “Returned to Freemium”.
Implementation Tip:
Make sure you configure your Contact Properties, Deal Name, & Deal Stages
If they’re brand-new to HubSpot, create the contact. If the email already exists, update. We store the HubSpot contact ID in HiiBo’s DB for easy referencing next time.
One Place to Manage Everything
In HiiBo, our “SuperAdmin” console is where we tie it all together.
Why We Built This
View All Users: We see email, plan, last login, token balance, subscription status (paid vs. freemium).
Adjust Tokens: If a user complains about under-credited tokens or we want to give them a free boost, we do it in one place.
Account Toggle: We can disable or re-enable accounts. If we disable a paying user, we automatically revert them to the freemium plan in Stripe (and update HubSpot, too).
Internal Notes: Freed from the user’s view, so support can write “User got locked out” or “Frequent token buyer.”
Implementaoion Details:
We use standard REST endpoints to fetch and update user data.
We apply strict role-based access to ensure only SuperAdmins see these controls.
If multiple admins are working simultaneously, the system merges changes to avoid collisions.
The Glue
Stripe Webhooks are critical, and act as the glue that holds all of this integration architecture together. For events like:
→ user just bought a plan or token pack; update DB + HubSpot.
or → user unsubscribed or card failed; revert them to freemium, reflect that in HubSpot.
HubSpot can also push data changes if marketing alters deals or contact properties, but we only push from HiiBo → HubSpot, not the other way around. It keeps things simpler for our Alpha product. Eventually we will build a bi-directional sync, but it brings in a lot more edge cases to be dealt with via integration logic.
Implementation Tip:
Write robust error handling for webhooks. If the app is down, you want Stripe or HubSpot to retry later.
Log every state change in your DB. If a user says “I lost my tokens,” you can trace back to a specific webhook event or Admin console action.
Putting It All Together
HiiBo new user scenario:
User hits “Sign Up,” becomes a Freemium user. We call HubSpot Contacts API to store them as “Freemium.”
User decides “I need 20,000 monthly tokens” → hits “Upgrade.”
Backend calls with the subscription line item, user returns from Stripe Hosted Checkout.
Stripe triggers . HiiBo’s server updates that user’s plan to “Alpha,” calls HubSpot Deals to create the subscription deal.
User now sees 20,000 tokens + can access “Manage Billing” for payment method changes.
Behind the scenes, the Admin console shows them as “Alpha,” token balance 20,000, last purchase date, etc.
If they later buy an extra 10k tokens, same flow: new checkout session for the token pack. On success, tokens are allocated, log a custom event in HubSpot tied to the user’s Contact record.
Final Musings
A well-thought-out Stripe + HubSpot integration shouldn’t just “work for now” — it should last as your product grows. With HiiBo, we’re ensuring the entire pipeline from sign-up to top-ups, from internal admin management to CRM updates, is stable and robust.
Use Stripe’s Hosted Checkout for initial & top-up purchases.
Use Stripe’s Customer Portal for existing subscribers.
Sync user data & subscription statuses to HubSpot.
Build an internal Admin console to handle the tough manual fixes or quick config changes.
Rely on webhooks to keep everything aligned if a user’s actions deviate from the “ideal path.”
Docs Recap
Stripe
HubSpot
If you can get these fundamentals right, then your SaaS will have a stable, well-documented flow that your team can rely on, and that your users will trust.
Spend a bit more time setting it up carefully now, and you’ll avoid the nightmare of partial sign-ups and lost subscriptions in the future. Happy integrating!
About the Author
Sam Hilsman is the CEO of CloudFruit® & HiiBo. If you want to invest in HiiBo or oneXerp, reach out. If you’re interested, join the waitlist for HiiBo!
Co-founder of HiiBo, COO of CloudFruit
4moNo, literally because this is so helpful. It most def took us hours to get this right 😂