codexier.

SaaS & MVPs

Subscription Billing for SaaS With Stripe

By CodexierPublished 6 min read

Billing is the part of a SaaS product that founders postpone and then rebuild twice. Stripe removes most of the payment plumbing, but the decisions about plans, trials, failed payments and VAT are still yours, and they are hard to change once customers are on them. This guide walks through the setup we use for Swedish SaaS products, in the order the decisions should be made.

Products, prices and plans

Start with the pricing page and work backwards. Each plan becomes a product; each plan's monthly and yearly options become prices on that product. Keep plan features in your own code, keyed to the price identifier, not in Stripe metadata. Seats are a quantity on the subscription item; usage such as API calls or messages is a metered price reported to Stripe at the end of each period. Never create prices on the fly from your application, and never delete a price with active subscribers; archive it and create a new one when you change pricing.

Trials and upgrades

A trial is a subscription in a trialing state, and Stripe converts it automatically when the period ends. The decision you have to make is whether to collect a card up front. Card-up-front trials convert at a higher rate per sign-up but produce fewer sign-ups; card-free trials do the opposite and require you to chase for payment details before the trial ends.

  • Send a reminder a few days before a trial converts. The law on automatic renewals aside, it is the single biggest reducer of chargebacks.
  • Upgrades take effect immediately with proration; downgrades take effect at the end of the period. Stripe supports both, but you must decide and state it in your terms.
  • Switching from monthly to yearly should credit the unused month; test this in the sandbox because the invoice looks confusing the first time.
  • Record every plan change in your own database via the subscription-updated webhook so that features switch at the same moment billing does.

Failed payments and dunning

Cards expire, limits are hit, banks decline. Involuntary churn from failed payments is usually larger than founders expect and mostly recoverable. Stripe's smart retries reschedule attempts at the times most likely to succeed; your job is the communication around them and the rule for what happens at the end.

EventStripe doesYou decide
First failureMarks the invoice open and schedules a retryEmail the customer with a link to update the card
Retries over a few weeksAttempts the charge again on a scheduleTone and number of reminders; keep access during retries
Card expiring soonCan update card details automatically with some issuersWhether to warn the customer in advance anyway
Final failureCancels, pauses or leaves the subscription unpaid, per your settingGrace period, data retention and how re-activation works

Choose pause or mark unpaid rather than cancel for B2B customers. A missed payment at a company is usually an admin problem, not a decision to leave.

Invoices and Swedish VAT

Every subscription charge produces a Stripe invoice, and for Swedish customers that document has to meet the content rules for invoices in the VAT Act: your organisation number and VAT number, the customer's details, invoice number and date, the VAT rate and amount. Stripe's invoice template can include all of these once configured. VAT itself depends on who the customer is and where.

  • Consumers and businesses in Sweden: Swedish VAT at the standard rate on software services.
  • Businesses in other EU countries with a validated VAT number: no VAT, with the reverse-charge note on the invoice. Stripe Tax validates the number and applies the rule.
  • Consumers in other EU countries: their country's rate, reported through the OSS scheme at Skatteverket.
  • Customers outside the EU: usually no Swedish VAT; check the destination country's rules on imported digital services.

Stripe Tax does the rate arithmetic and the evidence collection, but it does not file anything. Your accountant still needs a report of sales by country and VAT treatment each period, so export it from Stripe and agree the format with them before launch, not at the first VAT return.

Customer self-service portal

Stripe's hosted customer portal lets subscribers update cards, download invoices, change plans and cancel without emailing you. Turn it on from day one with a link inside your app. Decide which actions to allow: most SaaS products allow card updates and invoice downloads unconditionally, allow plan changes between self-serve tiers, and route cancellations through a short reason survey. Every ticket the portal absorbs is one you do not answer at nine on a Sunday evening.

When you do not need this: a product with a handful of customers on annual invoices is better served by sending invoices from Fortnox and recording payment by hand until the volume justifies automation. When self-serve sign-up is the model, billing is part of what we build in an MVP development engagement, and a free call is the quickest way to check which of the decisions above you have already made. Package prices are on the pricing page.

Frequently asked questions

Should I use Stripe Checkout or build my own payment form?

Use Checkout or the hosted payment page unless you have a specific reason not to. It handles strong customer authentication, card storage and localisation, and it is what most users recognise. A custom form is more work to build and to keep compliant, and rarely converts better.

Can I offer invoice payment instead of card for Swedish companies?

Yes. Stripe subscriptions can be set to send an invoice with a due date and bank transfer details instead of charging a card. Many Swedish B2B customers expect this. Combine it with a longer grace period, since transfers take days and accounts departments batch them.

What must my own database store about billing?

The Stripe customer and subscription identifiers, the current price identifier, the status and the period end date, all updated from webhooks. Do not store card numbers or copy Stripe's invoice data; link to the portal instead. Treat Stripe as the source of truth and your table as a cache.

Setting up billing for a new SaaS?

Bring your pricing page, even as a draft. In fifteen minutes we can map it to Stripe products and prices, flag the VAT cases you will hit and tell you which decisions to lock before the first customer.

Book a free 15-minute call