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/exportThe 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)
Accept | Response |
|---|---|
text/csv | A 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 / absent | A 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.
| Field | Type | Required | Description |
|---|---|---|---|
deal_type | string | No | "PAYIN" or "PAYOUT"; empty = both directions (UNION). |
statuses | array | No | A repeating parameter: statuses=COMPLETED&statuses=EXPIRED (database status names — see the Status reference). |
created_after | string(RFC3339) | No | The lower bound of the creation time (inclusive). |
created_before | string(RFC3339) | No | The 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-e1e1b1ea1bc2Live 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:100000minor units =1000.00in the CSV);type—PAYIN|PAYOUT;counterparty— the deal's counterparty: the payer'sclient_idforPAYIN(empty when not passed at creation) or the recipient'starget_requisiteforPAYOUT.
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
}| Field | Type | Description |
|---|---|---|
csv | string | The full CSV document (the header + row_count data rows). |
file_name | string | The recommended file name deals-YYYYMMDD.csv (the UTC date of the export). |
row_count | int32 | The number of data rows, excluding the header. |
truncated | bool | true = 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: truein JSON mode). Narrow thecreated_after/created_beforewindow. - Filters are not strictly validated: an unknown
deal_typeor status yields200with 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
EXPIREDandSPAM_REJECTED(unlike turnover, where unsuccessful deals are excluded).
Related materials
- Deal listing — the paginated UNION listing with the same filters.
- Deal turnover — daily aggregates for the cabinet charts.