Skip to main content
Keep buyers on your page through the entire purchase. The embedded checkout opens our payment form in an overlay on top of your site, so customers never bounce to a hosted page mid-funnel. Card data is captured and tokenized in our PCI DSS Level 1 compliant vault, and because Macropay is the Merchant of Record, sales tax and VAT are calculated, collected, and remitted on the order — you ship the integration, we own the tax and compliance. There are two ways in:
  • Drop-in snippet — paste two tags into any HTML page or CMS. Zero build step.
  • JavaScript library — install the package for SPAs, event hooks, and programmatic control.

Drop-in snippet

Works anywhere you can paste HTML — a landing page, a Framer site, a Webflow block, a docs page. Start from a checkout link. Open the link in your dashboard and click Copy Embed Code to grab a ready-to-paste snippet, which looks like this:
The link renders inline and opens the checkout overlay on click. Style the trigger however you like — any element works as long as it carries the data-macropay-checkout attribute. Use data-macropay-checkout-theme="dark" to match a dark UI.

JavaScript library

For a React, Vue, or other bundled app, injecting a raw <script> tag is awkward. Install the package instead:
Import MacropayEmbedCheckout and call init() once after mount. It wires up handlers on every element carrying the data-macropay-checkout attribute:
A static checkout link is fine for fixed prices, but anything personalized — a pay-what-you-want amount, a prefilled customer, or a usage-based plan — should use a dynamically created checkout session URL instead.When you create the session, set embed_origin to the origin serving your checkout page. If the page lives at https://acme.dev/upgrade, set embed_origin to https://acme.dev.

Programmatic control

Beyond declarative triggers, MacropayEmbedCheckout exposes an imperative API for opening, listening to, and closing the overlay yourself.

Open on demand

Skip the data- attribute and open the checkout from your own code — handy when the buy action depends on app state, like a completed cart or a confirmed seat count:

React to checkout events

Subscribe to lifecycle events to drive analytics, fulfillment hints, or your own success UI. For loaded, prefer the onLoaded callback on create() — it fires reliably even when the overlay loads instantly.

A complete React component

This component opens the overlay, reports the conversion, and cleans up its instance on unmount:

Close it yourself

Dismiss the overlay from code when your app needs the buyer somewhere else first — for example, to finish an onboarding step or resolve a billing conflict:

Wallet payments (Apple Pay & Google Pay)

One-tap wallets convert better than card entry, and they show up automatically on hosted checkout when the buyer’s device supports them:
  • Apple Pay appears when the buyer is on an Apple device, using Safari, signed into an Apple account with Apple Pay set up.
  • Google Pay appears when the buyer is on Google Chrome, signed into a Google account with Google Pay set up.
On a standalone hosted checkout, there’s nothing to configure — if the conditions above are met, the wallet button is there.

Allowlisting your domain for embedded wallets

Inside an embedded overlay, wallet methods are off by default. Because the form runs on your domain, that domain has to be validated before Apple Pay or Google Pay can appear in embedded mode.
To turn on embedded wallet payments, email support with:
  • Your organization slug
  • The domain you want allowlisted for wallet payments