Export deals as CSV (canonical path)
Renders the merchant's deals — PayIn (orders) AND PayOut (payouts), UNION by the ListMerchantDeals canon — as an RFC 4180 CSV document. Filters match the listing one-to-one; no pagination (capped at 10 000 data rows, `truncated: true` when hit). `Accept: text/csv` returns the raw document with `Content-Disposition: attachment; filename="deals-YYYYMMDD.csv"`; any other Accept gets the JSON envelope (`csv`/`file_name`/`row_count`/`truncated`). The legacy mirror `GET /api/v1/p2p/deals/export` (no /merchant prefix) keeps working for wire-compat and is deprecated — build new integrations on this canonical path.
/api/v1/p2p/merchant/deals/exportRenders the merchant's deals — PayIn (orders) AND PayOut (payouts),
UNION by the ListMerchantDeals canon — as an RFC 4180 CSV document.
Filters match the listing one-to-one; no pagination (capped at
10 000 data rows, truncated: true when hit). Accept: text/csv
returns the raw document with
Content-Disposition: attachment; filename="deals-YYYYMMDD.csv";
any other Accept gets the JSON envelope
(csv/file_name/row_count/truncated).
The legacy mirror GET /api/v1/p2p/deals/export (no /merchant
prefix) keeps working for wire-compat and is deprecated — build new
integrations on this canonical path.
Authorization
MerchantToken MerchantSignature 64-character hex public merchant token assigned during onboarding.
In: header
Stripe-style HMAC-SHA256 signature.
Format: t=<unix_seconds>,v1=<hex_hmac_sha256>
where hex_hmac = HMAC-SHA256(webhook_secret, "<unix_seconds>.<raw_body>").
Replay window: 5 minutes (60s future drift tolerated).
In: header
Query Parameters
Filter by direction; empty/absent = both (UNION).
Value in
- "PAYIN"
- "PAYOUT"
Repeated DB status names (statuses=COMPLETED&statuses=EXPIRED).
Lower created_at bound (RFC3339, inclusive).
date-timeUpper created_at bound (RFC3339, inclusive).
date-timeResponse Body
application/problem+json
application/problem+json
curl -X GET "https://example.com/api/v1/p2p/merchant/deals/export"{ "csv": "string", "file_name": "string", "row_count": 0, "truncated": true}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "instance": "../dictionary", "errors": [ { "field": "amount", "message": "must be greater than 0", "code": "POSITIVE_REQUIRED" } ]}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "instance": "../dictionary", "errors": [ { "field": "amount", "message": "must be greater than 0", "code": "POSITIVE_REQUIRED" } ]}Create a PayOut deal (disbursement) POST
Initiates a payout to the supplied target requisites. Validates the merchant balance and places a USDT hold (SELL rate) before creating the deal. Synchronous cascade auto-matching then follows: when a free trader exists the deal returns in `MATCHED`; otherwise it returns in `UNASSIGNED` and a retry worker keeps matching until the assignment SLA expires the deal (`EXPIRED`, hold released). Returns the deal with the recipient `target_requisite` populated and `currency` echoed from the request (ISO fiat currency of the payout).
Daily deal turnover (cabinet chart) GET
One aggregate row per (UTC day × deal_type × currency) over a bounded date window, summed from the same UNION ALL surface as the listing (orders `amount` for PAYIN, payouts `amount_fiat` for PAYOUT). `date_from`/`date_to` are REQUIRED RFC3339; the window is capped at 92 days (InvalidArgument beyond). Deals that never happened are excluded (orders EXPIRED/SPAM_REJECTED, payouts FAILED/EXPIRED). Rows are ordered by (date ASC, deal_type ASC, currency ASC); days without deals are absent.