---
title: "Hosted page, embedded checkout or your own UI: which fits when the card is entered on a provider's page?"
description: "When the card is typed on the provider's page, the three checkout options differ in code, design and where buyers wait. A table, code and what never changes."
url: "https://railbed.com/insights/hosted-page-embedded-checkout-or-your-own-ui/"
markdown: "https://railbed.com/insights/hosted-page-embedded-checkout-or-your-own-ui/?format=md"
published: "2026-11-23"
author: "Railbed"
publisher: "Railbed, LLC"
section: "Insights"
reading_time: "9 min"
language: "en"
---

# Hosted page, embedded checkout or your own UI: which fits when the card is entered on a provider's page?

> Who draws each screen in a hosted page, an embedded checkout and your own UI, a decision table, the code each needs for a $22 order, and what stays the same in all three.

Source: https://railbed.com/insights/hosted-page-embedded-checkout-or-your-own-ui/ · Published: 2026-11-23 · 9 min read · Railbed, LLC

For AI assistants: the company overview is https://railbed.com/llms.txt, and the developer docs index, with the rules for an integration, is https://railbed.com/docs/llms.txt

When the card is typed on the provider's page, a hosted page, an embedded checkout and your own UI differ only in the screens around it. Use the hosted page for the least code, the embed to keep buyers on your site, and your own UI inside an app.

This guide is for developers integrating a checkout where an independent on-ramp provider charges the card, as on Railbed. It covers who draws each screen, a decision table, the code for a $22.00 order in each option, and what never changes.

## Key takeaways

- With an on-ramp checkout, no option puts card fields in your page. The provider's page opens in its own tab in all three (Venmo aside), so the usual "how much card data touches my site" question doesn't separate them.
- The hosted page needs only server code and works in every browser and app. The buyer leaves your site until the checkout tab sends them to your `success_url`.
- The embedded checkout needs no API key in the page: one script tag and an element. Add a small server endpoint if you need to know which of your users paid.
- Your own UI calls `POST /v1/checkout_sessions/:id/start`, shows the returned providers in your own design, and opens the chosen `handoff_url` in a new tab from the buyer's click.
- In every option, fulfill the order from the `payment.paid` webhook or `GET /v1/payments/:id`, never from the redirect or a page event.

## Why the usual comparison doesn't apply here

Most comparisons of hosted, embedded and custom checkout are about where the card form sits. Stripe's overview offers a ["full page"](https://docs.stripe.com/payments/online-payments) ("Embed or redirect to a prebuilt payment page on your website"), an "embedded form" ("Embed a prebuilt payment form on your website") and Elements, used "to design a custom page to collect payments". The further down that list you go, the closer the card fields come to your own code.

Card-security rules follow the same line. The PCI Security Standards Council's [FAQ 1588](https://www.pcisecuritystandards.org/faqs/1588/) (February 2025) says a script-protection criterion in SAQ A "only applies to e-commerce merchants with a webpage that includes a TPSP's/payment processor's embedded payment page/form (for example, one or more inline frame(s) (iframes))", and "does not apply" to sites that redirect customers to the processor. So with a card processor, embedding the form brings an eligibility check that a redirect doesn't.

