Skip to content

Retrieve an embedded session

View as Markdown

Used by the TapPay checkout script to load the session that you mounted in your page. It needs your publishable key and the session’s X-Client-Secret header.

Changes in 2026-09-27

GET /api/checkout/embedded/sessions/{id}

Authentication

Publishable key + X-Client-Secret

Headers

NameTypeRequiredValuesDescription
X-Client-Secretstringyes

Path parameters

NameTypeRequiredValuesDescription
idstring (uuid)yes

Response 200

NameTypeRequiredValuesDescription
successbooleanyestrue
dataobjectyes
data.idstringyes
data.modestringyesPAYMENT, SETUP, SUBSCRIPTION
data.uiModestringyesHOSTED, EMBEDDED
data.statusstringyesOPEN, COMPLETE, EXPIRED
data.merchantobjectyes
data.merchant.namestringyes
data.merchant.logoUrlstring | nullno
data.merchant.reviewUrlstring | nullno
data.amountnumberyes
data.serviceFeenumber | nullyes
data.totalnumberyes
data.currencystringyes
data.descriptionstring | nullyes
data.linesarray<object>yes
data.lines[].namestringyes
data.lines[].quantitystringyes
data.lines[].unitPricenumberyes
data.lines[].totalnumberyes
data.channelsarray<string>yes
data.shortDeeplinkstringyes
data.presentationsarray<object>yes
data.presentations[].channelstringyesQPAY, NODE_QR, WECHAT, CARD, R2P
data.presentations[].displaystringyesCARD_FORM, QR, WALLET_REQUEST
data.presentations[].qrTextstring | nullyes
data.presentations[].linksarray<object>yes
data.presentations[].links[].labelstringyes
data.presentations[].links[].logoUrlstring | nullyes
data.presentations[].links[].urlstringyes
data.presentations[].expiresAtstringyes
data.walletsarray<object>yes
data.wallets[].partnerIdstringyes
data.wallets[].appNamestringyes
data.wallets[].logoUrlstring | nullyes
data.wallets[].deeplinkstringyes
data.expiresAtstringyes
data.cancelUrlstring | nullno
data.usagestringnoUNSCHEDULED, RECURRING
data.resultobjectno
data.result.statusstringyesSUCCEEDED, PROCESSING, FAILED
data.result.channelstring | nullyesQPAY, NODE_QR, WECHAT, CARD, R2P, null
data.result.paymentIdstringno
data.result.maskedPanstringno
data.result.cardBrandstringno
data.redirectUrlstring | nullno
data.preauthobject | nullno
data.preauth.amountnumberyes
data.preauth.finalizeDueDatestringyes
data.subscriptionobject | nullno
data.subscription.purposestringyesSTART, CARD_UPDATE
data.subscription.planNamestringyes
data.subscription.amountnumberyes
data.subscription.currencystringyes
data.subscription.intervalstringyesDAY, WEEK, MONTH, YEAR
data.subscription.intervalCountintegeryes
data.subscription.trialDaysintegeryes

Errors

CodeStatusMessage
VAL-014400The TapPay-Version header is not a known API version.
AUTH-001401The API key is missing, invalid or revoked.
AUTH-058403The API key does not have the scope this operation requires.
PAY-034404The checkout session was not found, or the client secret does not match.
BIZ-004403The terminal is not active.
BIZ-005403The merchant account is not in a state that allows this request.
SET-002400A required platform setting is missing or unknown.
PSP-003422The provider terminal required for this payment is not configured.
curl -sS "https://api.tappay.mn/api/checkout/embedded/sessions/SESSION_ID" \
  -H "Authorization: Bearer pk_test_YOUR_PUBLISHABLE_KEY" \
  -H "X-Client-Secret: CLIENT_SECRET" \
  -H "TapPay-Version: 2026-09-27"

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', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer pk_test_YOUR_PUBLISHABLE_KEY',
    'X-Client-Secret': 'CLIENT_SECRET',
    'TapPay-Version': '2026-09-27',
  },
});
console.log(await res.text());

The SDKs do not cover this API (browser checkout script) — the example calls HTTP directly.

<?php
$ch = curl_init('https://api.tappay.mn/api/checkout/embedded/sessions/SESSION_ID');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer pk_test_YOUR_PUBLISHABLE_KEY',
        'X-Client-Secret: CLIENT_SECRET',
        'TapPay-Version: 2026-09-27',
    ],
]);
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',
    method='GET',
    headers={
        'Authorization': 'Bearer pk_test_YOUR_PUBLISHABLE_KEY',
        'X-Client-Secret': 'CLIENT_SECRET',
        'TapPay-Version': '2026-09-27',
    },
)
print(urllib.request.urlopen(req).read().decode())
{
  "success": true,
  "data": {
    "id": "0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e01",
    "mode": "PAYMENT",
    "uiMode": "EMBEDDED",
    "status": "OPEN",
    "merchant": {
      "name": "Demo Shop LLC",
      "logoUrl": null
    },
    "amount": 1000,
    "serviceFee": null,
    "total": 1000,
    "currency": "MNT",
    "description": "Order 1048",
    "lines": [],
    "channels": [
      "CARD"
    ],
    "environment": "SANDBOX",
    "shortDeeplink": "https://pay.tappay.mn/s/Ab3xK9",
    "presentations": [],
    "wallets": [],
    "expiresAt": "2026-10-03T08:45:00.000Z",
    "cancelUrl": "https://example.com/cancel",
    "usage": "RECURRING",
    "preauth": {
      "amount": 1000,
      "finalizeDueDate": "2026-10-10T08:15:00.000Z"
    }
  }
}

For the full flow, read the guide.