Skip to content
VibecodeZero

Stripe Checkout: hosted page vs embedded, and when a Payment Link is enough

Updated

In this guide (9)
  1. The options, side by side
  2. Payment Links: when no code is enough
  3. Hosted page: the default
  4. Embedded page: checkout inside your site
  5. Check the ui_mode values your AI writes
  6. Two rules for any option
  7. Which one should you pick?
  8. How to ask your AI tool for it
  9. Test before you go live

This page is for you if your AI-built app needs to take payments with Stripe and the AI asked you, or you read somewhere, “hosted or embedded?”. It explains the options in plain English, which one to start with, and what to ask your AI tool for.

The facts come from Stripe’s docs: Build a payments page, Online payments, How Checkout works, the embedded checkout quickstart, the Create a Checkout Session API reference, the changelog entry on ui_mode values, Payment Links, Create a payment link, the buy button, After a payment link payment, Fulfill orders and Testing, plus Stripe’s support article Embedded full page vs hosted full page. All checked November 1, 2026. This page doesn’t cover Stripe’s fees: see Stripe’s pricing page. None of the links on this page are affiliate links.

The options, side by side

Stripe has a no-code option, Payment Links, and Stripe Checkout, which your app sets up with code. Checkout has three payment UIs. Here they are, with Stripe’s own ratings:

What the customer sees Code needed Stripe’s rating
Payment Link A payment page hosted by Stripe, opened from a link, a QR code or a buy button None. You create it in the Dashboard Integration effort 1 out of 5
Checkout, full page, hosted (hosted_page) Your app sends them to a payment page hosted by Stripe, then back to your app A little, on a server Recommended. Low complexity, low maintenance
Checkout, full page, embedded (embedded_page) The same payment page, shown inside your site More: your site shows the checkout and you build a return page Recommended (full page). Low complexity, low maintenance
Checkout, embedded form (form) A payment form inside your site More, with more design control Some complexity, some maintenance
Elements (elements) A payment page you design from parts The most Most complexity, most maintenance

On Stripe’s comparison, the full page includes a full order summary and 15 settings you can adjust through brand settings. The embedded form has a limited order summary and 70 settings through the Appearance API. Elements has no order summary and full CSS customization.

For a beginner, the real choice is between the first three rows. The embedded form and Elements give more design control in exchange for more code to build, test and maintain.

A Payment Link is a link to a payment page hosted by Stripe. Stripe says you can use it to accept payments without a website.

To create one, in the Stripe Dashboard open Payment Links, click +New, pick a product or click +Add a new product, then click Create link. You can also let customers choose what to pay, for tips or donations. Then share it:

  • Copy the link and send it by email, text message or social media.
  • Show it as a QR code.
  • Add a buy button to your site: open the link in the Dashboard, click Buy button, and Stripe generates code to paste into your page.

After the payment, the customer sees a confirmation message, which you can customize, or you can send them to a page on your site instead.

Where Payment Links fall short in an app. The link alone doesn’t tell your app which of your users paid. If paying should unlock something in the app, like a plan or credits, the app still needs a webhook (more on that below), and you’ll usually want Checkout. If you deliver by hand, Stripe says manual fulfillment, like checking the Dashboard or payment notification emails, works for low volume or experimental ventures.

Hosted page: the default

With the hosted page, your app creates a Checkout Session when the customer is ready to pay. The session gives a link to a payment page hosted by Stripe. The customer pays there, and Stripe sends them to your success page (the success_url).

What it means for you:

  • Stripe hosts the payment page. Stripe lists responsive mobile design, card validation, error messages and PCI compliance as built-in.
  • It’s the default. If the AI doesn’t set ui_mode at all, Stripe uses hosted_page.
  • A back button is available. If your app sets a cancel_url, Checkout shows a back button to it. Stripe doesn’t allow cancel_url with the embedded page.
  • Custom domains are hosted-only. Stripe can serve the hosted page on a subdomain of your own domain, but says that’s a paid feature.

Embedded page: checkout inside your site

With the embedded page, the same Checkout appears inside a page of your site. Your server creates the Checkout Session with ui_mode set to embedded_page and sends back a client secret, and your page uses it to show the checkout.

What it adds:

  • A return page you build. Stripe’s quickstart says you set a return_url, and that you’re responsible for creating and hosting the return page on your website. That page has to check whether the payment went through and show the right message.
  • Somewhere safe to show it. Stripe says to avoid placing Checkout inside another iframe, because some payment methods require redirecting to another page to confirm. Test it on your published app in a normal browser tab.
  • A built-in success state. Stripe’s support article says the embedded version can show a success state directly on Checkout, which the hosted version doesn’t support yet. Both can send the customer to a page on your site.

Stripe’s support article says both versions support the same payment methods and almost all the same features. So if staying on your site isn’t important to you, the hosted page gets you the same checkout with fewer parts.

Check the ui_mode values your AI writes

Stripe renamed these values. Its changelog for API version 2026-03-25.dahlia says:

  • hosted became hosted_page
  • embedded became embedded_page
  • custom became elements
  • form is new, for the embedded form

It also says that trying to set the old values hosted, embedded or custom will fail. AI tools sometimes write older code, so if checkout fails with an error that mentions ui_mode, this is the first thing to check. Ask the AI which Stripe API version your project uses and to use the matching values.

Two rules for any option

