S
docs.syncra.money
Finance

Deal turnover (Turnover)

Daily PayIn/PayOut deal turnover for the merchant's cabinet charts — date window, grouping, and excluded statuses

Deal turnover (Turnover)

The turnover endpoint returns aggregated deal amounts for the merchant over a date window — the data source for the turnover chart in the cabinet. It reads from the same UNION surface as the deal listing (orders amount → PAYIN, payouts amount_fiat → PAYOUT). Read-only and dual-homed: the cabinet JWT or the merchant HMAC pair.


Request

GET /api/v1/p2p/merchant/deals/turnover?date_from=...&date_to=...

Parameters (Query Parameters)

FieldTypeRequiredDescription
date_fromstring(RFC3339)YesThe window start (inclusive).
date_tostring(RFC3339)YesThe window end (inclusive). Must not be earlier than date_from.
deal_typestringNo"PAYIN" (orders amounts) / "PAYOUT" (payouts amounts) / empty = both directions.

Window constraints

  • The window is at most 92 days wide (date_to − date_from ≤ 92 days), otherwise 400.
  • Days without deals are simply absent from the response — the client fills in the axis when plotting.

Response (200 OK)

A live staging response (window 2026-08-01 … 2026-08-23):

{
  "data": [
    { "date": "2026-08-23", "deal_type": "PAYIN", "amount_minor": "100000", "currency": "RUB" },
    { "date": "2026-08-23", "deal_type": "PAYIN", "amount_minor": "100000", "currency": "RUB" },
    { "date": "2026-08-23", "deal_type": "PAYOUT", "amount_minor": "96971", "currency": "RUB" },
    { "date": "2026-08-23", "deal_type": "PAYOUT", "amount_minor": "98980", "currency": "RUB" }
  ],
  "next_page_token": ""
}

TurnoverMerchantDealsRow fields

FieldTypeDescription
datestringThe UTC calendar day the deal was created (YYYY-MM-DD). The day bucket is strictly UTC — the DB session timezone does not shift the boundaries.
deal_typestring"PAYIN" or "PAYOUT".
amount_minorint64The group's deal amount in minor units (kopecks).
currencystringISO 4217 (for PayOut, the code resolves through p2p_currencies).

Aggregate granularity. Grouping runs over the combination (type × currency × the deal's exact creation time), and the date in a row is the calendar day of that time. In practice, this means that deals created in different seconds of the same day produce separate rows sharing the same date (see the live example above — 2 PAYIN rows for one day). Sum amount_minor by the (date, deal_type, currency) key on the client to get the daily total. Row order: date ASC, deal_type ASC, currency ASC.

Which deals count toward turnover

Turnover measures traffic, not only completed deals: every status counts except the unsuccessful ones:

SourceExcluded statuses
PayIn (p2p_orders)EXPIRED, SPAM_REJECTED
PayOut (p2p_payouts)FAILED, EXPIRED

Errors (live staging responses)

400 — missing dates

{
  "type": "about:blank",
  "title": "Bad Request",
  "status": 400,
  "detail": "{\"code\":3,\"message\":\"date_from and date_to are required (RFC3339)\",\"details\":[]}",
  "instance": "/api/v1/p2p-engine"
}

400 — window wider than 92 days

{
  "type": "about:blank",
  "title": "Bad Request",
  "status": 400,
  "detail": "{\"code\":3,\"message\":\"date window too large: at most 92 days between date_from and date_to\",\"details\":[]}",
  "instance": "/api/v1/p2p-engine"
}

400 INVALID_ARGUMENT is also returned for: a non-RFC3339 date_from/date_to (invalid date_from (RFC3339): ...), date_to earlier than date_from (date_to must not be earlier than date_from), and an unknown deal_type (invalid deal_type "X": must be PAYIN, PAYOUT or empty (both)).


On this page