Skip to content

Report File Create

Request

Request a payout report, generated in the background and stored for download. Takes the same filter as POST /v3/reports/payout.

The report starts out pending: poll GET /v3/reports/files/{id} until file_status is success, then fetch it through GET /v3/reports/files/{id}/presigned-url.

Security
bearerAuth
Bodyapplication/jsonrequired
startstring, (date-time)(Start)required

Start of the window, on order creation

endstring, (date-time)(End)required

End of the window, exclusive

countrystring(ApiCountry)required

Payment country

Enum:"BGD""IND""PAK""PHL""NPL""EGY""VNM""NGA""LKA"
statusArray of strings or null(Status)
Any of:

Filter on the effective status — the one the report reports, overrides applied

<= 9 items
Array of strings
externalboolean(External)

When true, ids holds external_id values from the original payment requests rather than LeanX ids

Default:false
idsArray of any or null(Ids)
Any of:

Only report these payments. An id that matches nothing still gets a row, carrying just the id; one whose payment status or payment_method excludes is left out.

payment_methodArray of strings or null(Payment Method)
Any of:

Only payments of these methods; omit for any

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"
curl -i -X POST \
  https://docs.leanx.me/_mock/openapi/v3/reports/files/payout/generate \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "start": "2019-08-24T14:15:22Z",
    "end": "2019-08-24T14:15:22Z",
    "country": "BGD",
    "status": [
      "queued"
    ],
    "external": false,
    "ids": [
      "497f6eca-6276-4993-bfeb-53cbbbba6f08"
    ],
    "payment_method": [
      "bank_transfer"
    ],
    "sorting_order": "asc"
  }'

Responses

Successful Response

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

Report id, for GET /v3/reports/files/{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.

periodReportPeriod (string) or null
Any of:

Cadence at which the scheduler auto-generates a client report: daily covers yesterday, monthly last month, both in the schedule's zone.

string(ReportPeriod)
Enum:"daily""monthly"
created_atstring, (date-time)(Created At)required

When the report was created (UTC).

params(V3ClientReportParams (PayoutReportFilter (object) or StatementReportFilter (object) or WalletReportFilter (object) or FundingHistoryReportFilter (object) or ReversedPayoutsReportFilter (object))) or nullrequired
Any of:

The filters the report was generated with.

Any of:

Payout report parameters available to API clients.

Response
{ "id": "string", "file_name": "string", "content_type": "string", "report_type": "payout", "file_status": "pending", "auto_generated": true, "period": "daily", "created_at": "2019-08-24T14:15:22Z", "params": { "start": "2019-08-24T14:15:22Z", "end": "2019-08-24T14:15:22Z", "country": "BGD", "status": [ … ], "external": false, "ids": [ … ], "payment_method": [ … ], "sorting_order": "asc" } }