Stripe integration

Stripe integration that gets the money right, every time

Adding a payment button is easy. Keeping subscriptions, credits, refunds, disputes and VAT in sync with your own database is where Stripe integrations go wrong. We run Stripe in three of our own products, from metered credits to a marketplace on Stripe Connect, so we know the edge cases before they cost you money.

  • Checkout, Billing, the Customer Portal, Tax and Connect
  • Webhooks verified, de-duplicated and safe to replay
  • Refunds, disputes and failed payments handled, not ignored

From checkout to reconciled books

  1. Checkout

    A Stripe Checkout Session created with an idempotency key, so a double click never creates two payments.

    • Checkout
    • Tax
    • promo codes
  2. Webhook

    The event's signature is verified and its id logged, so a redelivered event is never processed twice.

  3. State change

    The order or subscription moves to its next status under a row lock: paid, pending or failed.

  4. Credits and access

    Plan limits, credits or allowances updated in the same step, and given back when a job fails.

  5. Refunds and disputes

    Refunds and disputes flow back into your data, your fees and your bookkeeping.

The pattern behind the Stripe integrations in our own products.
What we can build

What we build on Stripe

From a first checkout to a full billing system or a marketplace. Every item below runs in one of our own products.

Subscriptions and plans

Monthly and annual plans, trials, discounts and upgrades through Stripe Checkout and Billing, with the Customer Portal for invoices, cards and cancellations.

Usage-based billing and credits

Credit ledgers, allowances per plan and top-up packs, with the cost shown before a user starts and credits returned automatically when a job fails.

Marketplaces with Stripe Connect

Buyers pay the seller's own connected account through direct charges, the platform takes an application fee, and a refund gives back the right share of that fee.

Tax, VAT and invoices

Stripe Tax, VAT IDs for business customers, prices with or without VAT, and invoices your customers can download.

Disputes and trial abuse

Chargeback evidence gathered and staged in Stripe for review before it goes to the bank, plus checks that catch trial abuse before checkout opens.

Bookkeeping sync

Invoices, payments, fees, refunds and payouts from Stripe booked automatically in your accounting software, such as Moneybird.

Proof, not promises

Stripe running in three of our own products

Postcrest bills subscriptions and metered AI credits, checks trial sign-ups for abuse before checkout, builds dispute evidence and syncs everything to Moneybird. Twelve Lumens sells plans and image packs with an allowance ledger that gives images back when a render fails.

Salestreak runs webshops for other sellers on Stripe Connect: direct charges on the seller's own account, an application fee for the platform and VAT invoices for buyers. The platform never holds sellers' money.

  • Checkout Sessions created with idempotency keys, status changes made under a row lock
  • Billing events de-duplicated by Stripe event id; failed Connect events processed again safely on redelivery
  • SEPA Direct Debit and bank transfers kept pending until the payment actually succeeds
  • Application fees refunded in proportion when a seller refunds a buyer
  • Dispute evidence staged on the dispute first, so it can be checked before it is submitted to the bank

Marketplace payments with Stripe Connect

  1. Buyer

    Pays in a Checkout Session created on the seller's connected account.

  2. Seller's Stripe account

    Receives the payment as merchant of record, with the seller's name on the statement.

  3. Platform fee

    An application fee on every sale goes to the platform balance automatically.

  4. Refund

    When the seller refunds, the platform refunds the matching share of its fee.

How Salestreak's webshops take payments without the platform ever holding sellers' money.
Postcrest cost breakdown before generating a video: 225 credits for a five-second 1080p clip
Credits in Postcrest: the cost is clear before anything is charged.
products billing through Stripe
3
webhook endpoints: billing and Connect
2
stock held while a checkout is open
1 h
sellers' money held by the platform
0
Who it's for

Who we build Stripe integrations for

SaaS companies

Subscriptions, seats, trials or usage-based credits, with plan limits that follow the payment status automatically.

Marketplaces and platforms

Sellers onboarded with Stripe Connect, a fee per sale, and refunds and disputes handled without the platform becoming merchant of record.

