Back to install picker

Install the drop-in widget

Two-line integration. Works on any HTML page — Wix, Squarespace, Webflow, static HTML, mobile-app webview.

Pick this path if…
The merchant has a website but it's not WooCommerce or Shopify (or it's a hand-built page). You can edit the page's HTML. They want a single Pay button that mints a Tiyo checkout session and redirects.
  1. 1
    Find the merchant's external ID
    In the Tiyo Pay dashboard → Settings → Business info, copy the brz_mer_… string. You'll paste it into the script tag.
  2. 2
    Add the script tag once
    Paste this in the page's <head> (or anywhere before the button). Only one script tag per page, even if you have multiple Pay buttons.
    <script
      src="https://tiyopay.vercel.app/tiyo-cart.js"
      data-merchant="brz_mer_REPLACE_ME"
      defer
    ></script>
  3. 3
    Add the Pay button
    Wherever you want the button on the page. data-amount is in cents — 2999 = $29.99.
    <button
      data-tiyo-pay
      data-amount="2999"
      data-line-items='[{"name":"T-Shirt","quantity":1,"unit_price":2999}]'
    >
      Pay $29.99
    </button>
    data-line-items takes a JSON array. Quote it carefully — JSON inside an attribute uses single quotes around it, double quotes inside.
  4. 4
    Optional — render dual pricing live
    If the merchant has a card markup or cash discount configured, the widget can render the cash and card prices side-by-side from one base price:
    <span data-tiyo-price data-base="2999"></span>
    <!-- renders: <span>$29.99 <small>cash</small> · $30.89 <small>card</small></span> -->
  5. 5
    Test with a real button click
    Open the page, click the button. You should be redirected to tiyopay.vercel.app/pay/…. Pay with a real card (or sandbox card if the merchant's in test_mode). The customer lands back on whatever page data-return-url points to (defaults to the same page).
Programmatic API

Once the script loads, window.Tiyo exposes:

  • Tiyo.checkout({amount, line_items, ...}) — mint and redirect manually.
  • Tiyo.refreshPrices() — re-render every data-tiyo-price tag (call after dynamic price changes).
  • Tiyo.computePricing(baseCents) — return {cash, card, ach} object for a given base price.
  • Tiyo.getConfig() — fetched from /api/pay/config?merchantId=…; cached per page load.

Live demo: /cart-demo.html.