# Retrieve an embedded session receipt

> Used by the TapPay checkout script to show the receipt after the customer has paid.

Source: https://docs.tappay.mn/reference/embedded-sessions/get-receipt/

Used by the TapPay checkout script to show the [receipt](https://docs.tappay.mn/glossary.md#receipt) after the [customer](https://docs.tappay.mn/glossary.md#customer) has paid. It needs your [publishable key](https://docs.tappay.mn/glossary.md#publishable-key) and the `X-Client-Secret` header.

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

### Authentication

Publishable key + X-Client-Secret

### Headers

| Name | Type | Required | Values | Description |
| - | - | - | - | - |
| `X-Client-Secret` | string | yes | | |

### Path parameters

| Name | Type | Required | Values | Description |
| - | - | - | - | - |
| `id` | string (uuid) | yes | | |

### Response 200

| Name | Type | Required | Values | Description |
| - | - | - | - | - |
| `success` | boolean | yes | `true` | |
| `data` | object \| null | yes | | |
| `data.receipt` | object | yes | | |
| `data.receipt.id` | string (uuid) | yes | | |
| `data.receipt.status` | string | yes | `PENDING`, `REGISTERED`, `FAILED`, `RETURNED` | |
| `data.receipt.issuer` | string | yes | `MERCHANT`, `NODE` | |
| `data.receipt.receiptType` | string \| null | yes | `B2C`, `B2B`, `SALES`, `null` | |
| `data.receipt.ddtd` | string \| null | yes | | |
| `data.receipt.lottery` | string \| null | yes | | |
| `data.receipt.qrData` | string \| null | yes | | |
| `data.receipt.url` | string \| null | yes | | |
| `data.receipt.merchantReceiptNo` | string \| null | yes | | |
| `data.receipt.amount` | string \| null | yes | | |
| `data.receipt.vat` | string \| null | yes | | |
| `data.receipt.cityTax` | string \| null | yes | | |
| `data.receipt.issuedAt` | string \| null | yes | | |
| `data.receipt.returnedAt` | string \| null | yes | | |
| `data.receipt.failureReason` | string \| null | yes | | |
| `data.receipt.lines` | array \| null | yes | | |
| `data.receipt.attempts` | integer | yes | | |
| `data.receipt.nextAttemptAt` | string \| null | yes | | |
| `data.receipt.recipientFallback` | boolean | yes | | |
| `data.receipt.parts` | array \| null | yes | | |
| `data.history` | array\<object> | yes | | |
| `data.history[].id` | string (uuid) | yes | | |
| `data.history[].status` | string | yes | `PENDING`, `REGISTERED`, `FAILED`, `RETURNED` | |
| `data.history[].issuer` | string | yes | `MERCHANT`, `NODE` | |
| `data.history[].receiptType` | string \| null | yes | `B2C`, `B2B`, `SALES`, `null` | |
| `data.history[].ddtd` | string \| null | yes | | |
| `data.history[].lottery` | string \| null | yes | | |
| `data.history[].qrData` | string \| null | yes | | |
| `data.history[].url` | string \| null | yes | | |
| `data.history[].merchantReceiptNo` | string \| null | yes | | |
| `data.history[].amount` | string \| null | yes | | |
| `data.history[].vat` | string \| null | yes | | |
| `data.history[].cityTax` | string \| null | yes | | |
| `data.history[].issuedAt` | string \| null | yes | | |
| `data.history[].returnedAt` | string \| null | yes | | |
| `data.history[].failureReason` | string \| null | yes | | |
| `data.history[].lines` | array \| null | yes | | |
| `data.history[].attempts` | integer | yes | | |
| `data.history[].nextAttemptAt` | string \| null | yes | | |
| `data.history[].recipientFallback` | boolean | yes | | |
| `data.history[].parts` | array \| null | yes | | |

### Errors

| Code | Status | Message |
| - | - | - |
| [`VAL-014`](https://docs.tappay.mn/errors.md#VAL-014) | 400 | The TapPay-Version header is not a known API version. |
| [`AUTH-001`](https://docs.tappay.mn/errors.md#AUTH-001) | 401 | The API key is missing, invalid or revoked. |
| [`AUTH-058`](https://docs.tappay.mn/errors.md#AUTH-058) | 403 | The API key does not have the scope this operation requires. |
| [`PAY-034`](https://docs.tappay.mn/errors.md#PAY-034) | 404 | The checkout session was not found, or the client secret does not match. |
| [`BIZ-004`](https://docs.tappay.mn/errors.md#BIZ-004) | 403 | The terminal is not active. |
| [`BIZ-005`](https://docs.tappay.mn/errors.md#BIZ-005) | 403 | The merchant account is not in a state that allows this request. |

Try it in the playground: https://docs.tappay.mn/reference/embedded-sessions/get-receipt/

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

```bash title="curl"
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"
```

```js title="Node.js"
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());
```

```php title="PHP"
<?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);
```

```python title="Python"
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())
```

```json title="Response"
{
  "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": []
  }
}
```

> **Note:** **Receipt after finalize**
>
> For a [pre-auth](https://docs.tappay.mn/glossary.md#pre-auth) [payment](https://docs.tappay.mn/glossary.md#payment) TapPay issues the tax receipt after you [finalize](https://docs.tappay.mn/glossary.md#finalize), for the final amount. Before that the response has no receipt.

> **Warning:** **Publishable key only**
>
> This call is made by the page of the customer. It needs your publishable key and the `clientSecret`. A [secret key](https://docs.tappay.mn/glossary.md#secret-key) is refused with `AUTH-058`.

For the full flow, read the [guide](https://docs.tappay.mn/guides/receipts.md).