AI products

Pay-per-use pricing where every generation has a known cost and failed runs are never charged.

Webshops and brands

Checkout with cards, SEPA and bank transfer, VAT handled by Stripe Tax and invoices for business buyers.

How it works

How we build a Stripe integration

Payment code has to be right in the boring cases and the rare ones. So we work in this order.

  1. 1

    Map the money

    Who pays whom, for what and when, and what happens on a refund, a dispute or a failed renewal.

  2. 2

    Choose the Stripe products

    Checkout or Elements, Billing or one-off payments, the Connect account type, Stripe Tax. Each choice affects liability, fees and the user experience.

  3. 3

    Model it in your database

    Plans, subscriptions, ledgers and orders that mirror Stripe's state, with clear statuses and an audit trail.

  4. 4

    Webhooks first

    Signature checks, an event log, idempotent handlers and row locks, so your database follows Stripe even when events arrive twice or out of order.

  5. 5

    Test the expensive cases

    Double clicks, retried webhooks, partial refunds, disputes, expired cards and payment methods that confirm later, all in Stripe's test mode.

  6. 6

    Go live and reconcile

    Live keys, webhook endpoints pinned to an API version, and a regular check that Stripe and your books agree.

Stripe products and tooling we use

We integrate Stripe on the server in Ruby on Rails, with background jobs for anything slow and webhooks as the source of truth.

  • Stripe Checkout
  • Stripe Billing
  • Customer Portal
  • Stripe Tax
  • Stripe Connect
  • Webhooks
  • Idempotency keys
  • Ruby on Rails
  • Solid Queue
  • PostgreSQL
Cost & timeline

What does a Stripe integration cost?

A single checkout is a small job. These factors decide how much more there is to it:

Billing model
One-off payments, subscriptions, seats, usage-based credits or a mix: each adds states and edge cases.
Connect or not
A marketplace needs onboarding, fees, refunds of fees and handling of sellers who disconnect their account.
Tax and invoicing
Stripe Tax, VAT IDs, prices with or without VAT and invoices per country.
Payment methods
Cards confirm instantly; SEPA and bank transfers need a pending state and a follow-up.
Existing data
Moving customers and subscriptions from another provider, or cleaning up an older Stripe setup.
FAQ

Questions about Stripe integration

How much does a Stripe integration cost?

It depends on the billing model, whether you need Connect, the tax and invoicing requirements and the payment methods. After a free intro call you get a written scope and estimate.

How long does it take to integrate Stripe?

A straightforward checkout can be live quickly. Subscriptions, credits or a marketplace take longer because the edge cases need testing. The estimate after the intro call includes a timeline per phase.

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

Usually Checkout. It handles cards, wallets, SEPA, 3D Secure, tax and promo codes, and Stripe keeps improving it. We only build a custom payment form when the flow really needs one.

Do I need a payment licence to run a marketplace?

Not if you set it up so you never hold sellers' money. With Stripe Connect direct charges, buyers pay the seller's own Stripe account and the platform only receives its fee. Have your specific setup checked by a legal advisor.

Can you add usage-based billing or credits to our SaaS?

Yes. We've built credit ledgers with expiry dates, top-up packs, allowances per plan, cost previews and automatic refunds for failed jobs.

Can you fix our existing Stripe integration?

Yes. We start with a review of your webhooks, statuses and reconciliation, then fix what costs money first: double charges, missed renewals or refunds that never reach your data.

Can Stripe data flow into our accounting?

Yes. We built a sync from Stripe to Moneybird that books invoices, payments, fees, refunds, disputes and payouts, and we can connect other accounting software that has an API.

Payments that need to be right?

Tell us what you sell, how you charge and where the money goes. You'll get an honest view on the Stripe setup that fits and what it would take.

martin@balk.dev

Typically a reply within one business day.

Useful to mention

  • What you want to build, in a few sentences
  • Who is going to use it
  • Any deadline or launch date
  • Tools and systems it should connect to