# Read reports and payouts

> Request settlement and ledger reports, follow your payouts, and ask for a manual payout.

Source: https://docs.tappay.mn/guides/reports/

## Overview {#overview}

A [report](https://docs.tappay.mn/glossary.md#report) lists your [settlements](https://docs.tappay.mn/glossary.md#settlement), [payouts](https://docs.tappay.mn/glossary.md#payout), ledger entries or account statement for a period. A [payout](https://docs.tappay.mn/glossary.md#payout) sends the money that is available to your bank account. You request a report, wait until it is ready, and read payouts to follow your money.

## Before you begin {#before-you-begin}

Your key needs the `reports:read` [scope](https://docs.tappay.mn/glossary.md#scope), and you use your [secret key](https://docs.tappay.mn/glossary.md#secret-key), shown below as `sk_test_YOUR_SECRET_KEY`. The payout calls work only with a [production](https://docs.tappay.mn/glossary.md#production) key. A [sandbox](https://docs.tappay.mn/glossary.md#sandbox) key has no payouts and no ledger, so those calls return an error, and the examples below expect it.

## Steps {#steps}

### Request a report {#request-a-report}

Choose a `type` of `SETTLEMENT`, `PAYOUT`, `LEDGER` or `STATEMENT`, and a period with `from` and `to`. Dates use the `YYYY-MM-DD` format, and the period is at most 366 days. You can narrow the report with a `terminalId` or a `saAccountId`. TapPay builds the report in the background and answers with `202` and the report `id`.

```bash title="curl"
curl -sS -X POST "https://api.tappay.mn/api/v1/reports" \
  -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 '{"type":"SETTLEMENT","from":"2026-09-01","to":"2026-09-30"}'
```

```js title="Node.js"
import { TapPay } from '@tappay-mn/node';

const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const report = await tappay.reports.create({ body: { type: 'SETTLEMENT', from: '2026-09-01', to: '2026-09-30' } });
console.log(JSON.stringify(report));
```

```php title="PHP"
<?php
require 'vendor/autoload.php';

use TapPay\TapPay;

$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$report = $tappay->reports->create(['body' => ['type' => 'SETTLEMENT', 'from' => '2026-09-01', 'to' => '2026-09-30']]);
echo json_encode($report);
```

```python title="Python"
import json
import tappay

client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
report = client.reports.create({"body": {"type": "SETTLEMENT", "from": "2026-09-01", "to": "2026-09-30"}})
print(json.dumps(report))
```

> **Note:** **Reports in the sandbox**
>
> In the sandbox a report is created, but it holds no money data. There is no ledger and no payout there, so a `PAYOUT` or `LEDGER` report has only a header row.

### Check the report {#check-the-report}

Read the report until its `status` is `SUCCEEDED`. The status goes from `PENDING` to `RUNNING`, and then to `SUCCEEDED`, `FAILED` or `EXPIRED`. When the report succeeds, `rowCount` shows how many rows it has and `expiresAt` shows when it expires.

```bash title="curl"
curl -sS "https://api.tappay.mn/api/v1/reports/REPORT_ID" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
  -H "TapPay-Version: 2026-09-27"
```

```js title="Node.js"
import { TapPay } from '@tappay-mn/node';

const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const report = await tappay.reports.retrieve({ id: 'REPORT_ID' });
console.log(JSON.stringify(report));
```

```php title="PHP"
<?php
require 'vendor/autoload.php';

use TapPay\TapPay;

$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$report = $tappay->reports->retrieve(['id' => 'REPORT_ID']);
echo json_encode($report);
```

```python title="Python"
import json
import tappay

client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
report = client.reports.retrieve({"id": "REPORT_ID"})
print(json.dumps(report))
```

### List your reports {#list-your-reports}

List your reports with `limit`. If `hasMore` is `true`, send `nextCursor` as the `cursor` of the next request. Each item has the same fields as the single report above.

```bash title="curl"
curl -sS "https://api.tappay.mn/api/v1/reports?limit=10" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
  -H "TapPay-Version: 2026-09-27"
```

```js title="Node.js"
import { TapPay } from '@tappay-mn/node';

const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const page = await tappay.reports.list({ query: { limit: '10' } }).firstPage();
console.log(JSON.stringify(page));
```

```php title="PHP"
<?php
require 'vendor/autoload.php';

use TapPay\TapPay;

$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$page = $tappay->reports->list(['query' => ['limit' => '10']])->firstPage();
echo json_encode(['data' => $page->data, 'hasMore' => $page->hasMore, 'nextCursor' => $page->nextCursor]);
```

```python title="Python"
import json
import tappay

client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
page = client.reports.list({"limit": "10"}).first_page()
print(json.dumps({"data": page.data, "has_more": page.has_more, "next_cursor": page.next_cursor}))
```

### List your payouts {#list-your-payouts}

Filter payouts with `status`, `from` and `to`. A payout has a `kind`, which is `SCHEDULED` or `MANUAL`, an `amount`, a `payoutFee` and a `manualFee`. Its `status` is `PENDING`, `SCHEDULED`, `IN_TRANSIT`, `PAID` or `FAILED`.

```bash title="curl"
curl -sS "https://api.tappay.mn/api/v1/payouts?status=PAID&limit=10" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
  -H "TapPay-Version: 2026-09-27"
```

```js title="Node.js"
import { TapPay, TapPayError } from '@tappay-mn/node';

const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
try {
  const page = await tappay.payouts.list({ query: { status: 'PAID', limit: '10' } }).firstPage();
  console.log(JSON.stringify(page));
} catch (e) {
  if (!(e instanceof TapPayError)) throw e;
  console.log(JSON.stringify({ error: { code: e.code, status: e.status } }));
}
```

```php title="PHP"
<?php
require 'vendor/autoload.php';

use TapPay\TapPay;
use TapPay\Exception\TapPayError;

$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
try {
    $page = $tappay->payouts->list(['query' => ['status' => 'PAID', 'limit' => '10']])->firstPage();
    echo json_encode(['data' => $page->data, 'hasMore' => $page->hasMore, 'nextCursor' => $page->nextCursor]);
} catch (TapPayError $e) {
    echo json_encode(['error' => ['code' => $e->code, 'status' => $e->status]]);
}
```

```python title="Python"
import json
import tappay

client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
try:
    page = client.payouts.list({"status": "PAID", "limit": "10"}).first_page()
    print(json.dumps({"data": page.data, "has_more": page.has_more, "next_cursor": page.next_cursor}))
except tappay.TapPayError as e:
    print(json.dumps({"error": {"code": e.code, "status": e.status}}))
```

> **Warning:** **No payouts in the sandbox**
>
> A sandbox key cannot call any payout operation. TapPay answers with the status `403` and the code [EVT-201](https://docs.tappay.mn/errors.md#EVT-201). Run these calls with a production key, after you finish the [go-live checklist](https://docs.tappay.mn/go-live.md).

### Read one payout {#read-one-payout}

A single payout also lists the settlement cycles it paid in `items`, its `journals` and the bank `transfer`. If a payout ends as `FAILED`, its `failureReason` tells you why, and the amount returns to your available balance.

```bash title="curl"
curl -sS "https://api.tappay.mn/api/v1/payouts/00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
  -H "TapPay-Version: 2026-09-27"
```

```js title="Node.js"
import { TapPay, TapPayError } from '@tappay-mn/node';

const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
try {
  const payout = await tappay.payouts.retrieve({ id: '00000000-0000-0000-0000-000000000000' });
  console.log(JSON.stringify(payout));
} catch (e) {
  if (!(e instanceof TapPayError)) throw e;
  console.log(JSON.stringify({ error: { code: e.code, status: e.status } }));
}
```

```php title="PHP"
<?php
require 'vendor/autoload.php';

use TapPay\TapPay;
use TapPay\Exception\TapPayError;

$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
try {
    $payout = $tappay->payouts->retrieve(['id' => '00000000-0000-0000-0000-000000000000']);
    echo json_encode($payout);
} catch (TapPayError $e) {
    echo json_encode(['error' => ['code' => $e->code, 'status' => $e->status]]);
}
```

```python title="Python"
import json
import tappay

client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
try:
    payout = client.payouts.retrieve({"id": "00000000-0000-0000-0000-000000000000"})
    print(json.dumps(payout))
except tappay.TapPayError as e:
    print(json.dumps({"error": {"code": e.code, "status": e.status}}))
```

### Request a manual payout {#request-a-manual-payout}

Send the `saAccountId`, the `payoutAccountId` and the `amount`. A manual payout takes money from your available balance at once, outside your payout schedule, and adds the `manual_payout_fee`. It starts as `PENDING` while TapPay checks the request.

```bash title="curl"
curl -sS -X POST "https://api.tappay.mn/api/v1/payouts" \
  -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 '{"saAccountId":"00000000-0000-0000-0000-000000000000","payoutAccountId":"00000000-0000-0000-0000-000000000000","amount":"10000"}'
```

```js title="Node.js"
import { TapPay, TapPayError } from '@tappay-mn/node';

const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
try {
  const payout = await tappay.payouts.create({
    body: {
      saAccountId: '00000000-0000-0000-0000-000000000000',
      payoutAccountId: '00000000-0000-0000-0000-000000000000',
      amount: '10000',
    },
  });
  console.log(JSON.stringify(payout));
} catch (e) {
  if (!(e instanceof TapPayError)) throw e;
  console.log(JSON.stringify({ error: { code: e.code, status: e.status } }));
}
```

```php title="PHP"
<?php
require 'vendor/autoload.php';

use TapPay\TapPay;
use TapPay\Exception\TapPayError;

$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
try {
    $payout = $tappay->payouts->create([
        'body' => [
            'saAccountId' => '00000000-0000-0000-0000-000000000000',
            'payoutAccountId' => '00000000-0000-0000-0000-000000000000',
            'amount' => '10000',
        ],
    ]);
    echo json_encode($payout);
} catch (TapPayError $e) {
    echo json_encode(['error' => ['code' => $e->code, 'status' => $e->status]]);
}
```

```python title="Python"
import json
import tappay

client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
try:
    payout = client.payouts.create({
        "body": {
            "saAccountId": "00000000-0000-0000-0000-000000000000",
            "payoutAccountId": "00000000-0000-0000-0000-000000000000",
            "amount": "10000",
        },
    })
    print(json.dumps(payout))
except tappay.TapPayError as e:
    print(json.dumps({"error": {"code": e.code, "status": e.status}}))
```

## Verify {#verify}

For a report, read it with `GET` until the `status` is `SUCCEEDED`. For a payout, handle the `payout.requested`, `payout.scheduled`, `payout.in_transit`, `payout.paid` and `payout.failed` [events](https://docs.tappay.mn/glossary.md#event) and then read the payout. Handle them as in the [webhooks guide](https://docs.tappay.mn/guides/webhooks.md). The status `PAID` appears only after the bank statement confirms the transfer.

## Common mistakes {#common-mistakes}

- Calling a payout operation with a sandbox key. TapPay returns `403` [EVT-201](https://docs.tappay.mn/errors.md#EVT-201), because the sandbox has no payouts.
- Asking for a period longer than 366 days, or a `from` that is after `to`. TapPay rejects the request with [EVT-302](https://docs.tappay.mn/errors.md#EVT-302).
- Using a `saAccountId` that is not yours. TapPay rejects it with [EVT-305](https://docs.tappay.mn/errors.md#EVT-305).
- Requesting a `PAYOUT`, `LEDGER` or `STATEMENT` report with the key of a [terminal](https://docs.tappay.mn/glossary.md#terminal). Use a merchant-level key for these types.
- Treating `SCHEDULED` or `IN_TRANSIT` as money in your bank account. Wait for `PAID`.
- Forgetting the fee of a manual payout. Check `manualFee` and `payoutFee` in the response before you rely on the full amount.

## Next steps {#next-steps}

Listen for payout events with the [webhooks guide](https://docs.tappay.mn/guides/webhooks.md). See every field in [Create a report](https://docs.tappay.mn/reference/reports/create.md), [Retrieve a report](https://docs.tappay.mn/reference/reports/get.md), [List reports](https://docs.tappay.mn/reference/reports/list.md), [List payouts](https://docs.tappay.mn/reference/payouts/list.md), [Retrieve a payout](https://docs.tappay.mn/reference/payouts/get.md) and [Create a payout](https://docs.tappay.mn/reference/payouts/create.md).
