For founders who read docs

A SaaS MVP on Next.js and Stripe: The Plain Technical Path, Read From the Docs

Stripe's documentation says a subscription integration needs a destination for webhook events, because most subscription activity happens asynchronously. That sentence decides more about your first version than any starter template. Here is the route, with the facts taken from the official pages and our opinions labeled as opinions.

November 18, 2026 · 11 min read

acmeroutesheets.com · /api/stripe/webhook
One route, a morning's worth of events
The renewal is paid. The duplicate gets skipped. The parse is the bug
  1. invoice.paid evt_1a verified, active, access extended
  2. invoice.paid evt_1a already logged, skipped
  3. customer.subscription.updated evt_2b status past_due
  4. invoice.paid evt_3c signature failed: body was parsed first
  5. Stripe will retry. Fix: read request.text() first
Illustrative: a sample log for a fictional one-person software product

The short answer

A SaaS MVP on Next.js and Stripe needs server-rendered pages behind an authentication library, a Data Access Layer that checks permissions on every read and write, Stripe Checkout and the customer portal for billing, one verified webhook route that keeps subscription status in your database, and commercial hosting. Everything else can wait for paying customers.

On this page
  1. Seven parts, and the opinion behind each choice
  2. Sign-in is easy. The check beside the data is the hard part
  3. Billing: start hosted, and keep your own screens out of it
  4. The webhook route is where first versions quietly break
  5. Choosing a host by what its terms actually allow
  6. Three ways a small project doubles without anyone deciding to
  7. Before the first real card, and who should write all this

Seven parts, and the opinion behind each choice

This page assumes you can read code, or that you hired someone who can and want to check their plan. Nontechnical founders should start with owning the code and accounts instead. Below is the whole system for a first version with one job and one plan. The right-hand column is our judgment from running our own software on Next.js. It is not a rule from either vendor.

The parts of a first version, and our opinion on each
UseOur reasoning
PagesNext.js App Router, Server Components by defaultLess JavaScript in the browser, and keys stay on the server
Sign-inAn authentication libraryPassword storage is a poor place to be original
Data rulesA server-only Data Access LayerOne place to check who may touch what
DatabaseA managed relational databaseAccounts, plans and records are relational. Back it up
Taking moneyStripe Checkout, hostedShortest route, and card inputs stay on Stripe's side
Managing billingStripe's customer portalRent it, because no customer ever praised a card update screen
Staying in syncOne webhook Route HandlerStripe tells you what happened, and your database records it

Notice what is absent: microservices, a separate API project, a queue on day one, a design system. Each has its place. None earns one before you have customers. Stripe does recommend processing events with an asynchronous queue to handle spikes when subscriptions renew at the start of a month, and you can add that when your renewal count makes it worth the trouble. The micro SaaS entry page covers the business questions this page skips.

Sign-in is easy. The check beside the data is the hard part

The Next.js authentication guide, updated September 16, 2026, recommends an authentication library for security and simplicity, and lists options including NextAuth.js, Clerk, Auth0, Better Auth and Supabase. It also warns against a mistake that looks reasonable: layouts do not re-render on navigation, so a session check in a layout does not run on every route change. Put the checks close to the data.

The Next.js data security guide, updated October 6, 2026, recommends a Data Access Layer for new projects: code that runs only on the server, performs authorization checks and returns only the fields a page needs. Our own addition for a subscription product: every query in that layer takes an account ID from the verified session, never from the request. A customer who edits a URL should get nothing.

  • Server Actions are public endpoints. The same guide says an exported action is reachable by direct POST request, and that you should verify authentication and authorization inside each one. A page-level redirect does not protect the action defined inside that page.
  • Logged in is not the same as allowed. The guide names Insecure Direct Object Reference as the risk: check that this user owns this record, not just that a user exists.
  • Secrets stay on the server. It says environment variables are server-only by default, and that anything prefixed NEXT_PUBLIC_ is exposed to the client. Your Stripe secret key never gets that prefix.
  • Return small objects. Action return values are serialized and sent to the browser, so return what the screen needs and not the database row.
  • Mark server code. The guide's server-only package makes the build fail if a client module imports your data layer.

The Next.js server and client components page, updated October 5, 2026, explains the default this rests on: layouts and pages are Server Components, which fetch data on the server and keep API keys off the client. A client component is something you opt into, one interactive island at a time. Keep them small, and pass them only what they must display.

