Send a bill to a sticker
Overview
A TapPay sticker has a QR code and an NFC chip, and it is linked to one of your terminals. Your till system can send a bill to a sticker, so the customer taps or scans it and sees the amount already filled in. The API only reads your stickers, because you link, assign and close them in the merchant portal.
Before you begin
Your key needs stickers:read in its scope to read stickers, and payments:write to send a bill. You use your secret key, shown below as sk_test_YOUR_SECRET_KEY. Link a printed sticker to your terminal in the portal first, as in TapPay stickers. In the sandbox every cashier already has a test sticker, so you do not need a printed one.
Steps
List your stickers
List the stickers of your merchant, and filter them by terminalId or by status. Each sticker has an id, the serialNo (SN) printed on its front, its terminalId and its stickerType. A PAYMENT sticker takes bills. A SERVICE sticker opens the page of the system it is assigned to. A sandbox test sticker has virtual set to true.
curl -sS "https://api.tappay.mn/api/v1/stickers?status=ACTIVE" \
-H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
-H "TapPay-Version: 2026-09-27"import { TapPay } from '@tappay-mn/node';
const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const page = await tappay.stickers.list({ query: { status: 'ACTIVE' } }).firstPage();
console.log(JSON.stringify(page));<?php
require 'vendor/autoload.php';
use TapPay\TapPay;
$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$page = $tappay->stickers->list(['query' => ['status' => 'ACTIVE']])->firstPage();
echo json_encode(['data' => $page->data, 'hasMore' => $page->hasMore, 'nextCursor' => $page->nextCursor]);import json
import tappay
client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
page = client.stickers.list({"status": "ACTIVE"}).first_page()
print(json.dumps({"data": page.data, "has_more": page.has_more, "next_cursor": page.next_cursor}))Read a sticker
Read one sticker by its id. It shows the cashier (paymentPointId), the service (merchantServiceId), the system it is assigned to and lastScannedAt. A sticker.* event carries only the id of the sticker, so read the sticker after each one.
curl -sS "https://api.tappay.mn/api/v1/stickers/STICKER_ID" \
-H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
-H "TapPay-Version: 2026-09-27"import { TapPay } from '@tappay-mn/node';
const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const sticker = await tappay.stickers.retrieve({ id: 'STICKER_ID' });
console.log(JSON.stringify(sticker));<?php
require 'vendor/autoload.php';
use TapPay\TapPay;
$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$sticker = $tappay->stickers->retrieve(['id' => 'STICKER_ID']);
echo json_encode($sticker);import json
import tappay
client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
sticker = client.stickers.retrieve({"id": "STICKER_ID"})
print(json.dumps(sticker))Send a bill to the sticker
Create an invoice and set sticker to the SN. TapPay links its intent to the sticker and takes the terminal from the sticker. Do not send paymentPointId together with sticker. When a customer taps or scans the sticker, the payment page of this intent opens. If several open bills are linked to one sticker, the latest one opens.
curl -sS -X POST "https://api.tappay.mn/api/v1/invoices" \
-H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
-H "TapPay-Version: 2026-09-27" \
-H "Idempotency-Key: $(openssl rand -hex 16)" \
-H "Content-Type: application/json" \
-d '{"amount":1000,"description":"Table 4","orderId":"bill-'"$(uuidgen)"'","sticker":"STICKER_SN"}'import { TapPay } from '@tappay-mn/node';
const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const invoice = await tappay.invoices.create({
body: {
amount: 1000,
description: 'Table 4',
orderId: `bill-${crypto.randomUUID()}`,
sticker: 'STICKER_SN',
},
});
console.log(JSON.stringify(invoice));<?php
require 'vendor/autoload.php';
use TapPay\TapPay;
$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$invoice = $tappay->invoices->create([
'body' => [
'amount' => 1000,
'description' => 'Table 4',
'orderId' => 'bill-' . vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4)) . '',
'sticker' => 'STICKER_SN',
],
]);
echo json_encode($invoice);import json
import uuid
import tappay
client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
invoice = client.invoices.create({
"body": {
"amount": 1000,
"description": "Table 4",
"orderId": "bill-" + str(uuid.uuid4()) + "",
"sticker": "STICKER_SN",
},
})
print(json.dumps(invoice))Pay in the sandbox
Let the simulator pay the bill, as if a customer scanned the sticker. This works only with a sandbox key, and the response has the id of the payment.
curl -sS -X POST "https://api.tappay.mn/api/v1/sandbox/intents/INTENT_ID/simulate" \
-H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
-H "TapPay-Version: 2026-09-27" \
-H "Idempotency-Key: $(openssl rand -hex 16)" \
-H "Content-Type: application/json" \
-d '{"channel":"QR","outcome":"SUCCEEDED"}'import { TapPay } from '@tappay-mn/node';
const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const result = await tappay.sandbox.simulateIntent({ id: 'INTENT_ID', body: { channel: 'QR', outcome: 'SUCCEEDED' } });
console.log(JSON.stringify(result));<?php
require 'vendor/autoload.php';
use TapPay\TapPay;
$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$result = $tappay->sandbox->simulateIntent(['id' => 'INTENT_ID', 'body' => ['channel' => 'QR', 'outcome' => 'SUCCEEDED']]);
echo json_encode($result);import json
import tappay
client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
result = client.sandbox.simulate_intent({"id": "INTENT_ID", "body": {"channel": "QR", "outcome": "SUCCEEDED"}})
print(json.dumps(result))Verify
When the bill is paid, TapPay sends payment.succeeded to your webhook endpoint, as described in the webhooks guide. Read the payment: its sticker holds the serialNo, sqrRef and name of the sticker, and it is null when no sticker took the payment.
The sticker opens your bill only while the intent is open and has not expired. The sticker must also stay on the same terminal and keep the same assignment. If one of these changes, the sticker opens its usual page, and your bill can still be paid through its own deeplink.
The response of your invoice has a deeplink to the TapPay page. To show wallet buttons on your own screen instead, add expand[]=walletLinks, as in the mobile app guide. Set returnUrl and cancelUrl to a page of your system.
Sticker events
TapPay sends these events when a sticker that is assigned to your system changes.
| Event | When |
|---|---|
sticker.assigned | The sticker was assigned to your system, or moved to another terminal. Read it to learn the new terminal. |
sticker.unassigned | The sticker is no longer assigned to your system. |
sticker.closed | The sticker was closed, for example because it was lost or damaged. |
sticker.replaced | A new sticker took the place of an old one. objectId is the new sticker, and its replaces names the old one. |
A replacement sends only sticker.replaced, so move your table or cashier to the new sticker in one step.
Common mistakes
- Leaving the intent of a closed bill open. The next customer who scans the sticker sees the old bill until it expires, so cancel the intent.
- Sending
stickertogether withpaymentPointId. TapPay answers400VAL-001. - Using a wrong SN, or a sticker that is closed, belongs to another merchant or is assigned to a service. TapPay answers
404QR-016 in each case. - Using a terminal-level key for a sticker on another terminal. TapPay also answers
404QR-016. - Sending a bill to a sticker that is assigned to another system. Only that system may send bills to it, so TapPay answers
403QR-021. - Trying to link, assign or close a sticker with the API. Do it in the merchant portal, as in TapPay stickers.
Next steps
Handle payments with the webhooks guide, and show a bill as a QR code with the QR payments guide. See every field in List stickers, Retrieve a sticker and Create an invoice.