S
docs.syncra.money
Finance

CSV export of deals (Export)

Exporting the merchant's deal history (PayIn + PayOut) as CSV — filters, document format, and limits

CSV export of deals (Export)

The export endpoint produces the merchant's deals — PayIn (orders) and PayOut (payouts), unioned by the deal listing rules — as a CSV document. The filters are identical to the listing's, so the export matches what the merchant sees in the list one to one.


Request

GET /api/v1/p2p/merchant/deals/export

The canonical export path lives inside the merchant prefix: /api/v1/p2p/merchant/deals/export. The historical mirror without the merchant prefix — GET /api/v1/p2p/deals/export — keeps working (wire-compat) and is considered deprecated: build new integrations on the canonical path. Authentication is the same HMAC pair (X-Merchant-Token / X-Timestamp / X-Signature), and the deal scope comes from the signed token (the IDOR pins match the listing's — an export can never leak to another merchant). The endpoint is dual-homed: it works with both the cabinet JWT (Bearer) and HMAC.

The Accept header (choosing the response format)

AcceptResponse
text/csvA raw CSV document: Content-Type: text/csv; charset=utf-8, Content-Disposition: attachment; filename="deals-YYYYMMDD.csv" (the UTC date of the export).
any other / absentA JSON envelope: the same document encoded in the csv field (see below).

Filter parameters (Query Parameters)

The filters match the listing one to one. There is no pagination — the export is capped on the server.

FieldTypeRequiredDescription
deal_typestringNo"PAYIN" or "PAYOUT"; empty = both directions (UNION).
statusesarrayNoA repeating parameter: statuses=COMPLETED&statuses=EXPIRED (database status names — see the Status reference).
created_afterstring(RFC3339)NoThe lower bound of the creation time (inclusive).
created_beforestring(RFC3339)NoThe upper bound of the creation time (inclusive).

Response

CSV mode (Accept: text/csv)

Live staging response headers:

HTTP/1.1 200 OK
Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="deals-20260823.csv"
X-Trace-Id: 56902dcf-e42a-413d-9f29-e1e1b1ea1bc2

Live body (the first rows of a real staging export):

id,date,type,amount,currency,status,counterparty
9512d99a-3bbc-4a32-acae-d6ad8bb7e32f,2026-08-23T19:04:28Z,PAYIN,1000.00,RUB,EXPIRED,
d1fc4e47-ce53-4a87-ab4a-5950be8080ac,2026-08-23T19:04:21Z,PAYIN,1000.00,RUB,EXPIRED,
359fb026-6dd7-4f7a-bfa7-aa54a5afb6cb,2026-08-23T19:04:09Z,PAYIN,1000.00,RUB,APPEALED,

The document format is RFC 4180:

  • the header is always id,date,type,amount,currency,status,counterparty;
  • row separators are CRLF;
  • fields containing commas, quotes, or line breaks are wrapped in quotes with inner quotes doubled;
  • date — ISO 8601 UTC (RFC3339);
  • amount — major units with a decimal point (kopecks / 100: 100000 minor units = 1000.00 in the CSV);
  • type — PAYIN | PAYOUT;
  • counterparty — the deal's counterparty: the payer's client_id for PAYIN (empty when not passed at creation) or the recipient's target_requisite for PAYOUT.

JSON mode (without Accept: text/csv)

{
  "csv": "id,date,type,amount,currency,status,counterparty\r\n9512d99a-3bbc-4a32-acae-d6ad8bb7e32f,2026-08-23T19:04:28Z,PAYIN,1000.00,RUB,EXPIRED,\r\n...",
  "file_name": "deals-20260823.csv",
  "row_count": 16,
  "truncated": false
}
FieldTypeDescription
csvstringThe full CSV document (the header + row_count data rows).
file_namestringThe recommended file name deals-YYYYMMDD.csv (the UTC date of the export).
row_countint32The number of data rows, excluding the header.
truncatedbooltrue = the cap of 10,000 rows was reached and the tail was cut off.

Limits and specifics

  • Cap: 10,000 data rows. The export is not paginated; when more deals fall under the filter, the document is cut off (truncated: true in JSON mode). Narrow the created_after/created_before window.
  • Filters are not strictly validated: an unknown deal_type or status yields 200 with an empty document (zero rows), not an error — same as the listing.
  • No statuses are excluded: the export includes every deal under the filter, including EXPIRED and SPAM_REJECTED (unlike turnover, where unsuccessful deals are excluded).

  • Deal listing — the paginated UNION listing with the same filters.
  • Deal turnover — daily aggregates for the cabinet charts.

On this page