transactions model allows setting three parameters.
fields: a list of fieldsfilters: a dictionary of filterssort: a list of sorting fields
fields
Fields allow the selection of which columns to export in the report.
AmountsAmount fields are integers in the smallest currency unit, the same as in the API. For example,
1299 in USD is $12.99. Reports don’t round or format amounts.To get the value in the major unit, divide by 10 raised to the number of decimal places the currency uses in ISO 4217. For example, divide USD amounts by 100. JPY has no decimal places, so JPY amounts need no conversion. Convert settled_amount using settled_currency.filters
Filters allow filtering of the transactions’ data to be exported.
Date-time filter
A date-time filter could be defined as follows.start and end allow three types of values:
- Valid ISO 8601 timestamp with or without timezone. UTC is assumed if the time zone is not specified.
- Date-time placeholder to be set dynamically
null: this represents an open range
day_start: replaced with the first instant of the day, for the period of time the execution is reading data from.day_end: replaced with the last instant of the day, for the period of time the execution is reading data from.week_start: replaced with the first instant of the week (for example Monday at 00:00), for the period of time the execution is reading data from.week_end: replaced with the last instant of the week (for example Sunday at 23:59), for the period of time the execution is reading data from.month_start: replaced with the first instant of the month, for the period of time the execution is reading data from.month_end: replaced with the last instant of the month, for the period of time the execution is reading data from.
Validations
The validations below are checked:start <= end, only when both are timestampsstartandendcannot be null at the same time
sort
The sort parameter allows selection of how to sort the data exported. This allows multiple columns to be used for sorting.
A sort parameter should have the format:
field can be:
authorized_atcaptured_atcreated_atupdated_atvoided_at
order can be:
asc: ascending orderdesc: descending order
Example
Example of report creation using thetransactions model.