Billing: start hosted, and keep your own screens out of it

Card data is the part you most want nowhere near your server. Stripe's PCI guide, read November 6, 2026, says Checkout and Elements both qualify for SAQ A, the shorter self-assessment, because card inputs sit in an iframe served from Stripe's domain. Its security documentation adds that the duty does not end there: a business accepting payments must do so compliantly and attest to that annually. Calendar it.

Stripe's subscription documentation says subscriptions generate invoices, attempt collection and manage status, with Stripe handling retry logic and dunning. Stripe Billing pay-as-you-go is 0.7% of volume with no recurring fee, on top of 2.9% plus 30 cents per domestic card charge, as of November 2026. Our cost page works through what those percentages do to a $9 plan.

The customer portal covers card updates, invoices and cancellation, with a no-code setup or an API. Read the limitations before you design your plans. As of the documentation we read November 6, 2026, a customer on a usage-based or multi-product subscription, or one with a trial offer, can cancel in the portal but cannot update the subscription. Portal sessions are temporary, and the portal cannot be displayed inside an iframe. So send customers to it, and do not try to embed it.

The webhook route is where first versions quietly break

A customer can pay, fail, dispute and cancel while your app is doing nothing. Stripe tells you by webhook. In Next.js, per the Route Handlers page, updated August 27, 2026, you define that endpoint in a route.ts file using the Web Request and Response APIs, and handlers other than GET are not cached. These are the steps, each taken from Stripe's webhook documentation as read November 6, 2026.

  1. 1

    Read the body as raw text

    Stripe requires the raw body for signature verification and warns that any manipulation makes verification fail. So take request.text() and do not parse it first.

  2. 2

    Verify the signature

    Pass the body, the Stripe-Signature header and the whsec_ signing secret to Stripe's official library. Test and live endpoints have different secrets, so keep them separate.

  3. 3

    Return 2xx quickly

    Stripe says to return success before any complex logic that could time out. A timeout counts as a failed delivery, and Stripe will send it again.

  4. 4

    Log event IDs and skip repeats

    The same event can arrive more than once. Stripe suggests logging the IDs you have processed and not processing them twice.

  5. 5

    Do not depend on order

    Stripe does not guarantee delivery order, and says not to use the created timestamp to work out sequence. When in doubt, fetch the current object from the API.

  6. 6

    Subscribe only to what you need

    Stripe advises against listening to everything. The short list for a subscription product is in the table below.

Warm shallow-focus photo of hands at a laptop keyboard beside a notebook with a hand-drawn arrow diagram, a coffee cup and a pencil, no faces, no readable text
Most of the risk in a first version fits on one page of a notebook: what Stripe sends and what your app does about it.
Subscription events and the action Stripe's documentation suggests, read November 6, 2026
What it meansWhat your app does
invoice.paidThe invoice was paidRetrieve the subscription, confirm it is active, extend access
invoice.payment_failedA payment attempt failedNotify the customer, and let retries run if enabled
customer.subscription.updatedA renewal, plan change or status changeRecord the new status. On canceled or unpaid, revoke access
customer.subscription.deletedThe subscription endedRevoke access and keep the data per your policy
customer.subscription.trial_will_endSent 3 days before a trial endsCheck for a payment method, and warn the customer
charge.dispute.createdA customer's bank disputed a chargeDecide on evidence and access. Skip it and you learn from the Dashboard

Two details bite people. First, in Stripe's subscription webhook documentation, if you listen for invoice.created and Stripe does not get a successful response, finalizing invoices with automatic collection is delayed for up to 72 hours. A broken route can therefore stall your revenue, not just your records. Second, retries differ: up to three days in live mode, but three times over a few hours in a sandbox. Your test environment will be less patient than production.

Choosing a host by what its terms actually allow

Vercel's documentation, updated September 14, 2026, restricts its Hobby plan to non-commercial, personal use, so a business needs Pro or higher. Vercel Pro is $20 per developer seat per month with $20 of usage credit, then pay as you go, as of November 2026. Netlify lists Pro at $20 a month, as of November 2026. Read each usage meter before you pick.

You are not locked in by the framework. The Next.js deploying guide, updated August 6, 2026, says a Node.js server or a Docker container supports all features, on any provider that runs them. It lists Vercel and Bun as verified adapters, and says other platforms, including Netlify, offer their own integrations with support that may vary. A static export does not support features that need a server, so it is not an option for this product.

