Skip to content

Read reports and payouts

View as Markdown

Overview

A report lists your settlements, payouts, ledger entries or account statement for a period. A 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

Your key needs the reports:read scope, and you use your secret key, shown below as sk_test_YOUR_SECRET_KEY. The payout calls work only with a production key. A sandbox key has no payouts and no ledger, so those calls return an error, and the examples below expect it.

Steps

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.

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"}'
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
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);
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))

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.

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"
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
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);
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 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.

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"
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
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]);
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

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.

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"
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
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]]);
}
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}}))

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.

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"
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
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]]);
}
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

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.

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"}'
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
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]]);
}
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

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 and then read the payout. Handle them as in the webhooks guide. The status PAID appears only after the bank statement confirms the transfer.

Common mistakes

  • Calling a payout operation with a sandbox key. TapPay returns 403 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.
  • Using a saAccountId that is not yours. TapPay rejects it with EVT-305.
  • Requesting a PAYOUT, LEDGER or STATEMENT report with the key of a 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

Listen for payout events with the webhooks guide. See every field in Create a report, Retrieve a report, List reports, List payouts, Retrieve a payout and Create a payout.