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.
- 1Find the merchant's external IDIn the Tiyo Pay dashboard → Settings → Business info, copy the
brz_mer_…string. You'll paste it into the script tag. - 2Add the script tag oncePaste 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> - 3Add the Pay buttonWherever you want the button on the page.
data-amountis 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-itemstakes a JSON array. Quote it carefully — JSON inside an attribute uses single quotes around it, double quotes inside. - 4Optional — render dual pricing liveIf 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> --> - 5Test with a real button clickOpen 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 pagedata-return-urlpoints 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 everydata-tiyo-pricetag (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.