Three ways a small project doubles without anyone deciding to

Money between customers

If your users get paid through your product, that is Stripe Connect. When you handle pricing, Stripe lists $2 per monthly active account plus 0.25% plus 25 cents per payout, as of November 2026. It is a different project.

An iPhone app

Apple's guideline 3.1.1, read November 6, 2026, requires in-app purchase when an app opens up features or functionality, including subscriptions. Guideline 3.1.3(b) lets multiplatform apps honor subscriptions bought elsewhere, provided they are also offered in-app. See native versus web.

Sales tax

Stripe Tax Basic is 50 cents per transaction on API integrations where you are registered to collect, as of November 2026. It calculates. Deciding where you owe is a question for your accountant, because we are not one.

A web app with a good phone layout avoids the second one entirely for most products, and it can even be installed. MDN says, as read November 6, 2026, that a web app needs a manifest and a secure origin to be installable, with no service worker required. If you do want a store listing later, our iOS development page for small companies covers it, and native apps start at $3,750.

Before the first real card, and who should write all this

  1. 1.Run the whole path in a sandbox. Stripe's testing page says test transactions move no funds. Use its test cards to force declines and disputes.
  2. 2.Trigger events with the Stripe CLI, including stripe listen for local forwarding, and watch your route handle each one twice.
  3. 3.Swap in live keys and the live signing secret. Stripe says you cannot process live payments on test keys, and its services agreement prohibits testing in live mode with real payment details.
  4. 4.Restore a database backup somewhere and open the app against it. A backup you have not restored is a theory.
  5. 5.Sign in as customer A and try to reach customer B's record by editing the URL.
  6. 6.Cancel a test subscription and confirm that access actually ends.

If you can write this, write it, and hire help for the parts you dislike. A code review of your auth and webhook routes can be money well spent. If you would rather not, web apps at DataCram start from $575, depending on complexity, and a real SaaS costs more, so we quote it after a conversation. It is also the stack we use: we built AICiteBeam on Next.js, and our prices are published. See our custom software page for smaller builds, what we charge for integrations, and the wider section for very small businesses. If you have not tested demand yet, do that first. Reach us at (210) 346-0848.

Questions owner-operators ask

Use a Route Handler. Stripe needs a stable, publicly accessible HTTPS URL that accepts POST and gives it the raw body. A route.ts file provides that with the Web Request API. Next.js creates encrypted IDs for Server Actions and recalculates them between builds, so they do not suit an outside service calling a fixed address.

We would not. The Next.js authentication guide says that while a custom solution is possible, it recommends an authentication library for increased security and simplicity. Compare the options' prices at your expected user count, and check how you could export your users if you leave. A login system is a poor place to be creative, and a costly place to be wrong.

It reduces your obligations and does not end them. Stripe says Checkout and Elements both qualify for SAQ A, the shorter self-assessment, because card inputs sit in an iframe served from Stripe's domain. Stripe also says a business accepting payments must do so compliantly and attest to that annually. The PCI Security Standards Council says PCI DSS applies regardless of size.

Often not for a first version, in our judgment. Server Components, Server Actions and Route Handlers can cover reads, writes and webhooks in one project, which is simpler for one person to run. Next.js's data security guide says separate HTTP APIs suit existing large applications, and recommends a Data Access Layer for new projects. Add a separate service when a real need appears.

Stripe's documentation says to notify the customer directly when a subscription goes past_due, and to revoke access when it becomes canceled or unpaid. Your dashboard settings decide what happens after retries run out. For a small product, we would keep access during the retry window and email early. Most failed cards are not angry customers, and a sudden lockout can create one.

The framework allows it. The Next.js deploying guide says a Node.js server or Docker container supports all features on any provider that runs them. Your real work would be environment variables, caching settings and any vendor-specific services you adopted along the way. Note which of those you pick up, and keep the DNS and the repository in your own accounts so moving stays your decision.

Keep reading

Free · No obligation

Send us your stack and the part that worries you

Tell us what is built, what you plan to charge and where you are stuck. A person who reads code replies with what we would check first and a quote if you want the work done.

Which of these sounds like you? (pick any)

Rather talk now? Call (210) 346-0848.

CallGet a quote