Embedded checkout

Show the Ezus Pay checkout on your own website with one script tag: inline in the page or as a payment button that opens a window. Attributes, events and examples.

Checked against the API code on October 13, 2026

The script turns any element carrying a payment link URL into a checkout. The traveler pays without leaving your page. It works on any site where you can add a script tag, including single-page apps.

Add the script

Load the script once per page, then add one element per checkout.

HTML
<script src="https://app.ezuspay.io/embed.v1.js"></script>

<div data-ezus-pay-url="https://app.ezuspay.io/lnk/your-agency/8K3QZ7M2XR4T"></div>

The URL is the link's checkoutUrl, copied from the app or returned by the API.

Attributes

AttributeValuesDefault
data-ezus-pay-urlThe payment link URL. Required
data-ezus-pay-modemodal: a button that opens the checkout in a window. Anything else: the checkout sits in the pagein the page
data-ezus-pay-localefr, en, es, it, pt, de, nl, nobrowser setting
data-ezus-pay-thememinimal hides your logo header and tightens the spacingminimal in a window, full in the page
data-ezus-pay-labelButton text, modal mode onlyPayer
data-ezus-pay-colorButton color, any CSS color, modal mode only#0f172a
data-ezus-pay-amountauto shows the link amount on the button. Any other text is shown as is. modal mode onlynone

Elements added after the page has loaded are picked up automatically, which suits React, Vue and other single-page apps.

Examples

In the page, in English, without the header:

HTML
<div
  data-ezus-pay-url="https://app.ezuspay.io/lnk/your-agency/8K3QZ7M2XR4T"
  data-ezus-pay-locale="en"
  data-ezus-pay-theme="minimal"
></div>

A button that opens a window, with the amount read from the link:

HTML
<div
  data-ezus-pay-url="https://app.ezuspay.io/lnk/your-agency/8K3QZ7M2XR4T"
  data-ezus-pay-mode="modal"
  data-ezus-pay-label="Pay for my trip"
  data-ezus-pay-amount="auto"
  data-ezus-pay-color="#D9007A"
  data-ezus-pay-locale="en"
></div>

The window closes with its × button, the Escape key, a click outside, or on its own 2.5 seconds after a successful payment.

Listen for the payment

After a successful card payment, the script fires an ezus-pay:success event on your element. It bubbles, so one listener on document covers every checkout on the page.

HTML
<script>
  document.addEventListener("ezus-pay:success", (event) => {
    // event.target: your element
    // event.detail: { type: "ezus-pay:success", amountCents: 144000 }
    window.location.href = "/thank-you";
  });
</script>

Ezus Pay never redirects your page. If you want to send the traveler somewhere after paying, do it from this listener.

Content Security Policy

If your site sends a CSP header, allow the Ezus Pay app:

Text
script-src  https://app.ezuspay.io;
frame-src   https://app.ezuspay.io;
connect-src https://app.ezuspay.io;

connect-src is only needed for data-ezus-pay-amount="auto".

Without the script

You can place the iframe yourself. Replace /lnk/ with /embed/ in the link URL, and handle the height from the messages the checkout sends.

HTML
<iframe id="ezpay" src="https://app.ezuspay.io/embed/your-agency/8K3QZ7M2XR4T?locale=en&theme=minimal"
        allow="payment" style="width:100%;border:0" height="600"></iframe>
<script>
  const frame = document.getElementById("ezpay");
  window.addEventListener("message", (e) => {
    if (e.source !== frame.contentWindow || e.origin !== "https://app.ezuspay.io") return;
    if (e.data?.type === "ezus-pay:resize") frame.style.height = e.data.height + "px";
    if (e.data?.type === "ezus-pay:success") { /* payment confirmed in the browser */ }
  });
</script>
MessagePayload
ezus-pay:ready{ version: 1 }, once per page shown
ezus-pay:resize{ height } in pixels, whenever the content changes size
ezus-pay:success{ amountCents }, after a successful card payment

Good to know

  • Any site can embed a checkout. There is no domain list to maintain.
  • Languages. In an embed, the language comes from data-ezus-pay-locale. Set it: there is no language menu inside the embed.
  • Payment plans. For an installment, amountCents is the amount of that installment.
  • Test mode. Create a link in test mode and paste its URL. The same script serves live and test links, and the checkout shows a Test badge unless you use theme="minimal".
  • Wallets. Apple Pay and Google Pay depend on the device and browser. Check them on your own site before you promise them.