S
docs.syncra.money
API ReferenceMerchant APIApi referencePayments

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.

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

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.

Authorization

MerchantToken MerchantSignature
X-Merchant-Token<token>

64-character hex public merchant token assigned during onboarding.

In: header

X-Signature<token>

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

deal_type?string

Filter by direction; empty/absent = both (UNION).

Value in

  • "PAYIN"
  • "PAYOUT"
statuses?array<string>

Repeated DB status names (statuses=COMPLETED&statuses=EXPIRED).

created_after?string

Lower created_at bound (RFC3339, inclusive).

Formatdate-time
created_before?string

Upper created_at bound (RFC3339, inclusive).

Formatdate-time

Response 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"    }  ]}