The transactions model allows setting three parameters.

  1. fields: a list of fields
  2. filters: a dictionary of filters
  3. sort: a list of sorting fields

fields

Fields allow you to select which columns to export in the report.

Field
id
external_identifier
status
created_at
updated_at
authorized_at
captured_at
voided_at
amount
currency
captured_amount
refunded_amount
method
scheme
payment_service_transaction_id
payment_service_id
payment_service_definition_id
payment_service_display_name
auth_response_code
raw_response_code
raw_response_description
metadata
is_subsequent_payment
merchant_initiated
payment_source
three_d_secure_status
three_d_secure_eci
three_d_secure_auth_resp
three_d_secure_method
buyer_external_identifier
billing_details_first_name
billing_details_last_name
billing_details_email_address
billing_details_phone_number
billing_details_address_city
billing_details_address_country
billing_details_address_postal_code
billing_details_address_state
billing_details_address_state_code
billing_details_address_house_number_or_name
billing_details_address_line1
billing_details_address_line2
billing_details_address_organization
billing_details_tax_id
billing_details_tax_id_kind
authorized_amount
intent_outcome
gift_card_redemptions_amount
gift_card_redemption_refunds_amount
settled
settled_currency
settled_amount

All fields

If all fields should be included in a report, just set fields as null

filters

Filters allow you to filter the transactions’ data to be exported.

ValueTypeValidation
authorized_atdict[str, str]See Date-time filter below for more details
captured_atdict[str, str]See Date-time filter below for more details
created_atdict[str, str]See Date-time filter below for more details
currencystrValid ISO 4217 currency code
metadatalist[dict[str, str]]List of string-to-string dictionaries
methodlist[str]List of valid methods
schemelist[str]List of valid schemes
statuslist[str]This should be a list
is_subsequent_paymentboolBoolean indicating transactions with subsequent payments
merchant_initiatedboolBoolean indicating transactions initiated by the merchant
payment_sourcelist[str]List of valid transaction sources
three_d_secure_statuslist[str]List of valid 3DS statuses
three_d_secure_ecilist[str]This should be a list
three_d_secure_auth_resplist[str]This should be a list
updated_atdict[str, str]See Date-time filter below for more details
voided_atdict[str, str]See Date-time filter below for more details

No filters

If no filters should be applied, just set filters as null

Date-time filter

A date-time filter could be defined as follows.

{
    "start": str
    "end": str
}

start and end allow three types of values:

  1. Valid ISO 8601 timestamp with or without timezone. UTC is assumed if the time zone is not specified.
  2. Date-time placeholder to be set dynamically
  3. null: this represents an open range

The available placeholders for dynamic timestamps are:

  • 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 (i.e. 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 (i.e. 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:

  1. start <= end, only when both are timestamps
  2. start and end cannot be null at the same time

sort

The sort parameter allows you to choose how to sort the data exported. This allows you to use multiple columns for sorting.

A sort parameter should have the format:

{
    "field": str
    "order": str
}

field can be:

  1. authorized_at
  2. captured_at
  3. created_at
  4. updated_at
  5. voided_at

order can be:

  1. asc: ascending order
  2. desc: descending order

No sorting

If no sorting should be applied, just set sort as null

Example

Example of report creation using the transactions model.

{
  "name": "Test report",
  "spec": {
    "model": "transactions",
    "params": {
      "fields": ["id", "created_at"],
      "filters": {
        "status": ["capture_succeeded"]
      },
      "sort": [
        {
          "field": "created_at",
          "order": "desc"
        }
      ]
    }
  }
}