1. Create the session on a server, never in the browser. Stripe’s quickstart says you must create the Checkout Session server-side because it requires your secret or restricted API key, which you can’t safely expose in client-side code. In an AI app builder, that usually means a server or edge function, with the key stored in the tool’s Secrets. See How to keep API keys safe.

2. Use a webhook to deliver what people paid for. A webhook is a message Stripe sends straight to your server when something happens, like checkout.session.completed when a payment completes. Stripe says webhooks are required for fulfillment, because you can’t rely on the customer reaching your success page: someone can pay and lose their internet connection before it loads. Stripe says this also applies to Payment Links, and that webhooks are required if you sell subscriptions. The success page is still useful to show a thank-you message and give access right away.

Which one should you pick?

  • You sell one thing, or take donations, and nothing in the app needs to change after the payment: a Payment Link. No code, nothing to break in your app.
  • Your app needs to know who paid, to unlock a plan, credits or a feature: Checkout on the hosted page, with a webhook. This is where most beginners should start.
  • You really want the payment to happen inside your site: the embedded page, knowing it adds a return page to build and test.

If you use Lovable, first find out which payment setup your project has. With Lovable’s built-in payments, Lovable creates the Stripe account for you and the Payments tab has a test/live toggle and a go-live checklist. With your own Stripe account, you connect it with a key, and the choices on this page apply directly. Lovable Stripe payments work in the preview but fail on the published app shows how to tell them apart and how to go live with each.

How to ask your AI tool for it

Paste this into your tool’s chat, and edit the parts in brackets:

I want to take payments with Stripe Checkout, using the hosted page.

What I'm selling: [for example "a monthly plan" or "a one-time pack of 10 credits"]
What should happen after the payment: [for example "unlock the Pro features for that user"]

Requirements:
- Create the Checkout Session in a server function, never in browser code. Keep the Stripe secret key in Secrets or environment variables, and never write it in the code.
- Use ui_mode hosted_page (the default), and the current ui_mode values for the Stripe API version this project uses.
- Add a success page and a cancel page.
- Use a Stripe webhook for checkout.session.completed to unlock what was paid for. Don't unlock it only from the success page.
- Use test mode keys for now.

Before you change anything, explain your plan in plain English and tell me what I need to set up in the Stripe Dashboard. Wait for my OK.

For the embedded page instead, change the second requirement to “Use ui_mode embedded_page, and build the return page that checks the session status”. Never paste a Stripe key into the chat: put it where the tool asks for secrets.

Test before you go live

Do all your testing in Stripe’s test mode, with test keys. Stripe’s docs say test transactions don’t move funds.

  • Payment works: 4242 4242 4242 4242, any future date like 12/34, any three-digit CVC.
  • Payment declined: 4000 0000 0000 0002. Nothing should unlock.
  • Payment needs extra authentication: 4000 0025 0000 3155, which Stripe’s quickstart lists for a payment that requires 3D Secure.

After each test payment, check that the app unlocked the right thing, and that the payment shows in the Stripe Dashboard. Stripe says not to use real card details for testing, and that the Stripe Services Agreement prohibits testing in live mode with real payment details. When it all works, switching to live means live keys and live products and prices, because Stripe keeps test and live separate. For the rest of your app, see How to test your vibe-coded app without coding.

Questions people ask

What's the difference between Stripe's hosted and embedded checkout?

Where the payment page appears. With the hosted page, the default (ui_mode hosted_page), your app sends the customer to a payment page hosted by Stripe and Stripe sends them back to your success page. With the embedded page (ui_mode embedded_page), the same checkout shows inside your own site, and after the payment Stripe redirects to a return page that you create and host. Stripe's support article says both support the same payment methods and almost all the same features.

Which one should a beginner pick?

The hosted page, unless you have a strong reason to keep people on your site. Stripe marks the full page as recommended and rates it low on complexity and ongoing maintenance. The embedded page adds pieces to build and test, like the return page. If you don't need your app to react to the payment at all, a Payment Link is even simpler.

Do I need a website to use a Payment Link?

No. Stripe says Payment Links let you accept payments without a website. You create the link in the Stripe Dashboard and share it by email, text message or social media, or show it as a QR code. If you do have a site, you can add it as a buy button, which Stripe generates as code to paste into your page.

My AI wrote ui_mode 'embedded' and Stripe returns an error. Why?

Stripe renamed those values. Its changelog for API version 2026-03-25.dahlia says hosted became hosted_page, embedded became embedded_page and custom became elements, and that trying to set the old values will fail. Ask the AI to use the current values, and to check which Stripe API version your project uses.

Do I still need a webhook with a Payment Link?

If you want your app to unlock something automatically, yes. Stripe sends a checkout.session.completed event when a payment link payment completes, and says webhooks are required for fulfillment, because customers aren't guaranteed to reach your landing page. If you deliver by hand, for example by checking the Dashboard and sending a file yourself, Stripe says manual fulfillment works for low volume or experimental ventures.

How do I test Stripe Checkout without real money?

Use test mode with test keys. Stripe's docs say test transactions don't move funds. Use the card 4242 4242 4242 4242 with any future date, like 12/34, and any three-digit CVC. The card 4000 0000 0000 0002 simulates a declined payment. Stripe says not to use real card details, and that its Services Agreement prohibits testing in live mode with real payment details.

New guides by email. An email when we publish a new guide, error fix or chapter, in plain English. Subscribe