Present an embedded session
Used by the TapPay checkout script when the customer picks a payment channel. It returns what the customer needs to pay and records the customer’s consent.
Changes in 2026-09-27This operation is not available in this version.
POST /api/checkout/embedded/sessions/{id}/present
Authentication
Publishable key + X-Client-Secret
Headers
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
X-Client-Secret | string | yes | ||
Idempotency-Key | string | yes |
Path parameters
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
id | string (uuid) | yes |
Request body
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
channel | string | yes | QPAY, NODE_QR, WECHAT, CARD, R2P | |
consent | boolean | no |
Response 201
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
success | boolean | yes | true | |
data | object | yes | ||
data.kind | string | yes | CARD, PRESENTATION | |
data.attemptToken | string | no | ||
data.presentation | object | no | ||
data.presentation.channel | string | yes | QPAY, NODE_QR, WECHAT, CARD, R2P | |
data.presentation.display | string | yes | CARD_FORM, QR, WALLET_REQUEST | |
data.presentation.qrText | string | null | yes | ||
data.presentation.links | array<object> | yes | ||
data.presentation.links[].label | string | yes | ||
data.presentation.links[].logoUrl | string | null | yes | ||
data.presentation.links[].url | string | yes | ||
data.presentation.expiresAt | string | yes |
Errors
| Code | Status | Message |
|---|---|---|
VAL-002 | 400 | A required field or header is missing. |
VAL-010 | 409 | This Idempotency-Key was already used with a different request body. |
VAL-013 | 409 | A request with this Idempotency-Key is still being processed. |
VAL-014 | 400 | The TapPay-Version header is not a known API version. |
AUTH-001 | 401 | The API key is missing, invalid or revoked. |
AUTH-058 | 403 | The API key does not have the scope this operation requires. |
PAY-001 | 404 | The invoice was not found. |
PAY-010 | 422 | The requested payment channel is not available for this payment. |
PAY-012 | 409 | The payment intent is no longer open. |
PAY-033 | 409 | The checkout session is not open. |
PAY-034 | 404 | The checkout session was not found, or the client secret does not match. |
PAY-035 | 422 | The payer's consent is required for this payment. |
BIZ-004 | 403 | The terminal is not active. |
BIZ-005 | 403 | The merchant account is not in a state that allows this request. |
AFP-003 | 410 | The payment intent has expired. |
PSP-003 | 422 | The provider terminal required for this payment is not configured. |
curl -sS -X POST "https://api.tappay.mn/api/checkout/embedded/sessions/SESSION_ID/present" \
-H "Authorization: Bearer pk_test_YOUR_PUBLISHABLE_KEY" \
-H "X-Client-Secret: CLIENT_SECRET" \
-H "TapPay-Version: 2026-09-27" \
-H "Idempotency-Key: $(openssl rand -hex 16)" \
-H "Content-Type: application/json" \
-d '{"channel":"CARD","consent":true}'The SDKs do not cover this API (browser checkout script) — the example calls HTTP directly.
const res = await fetch('https://api.tappay.mn/api/checkout/embedded/sessions/SESSION_ID/present', {
method: 'POST',
headers: {
Authorization: 'Bearer pk_test_YOUR_PUBLISHABLE_KEY',
'X-Client-Secret': 'CLIENT_SECRET',
'TapPay-Version': '2026-09-27',
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
channel: 'CARD',
consent: true,
}),
});
console.log(await res.text());The SDKs do not cover this API (browser checkout script) — the example calls HTTP directly.
<?php
$body = json_encode([
'channel' => 'CARD',
'consent' => true,
]);
$ch = curl_init('https://api.tappay.mn/api/checkout/embedded/sessions/SESSION_ID/present');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer pk_test_YOUR_PUBLISHABLE_KEY',
'X-Client-Secret: CLIENT_SECRET',
'TapPay-Version: 2026-09-27',
'Idempotency-Key: ' . bin2hex(random_bytes(16)),
'Content-Type: application/json',
],
]);
echo curl_exec($ch);The SDKs do not cover this API (browser checkout script) — the example calls HTTP directly.
import json, urllib.request, uuid
req = urllib.request.Request(
'https://api.tappay.mn/api/checkout/embedded/sessions/SESSION_ID/present',
data=json.dumps({
'channel': 'CARD',
'consent': True,
}).encode(),
method='POST',
headers={
'Authorization': 'Bearer pk_test_YOUR_PUBLISHABLE_KEY',
'X-Client-Secret': 'CLIENT_SECRET',
'TapPay-Version': '2026-09-27',
'Idempotency-Key': str(uuid.uuid4()),
'Content-Type': 'application/json',
},
)
print(urllib.request.urlopen(req).read().decode()){
"success": true,
"data": {
"kind": "CARD",
"attemptToken": "att_7f3a91c2d4e8"
}
}
For the full flow, read the guide.