Get started
Fastest path
- If you run a WooCommerce, OpenCart or Odoo store, connect with a plugin and write no code.
- If you have an iOS or Android app, follow the mobile app guide: your app talks to your server, and your server calls TapPay.
- If you use an AI coding tool, give it the docs, rules and MCP server from Build with AI.
- In the merchant portal, Developers › Docs › Get started has the sandbox progress, a demo store and a ready AI prompt.
What TapPay does
TapPay takes a payment from a customer for you. You create an invoice for an order, the invoice gets a payment intent, and when the customer pays, the intent becomes a payment.
Sandbox and production
The sandbox is a separate environment with its own keys. Sandbox keys start with sk_test_ and pk_test_, and production keys start with sk_live_ and pk_live_. In the sandbox no money moves, there is no payout, and the simulator pays for the customer. Webhooks are real in the sandbox, so you can test your whole flow.
No-code path
If you do not write code, create a checkout link or a QR code in the merchant portal and share it with your customers. Later you can move to the API without changing how you get paid. The no-code path explains the three ways, and each one links to its API guide.
Your first payment
Get a sandbox key
You do not need to create the key yourself. When you first sign in to the sandbox merchant portal, it creates a sandbox secret key and a webhook inbox for you. The portal shows the key once, so copy it then. If you lose it, issue new credentials under Developers › API keys & webhooks. The examples below show it as sk_test_YOUR_SECRET_KEY; replace it with your own key. Keep the key on your server only.
Authentication methods
You choose the authentication method for each system separately (Developers › API keys & webhooks). With API key, send Authorization: Bearer sk_…. With API key + HMAC, also send the TapPay-Timestamp, TapPay-Nonce and TapPay-Signature headers. With OAuth 2.0 Client Credentials, call /v1/oauth/token with your Client ID and Client Secret (client_secret_basic or client_secret_post) to get an access token, then call the API with Authorization: Bearer <access_token>. You can optionally set an IP restriction on each system. Changing the method revokes the system’s current credentials.
Create a checkout session
Ask TapPay for a checkout session. The response has the url where your customer pays and the intentId that you use in the next step.
curl -sS -X POST "https://api.tappay.mn/api/v1/checkout/sessions" \
-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 '{"terminalId":"YOUR_TERMINAL_ID","amount":"1000","description":"First test order","orderId":"order-'"$(uuidgen)"'","returnUrl":"https://example.com/return"}'import { TapPay } from '@tappay-mn/node';
const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const checkoutSession = await tappay.checkoutSessions.create({
body: {
terminalId: 'YOUR_TERMINAL_ID',
amount: '1000',
description: 'First test order',
orderId: `order-${crypto.randomUUID()}`,
returnUrl: 'https://example.com/return',
},
});
console.log(JSON.stringify(checkoutSession));<?php
require 'vendor/autoload.php';
use TapPay\TapPay;
$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$checkoutSession = $tappay->checkoutSessions->create([
'body' => [
'terminalId' => 'YOUR_TERMINAL_ID',
'amount' => '1000',
'description' => 'First test order',
'orderId' => 'order-' . vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4)) . '',
'returnUrl' => 'https://example.com/return',
],
]);
echo json_encode($checkoutSession);import json
import uuid
import tappay
client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
checkout_session = client.checkout_sessions.create({
"body": {
"terminalId": "YOUR_TERMINAL_ID",
"amount": "1000",
"description": "First test order",
"orderId": "order-" + str(uuid.uuid4()) + "",
"returnUrl": "https://example.com/return",
},
})
print(json.dumps(checkout_session))Pay in the sandbox
Open the url in a browser to see the page your customer sees. To skip typing a card, ask the simulator to pay the intent for the customer.
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))Check the result
Read the session from your server and look at its status. Do not trust the redirect to your returnUrl; the session is the source of truth.
curl -sS "https://api.tappay.mn/api/v1/checkout/sessions/SESSION_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 checkoutSession = await tappay.checkoutSessions.retrieve({ id: 'SESSION_ID' });
console.log(JSON.stringify(checkoutSession));<?php
require 'vendor/autoload.php';
use TapPay\TapPay;
$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$checkoutSession = $tappay->checkoutSessions->retrieve(['id' => 'SESSION_ID']);
echo json_encode($checkoutSession);import json
import tappay
client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
checkout_session = client.checkout_sessions.retrieve({"id": "SESSION_ID"})
print(json.dumps(checkout_session))Next steps
To call TapPay from your server, use an SDK for Node.js, PHP or Python. The Node.js, PHP and Python tabs above use them.
Build the real flow with the checkout guide, then listen for payments with the webhooks guide. The API reference describes every operation.
You can also send sandbox requests straight from the docs: see the playground.