Skip to content

Report Create

Request

Request an asynchronous report generation.

Creates a report file record with status pending and enqueues a background job that builds the report from the supplied parameters and uploads it to storage.

Currently only the payout report type is supported.

Security
bearerAuth
Path
report_typestring(ClientReportType)required

Report types API clients can generate and filter by.

Value:"payout"
Bodyapplication/jsonrequired
countrystring(ApiCountry)required
Enum:"BGD""IND""PAK""PHL""NPL""EGY""VNM""NGA"
sorting_orderstring(SortingOrder)

ORDER BY direction with explicit nulls handling.

ASC => ASC NULLS LAST DESC => DESC NULLS LAST

Both place nulls at the end, which should be a sane default

Default:"desc"
Enum:"asc""desc"
start_tsstring or null(Start Ts)
Any of:
string (date-time)
end_tsstring or null(End Ts)
Any of:
string (date-time)
statusArray of strings or null(Status)
Any of:
Array of strings
idsArray of any or null(Ids)
Any of:
externalboolean(External)
Default:false
curl -i -X POST \
  'https://docs.leanx.me/_mock/openapi/v2/reports/{report_type}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "country": "BGD",
    "sorting_order": "asc",
    "start_ts": "2019-08-24T14:15:22Z",
    "end_ts": "2019-08-24T14:15:22Z",
    "status": [
      "queued"
    ],
    "ids": [
      "497f6eca-6276-4993-bfeb-53cbbbba6f08"
    ],
    "external": false
  }'

Responses

Successful Response

Bodyapplication/json
idstring, (uuid)(Id)required

Report id, for GET /v2/reports/{id} and the presigned download URL.

file_namestring(File Name)required

Report file name.

content_typestring(Content Type)required

MIME type of the file.

report_typestring(ReportType)required

Kind of report.

Enum:"payout""statement""wallet""funding_history""pnl""reversed_payouts""agent_payout"
file_statusstring(BatchJobItemStatus)required

Generation status. The file can be downloaded once this is success.

Enum:"pending""processing""success""fail"
auto_generatedboolean(Auto Generated)required

true if the scheduler created this report, false if you requested it.

created_atstring, (date-time)(Created At)required

When the report was created (UTC).

paramsClientPayoutReportParams (object) or null(Params)required
Any of:

Payout report parameters available to API clients.

Mirrors the client-facing parameters of stream_order_results so a generated report can be reproduced exactly from the persisted params.

Response
{ "auto_generated": false, "content_type": "text/csv", "created_at": "2024-12-01T01:02:03.000000Z", "file_name": "payout_IND_2024-12-01.csv", "file_status": "success", "id": "00000000-0000-4000-A000-000000000000", "report_type": "payout" }