Add the snippet
The snippet works on any site or CMS that accepts HTML.- Create a Checkout Link.
- Open the link, select the Embed tab and click Copy.
- Paste the snippet into your page.
__CHECKOUT_LINK__:
HTML
data-polar-checkout attribute. On an element without href, such as a <button>, put the URL in the attribute: data-polar-checkout="__CHECKOUT_LINK__".
The script also exposes the embed class as window.Polar.EmbedCheckout, for pages without a bundler.
Use the library
In a JavaScript app, install the library instead of adding a script tag:PolarEmbedCheckout.init() once to wire up every element with data-polar-checkout. In React:
React
Open the checkout from code
PolarEmbedCheckout.create() opens the checkout and resolves once it has loaded:
TypeScript
Events
Events are cancelableCustomEvents on the checkout instance. Call event.preventDefault() to skip the default action.
Grant access from webhooks or the customer state, not from the
success event.
Embed a checkout session
You can embed a Checkout Session URL instead of a link. Setembed_origin when you create the session, to the origin of the page that embeds it:
close, confirmed and success messages only to the origin stored on the session. Checkout Links don’t need this: the script adds your page’s origin when it opens the link. The examples use the sandbox and API version 2026-10.
Theme and language
The embedded checkout is the hosted checkout, so the same query parameters apply:theme and, with localization on, locale.
AI agents in the browser can’t use the checkout tools on an embedded checkout. Those are only on the hosted page.
Embed hosts
The checkout opens only on hosts listed under Settings → Embedding. If the overlay stays blank and the browser console mentionsframe-ancestors, the page’s host isn’t on the list. See Embed hosts for the format and the API field.
Enable wallets in Embedded Checkout
Wallets such as Apple Pay and Google Pay appear in an embedded checkout only on hosts under a verified domain. On Polar’s hosted checkout, they work with no setup. To enable them:- Verify your domain under Settings → Domains
- Open Settings → Embedding
- Add each host that embeds the checkout, such as
shop.example.com
*.example.com doesn’t enable wallets. Add each subdomain on its own.
Each host in the list shows its wallet status. A host under a verified domain shows Wallet payments pending until your organization can accept payments.

