A working checkout is only the start of a Stripe integration. Tax treatment, proration, failed payments and webhooks each need an explicit decision, and several are hard to change once customers are billed. This guide gives a recommended default for each one, for a B2B SaaS, from account creation to your first live subscription.
Before you start
Access to a Stripe sandbox and permission to configure billing.
Your plans, billing intervals, supported currencies and access policy.
A server-side integration owner and tax advice for your markets.
Scope
Foundations for a B2B subscription SaaS, from account activation to your first live subscription. Reading time excludes implementation and testing. This is not tax or legal advice, and not a complete production integration.
Step 1
Create a Stripe account and complete activation
Go to dashboard.stripe.com and sign up with your business email. Complete the requested business, ownership, bank and tax information. You can build and test in a sandbox straight away; accepting real payments requires Stripe to approve your account, and verification time depends on your business and the information requested.
Tip
Use a dedicated email alias like billing@yourcompany.com — Stripe sends critical notifications (disputes, failed payouts) and you don't want them lost in personal inboxes.
Step 2
Configure your products and prices
In Stripe, a Product is what you sell (e.g. 'FlowMRR Starter') and a Price is one way to pay for it: an amount, a currency and a billing interval (e.g. $29 per month or $299 per year in USD, or €29 per month in EUR). Create one Product per plan and one Price per interval and currency. A Price belongs to a single Product, and its amount, currency and interval can never be changed after creation, whether or not it has been used: to charge a different amount, create a new Price and migrate subscriptions to it.
Our recommendation: give every Price a lookup_key such as starter_monthly_usd, and have your server look prices up by key instead of hard-coding price IDs. When you change a price, create the new Price with transfer_lookup_key so the key moves to it, and your code picks it up without a deploy.
Watch out
A Price that has been used can't be deleted. Archive it instead: it can no longer be used for new purchases, and existing subscriptions keep referencing it.
Step 3
Pick the right tax behaviour
Our recommendation: exclusive prices (tax added on top) for a B2B SaaS, because business buyers compare prices before tax. Choose inclusive instead if you sell mainly to consumers or in markets where displayed prices must include tax. Decide before you create prices: once a Price's tax_behavior is set to inclusive or exclusive, it can't be changed, so switching later means new Prices and a migration. Stripe Tax then calculates tax on supported transactions from your product tax codes, the customer's location and your registrations. It only calculates tax where you have added a registration, and it doesn't register your business with tax authorities.
Tip
Set a default tax behavior in your Stripe Tax settings so every new Price inherits it, instead of choosing price by price.
Step 4
Create your first subscription
Our recommendation: Stripe Checkout in subscription mode (mode: 'subscription'), a Stripe-hosted page that handles payment methods, 3D Secure and, with Stripe Tax enabled, tax calculation. Choose Elements instead if the payment form must be embedded in your own page. Either way, create the Checkout Session or subscription on your server.
Four rules keep billing and accounts in sync:
Create or reuse a Stripe Customer: create it once per account, then pass its ID as customer on every Checkout Session, so one account never ends up with several Stripe customers.
Link both records: store the Stripe customer ID on your account record, and your own account ID in the Customer's metadata and the session's client_reference_id.
Send an Idempotency-Key with every create request, and reuse the same key when you retry it, so a network retry never creates a second customer or subscription.
Grant access only from webhooks: provision on checkout.session.completed and extend access on invoice.paid. The success redirect only shows a confirmation page; the customer can close the tab before it loads, and anyone can open that URL.
Watch out
Never trust a price ID, customer ID or amount sent by the browser. Map the plan the user picked to a lookup_key on your server, and take the customer ID from the authenticated account.
Step 5
Choose your proration policy
Preview the invoice before changing a subscription, then set proration_behavior on the update:
Our recommendation: for upgrades, use always_invoice with payment_behavior: pending_if_incomplete. The subscription only changes once the payment succeeds, so a customer never gets a higher plan that wasn't paid for; if payment fails, the change stays pending and expires within 23 hours. For downgrades, use create_prorations, or none if your terms say the lower price starts at renewal.
create_prorations (default): creates proration items that are usually billed on the next invoice; Stripe invoices them immediately only in specific cases.
always_invoice: invoices the prorations immediately and attempts payment.
none: no proration; the customer pays the full new price from the next invoice.
Step 6
Configure Smart Retries and understand automatic card updates
In Billing → Revenue recovery → Retries, keep Smart Retries on. For new accounts, Stripe's default is up to 8 tries within 2 weeks, and you can change it. Hard declines require a new payment method: for codes like lost_card or stolen_card, Stripe keeps scheduling retries, and the invoice's attempt_count keeps rising, but no charge is actually made until the customer adds a new card. Automatic card updates are enabled by default for saved cards when the issuer supplies new details, but you can't predict which cards will receive them.
On the same page, decide what happens after the last retry fails:
Cancel the subscription: it ends; a returning customer subscribes again.
Mark it as unpaid: it stays in place but stops attempting payment; paying the latest invoice reactivates it.
Leave it past_due: it keeps generating invoices and charging according to your retry settings, and the customer keeps access unless your app removes it.
Our recommendation: mark the subscription as unpaid and revoke access. The customer can reactivate by paying the latest invoice instead of signing up again. Cancel instead if you want a clean end and send returning customers through Checkout. Leave it past_due only if your team chases payment manually.
Tip
In Revenue recovery → Emails, turn on Send emails when card payments fail and Send emails about expiring cards. Stripe's emails link to a page where the customer can update their card.
Step 7
Set up the customer portal
Configure the Stripe customer portal to allow the payment-method, invoice, plan and cancellation actions your business supports. For app access, authenticate the user, check ownership of the Stripe customer on the server, then create a fresh portal session. Do not accept a customer ID supplied by the browser as proof of ownership.
Our recommendation: allow payment-method updates, invoice history and cancellation at the end of the billing period. Turn on plan switching only once the proration rules from step 5 are in place.
Watch out
Portal sessions expire after 5 minutes if unused, or within 1 hour of the latest activity once used. Do not put a generated session URL in an email expecting it to remain valid. Link to your authenticated billing route, or use Stripe's reusable portal login link with Stripe email authentication.
Step 8
Configure webhooks
In Stripe Workbench → Webhooks → Create event destination, register your server URL and choose snapshot event payloads if your integration reads event.data.object.
Our recommendation is to start with these events:
checkout.session.completed: a customer finished Checkout; link the subscription to the account and provision access.
customer.subscription.created, customer.subscription.updated and customer.subscription.deleted: plan, quantity, status and cancellation changes; revoke access on deletion.
invoice.paid: a payment succeeded; extend access for the new period.
invoice.payment_failed: a payment failed; flag the account and tell the customer.
invoice.payment_action_required: the customer must authenticate the payment (3D Secure, common in the EU under SCA); send them to complete it.
customer.subscription.trial_will_end: sent 3 days before a trial ends; check that a payment method is on file.
customer.updated: billing details or the default payment method changed.
Verify the signature and durably accept each event, then return a 2xx quickly and do the business processing asynchronously, for example from a queue. Slow handlers time out and Stripe retries the delivery; the webhook guide covers processing and retries.
Use Stripe test clocks: create a clock, then a customer attached to that clock BEFORE creating the subscription. Start with 4242 4242 4242 4242 for a successful payment. Attach 4000 0000 0000 0341, which attaches successfully but fails subsequent charges, and set it as the default payment method used by the subscription before advancing to renewal. Wait for the clock to be ready and inspect invoice events before advancing again. For 3D Secure, pay in Checkout with 4000 0025 0000 3155, which asks for authentication; to trigger invoice.payment_action_required on a renewal, use 4000 0027 6000 3184, which requires authentication on every charge. Test an upgrade, cancellation, the after-last-retry outcome and recovery too. Everything here runs in test mode, so you never need to pay with a real card, including your own.
localhost:4242/webhook is a placeholder: replace it with your own webhook route. Run stripe listen in its own terminal and use the whsec_ signing secret it prints for local verification, then run the triggers in a second terminal. Use an authenticated Stripe CLI in a sandbox, never --live or live credentials. Triggers create test objects and can emit additional events; they don't test your actual subscription renewal or replace test clocks.
Live mode is separate from your sandbox: objects and most configuration don't carry over, so go through this list before you take your first real payment.
Live API keys: store the live secret key (or a restricted key) as a server secret, and make sure no test key reaches production.
A new live webhook endpoint: create it in live mode with the same events; it has its own signing secret, so update that secret in production.
Live products and prices: use Copy to live mode on each product, or recreate them. Live prices get new IDs, so check that each one has the right lookup_key.
Live settings: review the customer portal, retries, customer emails and Stripe Tax (including your tax registrations) in live mode; don't assume sandbox settings carried over.
Optional real transaction: buy your cheapest plan with a real card, confirm that access, webhook processing and the invoice are correct, then refund it and cancel the subscription. Stripe keeps its processing fee on refunds, so this check costs a few cents.
You now have a tested billing foundation, from your first Price to your first live subscription. Revisit tax registrations, retry outcomes and webhook processing as you add markets, plans and payment methods.
Start with Checkout, as recommended in step 4. Use Elements when the payment form must be embedded in your own page.
How do I handle EU VAT correctly?+
Configure Stripe Tax and add a registration for each country where you must collect VAT. B2B reverse charge depends on the transaction's eligibility, the customer's location and tax status, not a tax ID alone. Collect customer tax IDs in Checkout so Stripe Tax can apply reverse charge where it is eligible.
What if a customer disputes a charge?+
Respond in the Stripe Dashboard before the deadline shown on the dispute. Submit the invoice, proof that the customer accepted your terms, usage records and relevant correspondence, kept under an appropriate data-retention policy.