Skip to content

Retrieve an embedded session receipt

View as Markdown

Used by the TapPay checkout script to show the receipt after the customer has paid. It needs your publishable key and the X-Client-Secret header.

Changes in 2026-09-27

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

Authentication

Publishable key + X-Client-Secret

Headers

NameTypeRequiredValuesDescription
X-Client-Secretstringyes

Path parameters

NameTypeRequiredValuesDescription
idstring (uuid)yes

Response 200

NameTypeRequiredValuesDescription
successbooleanyestrue
dataobject | nullyes
data.receiptobjectyes
data.receipt.idstring (uuid)yes
data.receipt.statusstringyesPENDING, REGISTERED, FAILED, RETURNED
data.receipt.issuerstringyesMERCHANT, NODE
data.receipt.receiptTypestring | nullyesB2C, B2B, SALES, null
data.receipt.ddtdstring | nullyes
data.receipt.lotterystring | nullyes
data.receipt.qrDatastring | nullyes
data.receipt.urlstring | nullyes
data.receipt.merchantReceiptNostring | nullyes
data.receipt.amountstring | nullyes
data.receipt.vatstring | nullyes
data.receipt.cityTaxstring | nullyes
data.receipt.issuedAtstring | nullyes
data.receipt.returnedAtstring | nullyes
data.receipt.failureReasonstring | nullyes
data.receipt.linesarray | nullyes
data.receipt.attemptsintegeryes
data.receipt.nextAttemptAtstring | nullyes
data.receipt.recipientFallbackbooleanyes
data.receipt.partsarray | nullyes
data.historyarray<object>yes
data.history[].idstring (uuid)yes
data.history[].statusstringyesPENDING, REGISTERED, FAILED, RETURNED
data.history[].issuerstringyesMERCHANT, NODE
data.history[].receiptTypestring | nullyesB2C, B2B, SALES, null
data.history[].ddtdstring | nullyes
data.history[].lotterystring | nullyes
data.history[].qrDatastring | nullyes
data.history[].urlstring | nullyes
data.history[].merchantReceiptNostring | nullyes
data.history[].amountstring | nullyes
data.history[].vatstring | nullyes
data.history[].cityTaxstring | nullyes
data.history[].issuedAtstring | nullyes
data.history[].returnedAtstring | nullyes
data.history[].failureReasonstring | nullyes
data.history[].linesarray | nullyes
data.history[].attemptsintegeryes
data.history[].nextAttemptAtstring | nullyes
data.history[].recipientFallbackbooleanyes
data.history[].partsarray | nullyes

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.
curl -sS "https://api.tappay.mn/api/checkout/embedded/sessions/SESSION_ID/receipt" \
  -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/receipt', {
  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/receipt');
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/receipt',
    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": {
    "receipt": {
      "id": "0192f8a4-1b2c-7d3e-8f40-5a6b7c8d9e0a",
      "status": "PENDING",
      "issuer": "NODE",
      "receiptType": null,
      "ddtd": null,
      "lottery": null,
      "qrData": null,
      "url": null,
      "merchantReceiptNo": null,
      "amount": "900",
      "vat": null,
      "cityTax": null,
      "issuedAt": null,
      "returnedAt": null,
      "failureReason": null,
      "lines": null,
      "attempts": 0,
      "nextAttemptAt": null,
      "recipientFallback": false,
      "parts": null
    },
    "history": []
  }
}

For the full flow, read the guide.