Add the Marlin checkout widget to a React app or static site using data attributes, programmatic JS, or the React component — all three patterns shown.
Use this file to discover all available pages before exploring further.
The Marlin checkout widget lets customers pay without leaving your app. It opens the hosted checkout page in a sandboxed iframe with a full-screen modal overlay, so all payment logic stays inside a secure iframe and your page never handles any sensitive data. The widget supports three integration patterns: HTML data attributes for no-build setups, a programmatic JavaScript API, and a React component.
The simplest integration. Add data-marlin-checkout to any button or link and the SDK binds the click handler automatically when the page loads. No JavaScript required beyond the script tag.
Provide either data-invoice-id or data-plan-slug — not both.
Call MarlinCheckout.open() directly when you need full control over when the widget opens, how you respond to success or failure, or how you integrate with your own state management.
When you call MarlinCheckout.open() (or click a data-attribute button), the SDK:
Creates a full-screen semi-transparent backdrop overlay.
Loads an <iframe> pointing to the hosted checkout page at widget.marlin.fi.
Communicates with the iframe via postMessage events: ready, resize, success, error, and close.
Closes on Escape key, backdrop click, or handle.close().
All wallet connection and transaction signing happens inside the sandboxed iframe. Your page never has access to wallet credentials or private keys.
The iframe is sandboxed and loaded from widget.marlin.fi. If you use a Content Security Policy, add https://widget.marlin.fi to your frame-src directive.
For a complete reference of all widget options and postMessage event types, see the Widget integration reference.
If you only need a shareable payment link and do not want to embed anything, every invoice already has a paymentUrl you can send directly. See Share a hosted checkout payment link.