Embed guide
Embed kiosk in your app.
kiosk runs inside your page as an iframe. Your page builds a link, frames it and listens for one message when the payment is through. The flow, the sign-in and the money stay on kiosk's side.
- Nothing to install, no key to start
- One link sets the token, the network and the amount
- Works on any site or webview
Step 1
Build the pay URL.
The link carries everything, and you don't need an account: the price is quoted when the link opens.
https://www.kiosk.money/pay?chain=polygon&token=USDC&to=0x…&amount=96&ref=INV-2026-0142&return=https://your.app/thanks- https://www.kiosk.money/payThe widget's address
- ?chain=polygonThe network the tokens arrive on
- &token=USDCThe token that arrives
- &to=0x…Where it arrives. Leave it out and the user receives in their own wallet
- &amount=96How much has to arrive, in the token
- &ref=INV-2026-0142Your own id for the payment. You get it back at the end
- &return=https://your.app/thanksWhere the user goes back to when it is done
- What arrives
- Where it lands
- What comes back
What the link sets decides what the user does
- chaintokentoamount
Buy crypto
The user picks the amount and receives in their own wallet. Good for a Buy crypto button.
- chaintokentoamount
Top up an account
The user picks the amount and it lands at the address you set, such as a deposit address you keep per user.
- chaintokentoamount
Checkout
The amount is fixed. The user only chooses how to pay: PIX, or a token from a wallet. Good for an order or an invoice.
A small function keeps the link in one place:
const payUrl = ({ chain, token, to, amount, ref, returnUrl, color, theme }) => {
const params = new URLSearchParams({ chain, token });
if (to) params.set("to", to);
if (to && amount) params.set("amount", amount);
if (ref) params.set("ref", ref);
if (returnUrl) params.set("return", returnUrl);
if (color) params.set("color", color);
if (theme) params.set("theme", theme);
return `https://www.kiosk.money/pay?${params}`;
};Step 2
Put it in an iframe.
The widget is designed for 400 × 680. Give it at least that much room.
<iframe
src="https://www.kiosk.money/pay?chain=polygon&token=USDC&to=0x…&amount=96&ref=INV-2026-0142"
title="kiosk checkout"
allow="clipboard-write; camera"
style="border:0;border-radius:28px;width:100%;max-width:400px;height:680px"
></iframe>clipboard-writelets the user copy the PIX code.camerais for the ID check.- The 28px radius matches the widget's own corners.
- A session's
urlgoes in the same iframe, in place of the link. See sessions.
Want the snippet written for you? Pick the token, network and color in the configurator.
In React, render the same iframe and re-key it whenever the URL changes:
// payUrl is the function from step 1, listenForPaid the one from step 3.
type PayOptions = Parameters<typeof payUrl>[0];
type Paid = { tx: string | null; ref: string | null };
function KioskWidget({ onPaid, ...options }: PayOptions & { onPaid?: (paid: Paid) => void }) {
const frame = useRef<HTMLIFrameElement>(null);
const src = payUrl(options);
useEffect(() => listenForPaid(() => frame.current?.contentWindow ?? null, onPaid), [onPaid]);
return (
<iframe
ref={frame}
key={src}
src={src}
title="kiosk checkout"
allow="clipboard-write; camera"
style={{ border: 0, borderRadius: 28, width: "100%", maxWidth: 400, height: 680 }}
/>
);
}Step 3
Listen for the payment.
When the payment is through, the widget posts one message to the page that framed it, or to the window that opened it as a popup.
- R$The user paysWith PIX, or a token from a wallet
- { }Your page gets the message
kiosk:paid, with the transaction and your ref - You show it as processingA hint for the user, not a receipt
- Your server confirmsFrom a session, a signed webhook or the chain
The message
{
type: "kiosk:paid",
status: "paid",
// The transaction that delivered the tokens, or null.
tx: "0x…",
// Your ref, or null.
ref: "INV-2026-0142",
}The listener
function listenForPaid(source, onPaid) {
const handler = (event) => {
if (event.origin !== "https://www.kiosk.money") return;
if (event.source !== source()) return;
if (event.data?.type !== "kiosk:paid") return;
onPaid?.({ tx: event.data.tx ?? null, ref: event.data.ref ?? null });
};
window.addEventListener("message", handler);
return () => window.removeEventListener("message", handler);
}Check the origin and the source window, so two widgets on one page never answer for each other.
If you set return, the done screen's Back button also opens it with status=paid, tx and your ref appended. Without a key, the message then only goes to that origin, so set it even if you never redirect. With a key or a session, it goes to your allowed sites instead.
Neither the message nor the return URL proves payment.
Any page can post that message and anyone can type that URL. Show the order as processing, and let your server mark it paid on its own confirmation: a session that reads paid or its signed webhook, or the amount landing at to on chain. Without a session, use a fresh address or a unique ref for each order: a link can be paid twice.
Step 4
Offer a popup fallback.
Signing in inside the iframe relies on kiosk's session cookie working in a third-party context. Chromium accepts it; a browser that blocks it can still run the same flow in a window.
function openKioskPopup(url) {
const w = 440, h = 760;
const left = Math.max(0, screenX + (outerWidth - w) / 2);
const top = Math.max(0, screenY + (outerHeight - h) / 2);
const popup = window.open(url, "kiosk-pay", `popup,width=${w},height=${h},left=${left},top=${top}`);
if (!popup) window.open(url, "_blank", "noopener"); // popups blocked: open a tab
return popup;
}Put a quiet link under the frame:
<button type="button" onclick="openKioskPopup(kioskUrl)">
Trouble signing in? Open in a window
</button>The popup gets the same kiosk:paid message: listen with the popup as the source. Call window.open from the click handler itself, or the browser blocks it.
Reference
Every parameter.
Only chain and token are required. A link with a wrong value says which part is wrong instead of opening.
What arrives
- chainRequired
- The network, by id (
8453) or by name (base,polygon,arbitrum,solanaand others). - tokenRequired
- A symbol on that network (
USDC,ETH,BRLA) or a token contract address.
Where it lands
- to
- The recipient on that network. EVM addresses must be EIP-55 checksummed. Without it, the user receives in their own wallet.
- amount
- What has to arrive, in the token, with up to 6 decimals. Needs
to. Without it, the user picks the amount. - margin
- Percent the payer is asked for over the exact price, from
0to10. The default is1for stablecoins and2for other tokens. Anything that lands aboveamountis the recipient's.
What comes back
- ref
- Your order id, up to 120 characters. It comes back on the return URL and in the
kiosk:paidmessage. - return
- Where the Back button leads once the payment is through.
httpsonly. Without a key, it also limits thekiosk:paidmessage to that origin.
How it looks
- color
- The color of the buttons and links, by name or hex. Other values are refused.
coral(default)skymintbutter - theme
lightordark. Without it, the widget follows the visitor's own setting.
Your own credits
- display
creditsshows what arrives as your own credits instead of the token. Needsunitandrate.- unit
- The name of the credits, such as
Gems. 24 characters at most. - rate
- Credits per 1 token:
100for 100 Gems per USDC. Display only, the tokens still arrive atto. - icon
- A square
httpsimage for the credits, shown in a 28px circle.
Partner dashboard
Add a project when you need more.
Everything above works without an account. A project adds a key for your page, a key for your server, the sites allowed to show the widget and a webhook. Sign in to the partner dashboard with an e-mail code and create one.
Three ways to open the widget
/pay?chain=…&token=…A plain link
Any page can frame it. Nothing is recorded for you, and the payer's browser holds every parameter.
/pay?pk=pk_…&chain=…A link with your publishable key
Loads only on your allowed sites. Payments show in your dashboard and send your webhooks. The payer's browser still holds the amount and the recipient.
/pay?session=cs_…A session from your server
Loads only on your allowed sites. Your server fixed the amount and the recipient, and reads the outcome with your secret key.
When the amount or the recipient must hold, create a session on your server.
A link with a key alone is set by the payer's browser: anyone can change its to or amount before paying. A session keeps them on our side, out of the page's reach. See sessions.
pk_…Publishable key- Goes in the link as
pk=. It names your project, so its payments show in your dashboard and send your webhooks, and it keeps the widget to your allowed sites. It is not a secret: anyone can read it in your page, so it cannot protect the amount or the recipient. sk_…Secret key- Stays on your server, sent as
Authorization: Bearer sk_…. Its one use is the sessions API. Make one on the Keys page with a name: it is shown once, so store it then. You can have up to ten active. Replace one or turn it off from the same page; a key turned off stops working at once. Never put it in a page, an app or a repository.
Add the key to the link you already build. Your project's home in the dashboard shows this frame with your key filled in:
<iframe
src="https://www.kiosk.money/pay?pk=pk_…&chain=polygon&token=USDC"
title="kiosk checkout"
allow="clipboard-write; camera"
style="border:0;border-radius:28px;width:100%;max-width:400px;height:680px"
></iframe>Partner dashboard
Choose where it can appear.
With a key or a session in the link, the widget loads only inside the sites you allow. Anywhere else, it stays blank.
- Add each site as the browser names it:
https://, the host and the port if there is one, and nothing after. For examplehttps://app.example.com. - The
kiosk:paidmessage goes to your allowed sites and to no one else, whateverreturnsays. A popup opened from one of them gets it too. - With no allowed site, a link with a key or a session loads nowhere. Add your site before you ship.
- A link with neither
pknorsessionstays as open as before: any page may frame it.
Server API
Fix the payment on your server.
A checkout session holds a payment your server decided. The payer opens it and can change neither the amount nor the recipient.
Create a session
POST /api/v1/sessionsSend the pay link's parameters as a JSON object, under the same names. Here to and amount are required. Values are strings or numbers, and a name the link does not take is refused.
curl https://www.kiosk.money/api/v1/sessions \
-H "Authorization: Bearer sk_…" \
-H "Content-Type: application/json" \
-d '{
"chain": "polygon",
"token": "USDC",
"to": "0x…",
"amount": "96",
"ref": "INV-2026-0142",
"return": "https://your.app/invoices/INV-2026-0142"
}'The answer
201{
"id": "cs_…",
"url": "https://www.kiosk.money/pay?session=cs_…",
"status": "open",
"reference": "INV-2026-0142",
"expires_at": "2026-11-19T14:03:11.482Z"
}Frame url the way step 2 frames a link, or send the payer to it. Keep id with your order. A session lasts 24 hours and can be paid once.
Read a session
GET /api/v1/sessions/{id}{
"id": "cs_…",
"status": "paid",
"reference": "INV-2026-0142",
"expires_at": "2026-11-19T14:03:11.482Z",
"amount_received": "96.31",
"tx": "0x…"
}amount_received is what arrived, in the token, and tx the transaction that delivered it; both are null until it is paid. A session of another project reads as not found.
Statuses
- open
- Not paid yet. The payer can open it until
expires_at; a payment started by then can still finish after it. - paid
- The session's token was delivered to its
to. - failed
- The payment did not go through, or what arrived was not the session's token at
to. The session is closed: create a new one to try again. - expired
- Nobody paid within 24 hours. No webhook is sent for it.
Compare what arrived before you fulfil.
paid means the session's token was delivered to its to, not how much of it. Compare amount_received with the amount you asked for before you fulfil the order.
Errors
A refused call answers with its HTTP status and a JSON body. param names the parameter when the error is about one, and message is for you to read, not for your code to match.
{
"error": {
"code": "invalid_request",
"message": "The amount parameter is missing or invalid.",
"param": "amount"
}
}| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The body is not a JSON object, names a parameter the link does not take, or has one missing or invalid. |
| 401 | unauthorized | No secret key, or one that is not valid or was turned off. |
| 404 | not_found | No session with that id for this key's project, or no endpoint at that path. |
| 405 | method_not_allowed | Sessions are created with POST and read with GET. |
| 500, 502 | server_error | Something failed on our side. Try again later; if it keeps failing, send us the ref from the body. |
Server API
Hear about it on your server.
Save an endpoint on the Webhooks page and we call it when a payment from your project ends, signed with the endpoint's signing secret.
Events
session.paid- A payment was delivered. Under a session, to its
to. session.failed- A payment did not go through.
test- Sent by the dashboard's Send a test webhook button, and tried once. Its data looks paid and is made up: never fulfil anything on it.
The body
{
"id": "evt_…",
"type": "session.paid",
"created": "2026-11-18T14:09:52.118Z",
"data": {
"session": "cs_…",
"reference": "INV-2026-0142",
"status": "paid",
"chain": 137,
"token": "USDC",
"amount_received": "96.31",
"tx": "0x…"
}
}id- The event's own id. Retries carry the same one: handle it once.
typesession.paid,session.failedortest.created- When the event was created, in ISO 8601.
data.session- The session's id, or
nullfor a payment made with a publishable key alone. data.reference- Your
ref, ornull. data.statuspaidorfailed.data.chain- The network, by chain id.
data.token- The token's symbol.
data.amount_received- What arrived, in the token.
nullunless paid. data.tx- The transaction that delivered it, or
null.
A key-only payment is a notification.
A webhook for a payment made with a publishable key alone has session: null. Its link was set in the payer's browser, so it tells you a payment happened, not who was paid. To act on a payment, use a session's webhook or read the session.
Verify the signature
Every call carries a Kiosk-Signature header: t=1763474992,v1=5f2b…. t is when it was signed, in seconds, and v1 is HMAC-SHA256 of t, a dot and the raw body, keyed with your signing secret (whsec_…), in hex. Recompute it before you parse the body, compare in constant time, and refuse an old t.
import { createHmac, timingSafeEqual } from "node:crypto";
// rawBody: the request body exactly as it arrived, before any JSON parsing.
// secret: your signing secret (whsec_…), kept on your server.
function verifyKioskSignature(rawBody, header, secret, toleranceSeconds = 300) {
const parts = Object.fromEntries(String(header ?? "").split(",").map((part) => part.split("=", 2)));
const t = Number(parts.t);
if (!Number.isInteger(t) || !parts.v1) return false;
if (Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false; // too old: a replay
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
const given = Buffer.from(parts.v1, "hex");
return given.length === expected.length && timingSafeEqual(given, expected);
}Parse the JSON only once the signature checks out. With Express, take the route's body with express.raw(), not express.json(), so you hold the bytes that were signed.
Delivery
Answer with a 2xx within 10 seconds and the call counts as delivered; redirects are not followed. Answer first and do the work after. Anything else is tried again:
- Right away
- 1 min
- 5 min
- 30 min
- 2 h
- 6 h
- 12 h
Seven attempts over about 21 hours, then the delivery is marked failed. The Webhooks page lists the latest deliveries and can send any of them again.
Live configurator
See it before you build.
Pick what arrives and how it looks. The widget here is the real one and follows every choice, and the snippet is ready to paste.
<iframe
src="https://www.kiosk.money/pay?chain=polygon&token=USDC"
title="kiosk checkout"
allow="clipboard-write; camera"
style="border:0;border-radius:28px;width:100%;max-width:400px;height:680px"
></iframe>This snippet presets the token and the network. To send to your own address or fix an amount, build the link in step 1.