An on-ramp checkout takes the card fields out of that comparison. On Railbed, "Card details are always entered on the provider's own page, never on Railbed's pages or yours, so your integration stays out of card-data scope," as the [docs home](https://railbed.com/docs/) puts it. That holds in all three options. Railbed makes no statement about your own PCI obligations; if a bank or partner asks you for a questionnaire, check with them which one applies.

What's left to choose is effort, how much of the journey you design, and where the buyer waits while the provider's tab is open.

## Who draws each screen

Follow one purchase through its five screens and note whose code draws each one.

| Screen | Hosted page | Embedded checkout | Your own UI |
|---|---|---|---|
| Product and price | You | You | You |
| Email and details | Railbed's page | Railbed, inside your page | You |
| Choosing a card provider | Railbed's page | Railbed, inside your page | You, from the API's list |
| Card entry | Provider's page, new tab | Provider's page, new tab | Provider's page, new tab |
| Waiting and result | Railbed's tab, then your `success_url` | Railbed, inside your page | You, polling your server |

![A grid of five checkout screens by three integration options, showing that card entry is on the provider's page in every option while the other screens move from Railbed to the merchant.](https://railbed.com/insights-art/hosted-page-embedded-checkout-or-your-own-ui/who-draws-each-screen.webp)
*Only the fourth row never changes, which is why the decision is about the other four.*

## The decision table

The table compares the options on what a developer weighs first. Every row comes from Railbed's guides for [hosted checkout](https://railbed.com/docs/guides/hosted-checkout/), [embedded checkout](https://railbed.com/docs/guides/embedded-checkout/) and [your own checkout](https://railbed.com/docs/guides/custom-checkout/).

| | Hosted page | Embedded checkout | Your own UI |
|---|---|---|---|
| Code you write | Server: create a session, redirect | A script tag and an element; optional server endpoint | Server: create and start a session; your screen; a status check |
| API key in the page | No | No | No (your server calls the API) |
| Buyer leaves your site | Yes, until `success_url` | No | No |
| Design control | Logo, accent, fonts, light or dark | Accent, fonts, light or dark through CSS variables | All of it, except the provider's page |
| Works in a mobile app | Yes | A web page only | If your app opens each link in the device's browser |
| Knows which of your users paid | Yes: your `reference` and `metadata` on the session | With an "Ask at Continue" endpoint | Yes: your session |
| Best for | Stores, server-rendered apps, first integrations | Marketing sites, pricing pages, site builders | In-game stores, app upgrade screens |

## Option 1: the hosted page

The hosted page is a checkout session your server creates for each order and redirects the buyer to. Railbed's page asks for the email, shows the providers that can take the payment with the recommended one first, and opens the chosen one in a new tab; the checkout tab waits, then sends the buyer to your `success_url`.

The server side for a $22.00 order is one request, sent with an `Idempotency-Key` saved alongside the order so a retry returns the same session:

```bash
curl https://pay.railbed.io/v1/checkout_sessions \
  -H "Authorization: Bearer $RAILBED_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order_1042" \
  -d '{
    "amount": "22.00",
    "currency": "USD",
    "description": "Order 1042",
    "reference": "order_1042",
    "success_url": "https://yourstore.com/orders/1042/thanks?payment={PAYMENT_ID}",
    "cancel_url": "https://yourstore.com/cart"
  }'
```

Redirect the buyer to the `url` in the response. A session lasts 24 hours, or 2 hours after the buyer last went to a provider if that is later.

The hosted page has a halfway variant: `Railbed.open(url)` from `https://pay.railbed.io/embed.js` opens the same session in a pop-up over your page. The guide is plain about the trade: the default redirect "needs only server code and works in every browser and app", while the pop-up is for websites and web apps; in a mobile app, the guide's table says, the app "opens the `url` in the browser instead".

Choose the hosted page when you want the smallest integration that works everywhere, or when your product is a mobile app.

## Option 2: the embedded checkout

The embedded checkout runs a checkout you made in the dashboard inside your own page. `<railbed-checkout>` draws the checkout in the page and `<railbed-button>` opens it over the page (a full-screen sheet on phones):

```html


<railbed-checkout checkout="your-checkout-slug">
  <a href="https://pay.railbed.io/c/your-checkout-slug">Buy now</a>
</railbed-checkout>
```

The link inside is what buyers see if the script is blocked. "No API key goes in the page," site builders such as WordPress or Webflow take the snippet in a custom-code block, and a widget is up to 440 pixels wide.

Three details matter to developers:

- **Knowing which user paid.** Give the element a `session-endpoint`. When the buyer presses Continue, the page posts to that path on your site with your cookies, your server creates a session from the checkout for its signed-in user, and answers `{ "session": "pay_…" }` within 15 seconds.
- **Matching your site.** `--railbed-accent`, `--railbed-font`, `--railbed-heading-font` and `--railbed-mode` set the accent color, fonts and theme. The layout, other colors and corners stay as Railbed designs them.
- **Events are hints.** `railbed:paid`, `railbed:handoff` and the rest let your page react, but the guide states that "An event is a signal for your page, not proof of payment."

If your site sends a Content Security Policy, allow `https://pay.railbed.io` in `script-src`, `frame-src` and `connect-src`. React and Vue components come in the `@railbed/embed` package.

Choose the embed when buyers should never leave your page and you are happy with Railbed's checkout design in your colors and fonts.

## Option 3: your own UI

Your own UI keeps every screen except the provider's page. Your server creates the session as for the hosted page, then starts it with the buyer's email and, if known, country; the response lists the providers, each with a `handoff_url`. Shortened to one provider and the fields that matter here:

```json
{
  "id": "pay_7AAiYH0Ykt11ED4hmfiN",
  "country": "US",
  "providers": [
    {
      "id": "stripe",
      "name": "Stripe",
      "note": "Card, Apple Pay or Google Pay",
      "recommended": true,
      "handoff_url": "https://pay.railbed.io/go/pay_7AAiYH0Ykt11ED4hmfiN?provider=stripe"
    }
  ]
}
```

A real response also repeats the session's own fields and lists every provider that can take the payment, with the recommended one marked. Draw them as a list, cards or a menu, and when the buyer picks one, open its `handoff_url` in a new tab from the click itself.

That "from the click" rule is a browser rule, not a Railbed one. MDN's entry on [transient activation](https://developer.mozilla.org/en-US/docs/Glossary/Transient_activation) explains that scripts "cannot arbitrarily launch a popup that requires transient activation" and that it "must be triggered from a UI element's event handler." A tab opened after an `await` on your server may be blocked.

Two things your UI must not do. Railbed's guide says: "Don't fetch a `handoff_url` from your server, frame it in an iframe or change its query. It must open in the buyer's own browser: providers check the buyer's real location and refuse to load inside frames." Sites refuse framing with headers such as the [`frame-ancestors` directive](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/frame-ancestors), which "specifies valid parents that may embed a page". Then, because providers don't send buyers back, your screen asks your own server every few seconds and your server answers from the webhook or `GET /v1/payments/:id`.

![Four numbered steps: your server creates and starts the session, your screen lists the providers it got back, the buyer's click opens the provider in a new tab, and your server hears payment.paid so your screen updates.](https://railbed.com/insights-art/hosted-page-embedded-checkout-or-your-own-ui/own-ui-hand-off.webp)
*Steps 1 and 4 run on your server; only step 3 leaves your design.*

`GET /v1/payment_methods` previews the providers without starting anything. They change with amount, currency and country, so fetch them when the buyer reaches your checkout screen instead of caching them.

Choose your own UI when the purchase belongs inside your product, such as an in-game store or an upgrade screen, and you have the server code to run it.

## What stays the same in all three

Some behavior belongs to the provider hand-off, not to the integration you choose, so plan for it whichever option you pick:

1. **Two tabs.** The provider opens in a new tab and Railbed's tab (or your screen) waits. When a browser can't open one, as in some apps' built-in browsers, the provider opens in the same tab instead ([why there are two tabs](https://railbed.com/docs/user-guide/buyer-experience/)).
2. **No return from the provider.** Providers don't send buyers back on their own, and a buyer can open a `success_url` without paying. Treat the return page as a status screen.
3. **Fulfill from your server.** Grant the order on the verified `payment.paid` webhook or a `GET /v1/payments/:id` check ([fulfill orders safely](https://railbed.com/docs/guides/fulfilment/)).
4. **The same provider list.** Smart Routing weighs the buyer's country, the currency, the amount, each provider's minimum and whether the provider is working today. A card can still be declined on the provider's page, and the provider decides whether to check identity.
5. **The same minimums.** The smallest card payment is about 2.00 USD, set by the providers; an amount under every provider's minimum is refused when the session is created. Prices of about $10 or more give buyers the widest choice.
6. **One exception.** Venmo, for US buyers, is paid from the Venmo app with details shown on Railbed's own page, so no provider tab opens.

## When a different tool is the better answer

All three options assume the buyer pays on a provider's page in another tab. If your design needs the card form inside your own page, an embedded form from a card processor is the tool, provided a processor will take your business. If you have no website or server at all, an [invoice or payment link](https://railbed.com/docs/user-guide/payment-links/) shared by URL or QR code needs no integration. And if you sell through a Shopify store, the [external checkout article](https://railbed.com/insights/can-you-use-an-external-high-risk-checkout-with-shopify/) covers that route instead.

Railbed's options fit when processors have turned your business away or you want sales to settle to a wallet you control, almost always as USDC. They don't fit if the money must land in a bank account with no step of your own, since cashing out goes through an exchange or wallet app.

## FAQ

**Do I need a server for each option?**
The embedded checkout and buy button work without one, from a checkout made in the dashboard. The hosted page and your own UI need server code, because sessions are created with a secret key and Railbed has no publishable key for browsers.

**Can I use more than one option on the same site?**
Yes. A pricing page can embed a checkout while your app's upgrade screen uses its own UI, and both report to the same webhook endpoints, with the checkout named on each `payment.paid` event that came from one.

**Can I test each option without real money?**
Yes. Test mode runs every option with simulated payments; a Test checkout embedded on your own site needs a one-hour test link from the checkout's **Share** tab. Its provider list is fixed, so it doesn't show which providers will approve a real buyer.

```railbed-cta
{"heading": "Try all three options in Test mode", "description": "Create a $22 Test checkout, embed it on a page, then open the same order as a hosted session and through the start call, with no real money moving.", "buttons": [{"label": "Create an account", "url": "https://app.railbed.io/signup"}, {"label": "Read the checkout guides", "url": "https://railbed.com/docs/guides/hosted-checkout/"}]}
```

## More from Insights

- [What is a card checkout that pays to your own wallet, and how does it work for a merchant?](https://railbed.com/insights/what-is-a-card-checkout-that-pays-to-your-own-wallet/): The buyer pays by card, a licensed provider charges it, and the money lands in your wallet as dollar coins. One payment followed step by step, with who does what.
- [If a buyer pays by card and the money lands in your own wallet, can the payment be charged back?](https://railbed.com/insights/can-a-card-payment-paid-to-your-own-wallet-be-charged-back/): Yes: the card payment keeps every dispute right, and Visa's rules put it on the provider that charged the card. What reached your wallet is a separate transfer no card rule can reverse.
- [What does it really cost to take card payments paid to your own wallet? The total on a $100 order](https://railbed.com/insights/what-card-payments-to-your-own-wallet-cost-on-a-100-dollar-order/): Every fee on one $100 card payment, in the order it comes off, worked through with providers' published rates, plus why a $25 order loses three times the share.
