Nice Paydocs API version 2026-12-01 OpenAPI

Reports (CSV exports)

A report is a CSV export made from our ledger: your balance transactions, pay-ins or payouts for one currency and a range of your own days. It is made in the background; you ask for it, wait for report.ready, and download it.

Ask for a report

POST /v1/reportsReference

Request

FieldNotes
kindbalance_transactions, payins or payouts
currencyINR (the default) or USDT
from, toYYYY-MM-DD, both inclusive. Days are your merchant time zone's days (shown as time_zone on the report); at most 92 of them

Response

202 with the report in status queued. It becomes ready — or failed, with error — and you get the event report.ready.

Errors

400 invalid_request when from is after to or the range is longer than 92 days.

Download it

GET /v1/reports/{id}Reference

Once the report is ready, it carries download_url, a short-lived link (see download_expires_at). Download the file at once and do not store the link — fetch the report again for a fresh one. row_count and sha256 let you check what you got. The file is UTF-8 with a byte-order mark, so it opens cleanly in spreadsheet programs.

Example

runs in CI samples/ts/report.ts samples/php/report.php
// Reports: a CSV of your balance transactions (or pay-ins, payouts) for your own days.
//   bun report.ts 2026-11-01 2026-11-30
import { NicePay, type Report } from "@nicepay/sdk-ts";

const nicepay = new NicePay({
  keyId: process.env["NICEPAY_KEY_ID"] ?? "",
  secret: process.env["NICEPAY_KEY_SECRET"] ?? "",
  ...(process.env["NICEPAY_API_BASE"] ? { baseUrl: process.env["NICEPAY_API_BASE"] } : {}),
});

const today = new Date().toISOString().slice(0, 10);
const from = process.argv[2] ?? today;
const to = process.argv[3] ?? today;

// Days are your merchant time zone's days, inclusive; at most 92 of them.
let report: Report = await nicepay.createReport({ kind: "balance_transactions", currency: "INR", from, to });
console.log(`report ${report.id} ${report.status} (${report.time_zone})`);

// It is made in the background (you also get a report.ready event). Poll gently.
for (let i = 0; i < 60 && report.status === "queued"; i += 1) {
  await new Promise((resolve) => setTimeout(resolve, 1000));
  report = await nicepay.getReport(report.id);
}
if (report.status !== "ready" || !report.download_url) throw new Error(`report ${report.status}: ${String(report.error)}`);

// The link is short-lived: fetch it now, don't store it. UTF-8 with a byte-order mark.
let csv = await (await fetch(report.download_url)).text();
if (csv.charCodeAt(0) === 0xfeff) csv = csv.slice(1); // the byte-order mark
const [header, ...rows] = csv.trim().split("\n");
console.log(`ready: ${String(report.row_count)} rows, sha256 ${String(report.sha256).slice(0, 12)}…`);
console.log(`columns: ${String(header)}`);
console.log(`data lines: ${String(rows.length)}`);

Reconcile daily

Once a day, export yesterday's balance transactions (or page through GET/v1/balance-transactions) and match each entry to your own records by its source (type and id). Every credit, fee, payout reserve, release and reversal is an entry; they add up to your balance exactly.