Retrieving data
Overview
The following endpoints in the Data API are used to retrieve data:
/balance/get
—to retrieve balance information (currently available only for OUT balances)/chargeback/list
—to retrieve chargeback information filtered by specified conditions/chargeback/get
—to retrieve information about a single chargeback/fraud/list
—to retrieve information about operations flagged as fraudulent/financial-reporting/operations
—to retrieve itemised operation data for financial reporting (including charged fees) for a specified time period/operations/get
—to retrieve itemised operation data for a specified time period/operations/get-by-payment
—to retrieve information about operations initiated within a specific payment/currency-rates/get
—to retrieve reference information on currency conversion rates applied to financial transactions
The general procedure of sending requests to any of these endpoints is the same as described in previous articles of this section. This article covers special aspects of using these requests and complements the description of data structures in the interface specification.
Retrieving balance data
Requests to retrieve balance information on the merchant's projects should be sent to the /balance/get endpoint.
These requests must contain parameters token
(a token associated with the specific Dashboard user account) and signature
(details). Responses to such requests contain information about the current state of OUT balances.
Information about each balance includes the balance type and the available total sum in this balance's currency. The currency is specified in the name of the parameter and the sum is passed as its value ("<currency>": "<sum>"
).
Retrieving chargeback data
Requests to retrieve chargeback information filtered by specified conditions should be sent to the /chargeback/list endpoint.
When sending such requests, consider the following:
- These requests must contain parameters
token
(a token associated with the specific Dashboard user account with theRisks
orMerchant Admin
role and with the access rights to certain projects of the merchant) andsignature
(details). -
To filter information about chargebacks by different parameters, use the
filter
object.In the
filter
object, any date range must be an object defined byfrom
andto
string parameters. The rest of parameters can be an array of one or more values or a string of values separated with a comma and a space (provider_id
can be only an array). Parameters in thefilter
object can be listed in an arbitrary order. By default, if the request does not contain these parameters, the payment platform returns chargeback information on all of the projects that can be accessed with the use of the token.The filter object can include the following objects and parameters:
report_date—
a date range with date values in the format "YYYY-MM-DD"; refers to the time when the information about the chargeback was received in the payment platformrespond_by
—the deadline for submitting a response to the chargeback (must be specified as a date range with date values in the format "YYYY-MM-DD HH-MM-SS" where time can be skipped)chb_completed_at
—the date when the chargeback received one of the final statuses (must be specified as a date range with date values in the format "YYYY-MM-DD HH-MM-SS" where time can be skipped)project_id
—project ID provided by ecommpaychargeback_id
—chargeback ID provided by ecommpaychargeback_stage
—chargeback stage (Chargeback
,Representment
,Pre-Arbitration attempt
,Pre-Arbitration response
, orArbitration
; details)arn
—acquirer reference number used for clearingcard
—card number used by the customer to make the disputed paymentcard_type
—the code of the payment system (visa
for Visa andmc
for Mastercard);reason_code
—numerical chargeback reason code provided by the payment systemoperation_id
—ID of the disputed operation provided by ecommpaystatus
—current status of the chargeback
- To restrict the number of chargebacks the information about which is returned in a single response, use the
pagination
object with two parameters:limit
andoffset
. Thelimit
parameter is used to set the number of the returned operations in the response (more than 1). Theoffset parameter
is used to retrieve the subset of chargebacks beginning with the number that follows theoffset
value (counting starts from 0). For example, if you need to retrieve information about chargebacks 21-25, you should set"limit": 5
and"offset": 20
in the request. If these parameters are absent, the default values are 20 forlimit
and 0 foroffset.
Responses to such requests contain chargeback data with the consideration of the conditions determined in the request.
Retrieving single chargeback data
A request to retrieve single chargeback information should be sent to the /chargeback/get endpoint.
When sending such requests, consider the following:
- The request must contain parameters
token
(a token associated with the specific Dashboard user account with theRisks
orMerchant Admin
role and with the access rights to certain projects of the merchant) andsignature
(details). - The request must contain one of the following identifiers in the
filter
object:chargeback_id
—chargeback ID provided by ecommpayarn
—acquirer reference number used for clearingoperation_id
—operation ID provided by ecommpay
The response to such request contains information about the required chargeback.
Retrieving fraudulent operations data
A request to retrieve information about operations flagged as fraudulent by payment systems should be sent to the /fraud/list endpoint (information about operations flagged as fraudulent by ecommpay is not provided in the response to this request).
When sending such requests, consider the following:
- The request must contain parameters
token
(a token associated with the specific Dashboard user account with theRisks
orMerchant Admin
role and with the access rights to certain projects of the merchant) andsignature
(details). - The request may contain the
filter
object with any of the following parameters:received_on
—date when the payment system reported the fraudulent operation (must be specified as a date range)purchase_date
—date when the operation was completed (must be specified as a date range)fraud_report_date
—date when the operation was reported as fraudulent to the issuing bank (must be specified as a date range)issuer_country
—country of the issuer determined according to the BIN of the card in ISO 3166-1 alpha-2 format
The date range in this
filter
object must contain start and end dates and must be specified as a string array, for example,"purchase_date": ["2023-12-31 00:00:00", "2024-01-07 23:59:59"]
. - To restrict the number of operations the information about which is returned in a single response, use the
pagination
object with two parameters:limit
andoffset
. Thelimit
parameter is used to set the number of the returned operations in the response (more than 1). Theoffset parameter
is used to retrieve the subset of operations beginning with the number that follows theoffset
value (counting starts from 0). For example, if you need to retrieve information about fraudulent operations 21-25, you should set"limit": 5
and"offset": 20
in the request. If these parameters are absent, the default values are 20 forlimit
and 0 foroffset
.
Responses to such requests contain operation data filtered by the conditions determined in the request.
Retrieving itemised operation data for financial reporting
Requests to retrieve itemised operation data for financial reporting (including charged fees) for a specified time period should be sent to the /financial-reporting/operations endpoint. This information can complement the operation data retrieved for general purposes (details) and used for final analysis and reconciliation.
When sending a request to retrieve itemised operation data for financial reporting, consider the following:
When sending such request, consider the following:
- The request must contain the following objects and parameters:
token
—a token associated with the specific Dashboard user accountsignature
—a request signature generated after all required parameters have been specified (details)operation_completed_at
—an object that defines the time period over which the required operations were finalised (with the most recent actions and updates taken into consideration):from
—start date and time of the interval, in theYYYY-MM-DD hh:mm:ss
formatto
—end date and time of the interval, in theYYYY-MM-DD hh:mm:ss
format
Note: You can only request data about operations completed in the payment platform within the last 30 days.tz
—time zone specified in the UTC offsets format (for example,+10:30
) or in the IANA Time Zone Database format (for example,Asia/Singapore
).
- To filter operations by projects and/or providers, use the
project_id
andprovider_id
arrays. Keep in mind that the access rights associated with the token passed in the request also factor in what data is going to be returned. By default, if the request does not contain these arrays, the payment platform returns operation information on all of the projects (which can be accessed with the use of the token) and on all of the providers involved in performing these operations. If you need operation data for specific projects and providers, specify their identifiers in theproject_id
andprovider_id
arrays (separated with a comma and a space: for example,4, 12
). - To filter operation data by operation identifiers, use the
operation_id
array. By default, if the request does not contain this array, the payment platform returns itemised data for all operations that otherwise meet the query criteria. If you need operation data for specific operations, pass their identifiers in theoperation_id
array (separated with a comma and a space: for example,6435212162442, 6435212162443
). -
To restrict the number of operations information about which is returned in a single response, use the
limit
parameter. This parameter can take a value between0
and1000
. By default, it is set to1000
, while the number of the returned operations in the response can be lower than the specified value.If you need information about more than one thousand operations, send multiple requests with the
offset
parameter specified in each. This parameter determines the offset value for selecting operations. When both thelimit
andoffset
parameters are passed in the request, then the number of the operations that equals the value of theoffset
parameter is skipped, and the remaining number of operations returned in the response does not exceed the value of thelimit
parameter.For example, if you need to retrieve operation data on
1125
operations, then you can specify the following values for thelimit
andoffset
parameters in the requests:"limit": "1000"
and"offset": "0"
in the first one,"limit": "125"
and"offset": "1000"
in the second one. - To restrict the number of operations returned in a single response, use the
limit
parameter with a value between0
and1000
. If you need information about more than one thousand operations, send multiple requests with theoffset
parameter specified in each. This parameter determines the offset value for selecting operations.
Responses to such requests contain operation data for a specified time period, retrieved according to the request criteria.
Retrieving itemised operation data for general purposes
Requests to retrieve itemised operation data for a specified time period should be sent to the /operations/get endpoint. You can use this information for monitoring your operations and their technical analysis. To obtain accurate financial information that can be used for final analysis and reconciliation, retrieve itemised operation data for financial reporting (including charged fees; details).
When sending a request to retrieve operation data for general purposes, consider the following:
When sending such request, consider the following:
- The request must contain the following objects and parameters:
token
—a token associated with the specific Dashboard user accountsignature
—a request signature generated after all required parameters have been specified (details)interval
—an object that defines the time period over which the required operations were finalised (with the most recent actions and updates taken into consideration):from
—start date and time of the interval, in theYYYY-MM-DD hh:mm:ss
formatto
—end date and time of the interval, in theYYYY-MM-DD hh:mm:ss
format
Note: If more than one request is received in the platform from a single Dashboard user account within 10 seconds, and the value of theinterval
parameter specified in the requests exceeds 180 days, these requests are processed one by one, with 10 second delay.
- To filter operations by project, use the
project_id
array. Keep in mind that the access rights associated with the token passed in the request also factor in what data is going to be returned. By default, if the request does not contain this array, the payment platform returns operation information on all of the projects which can be accessed with the use of the token. If you need operation data for specific projects, specify the identifiers of these projects in theproject_id
array (separated with a comma and a space if more than one identifier needed: for example,4, 12
). - To specify a time zone different from the default UTC +00:00, use the
tz
parameter. The time zone specified with the help of this parameter affects what operations will be selected for the time period specified in theinterval
object and the format of the date and time parameters in the response—for example,operation_created_at
andoperation_completed_at
. In thetz
parameter, the time zone is specified in the UTC offsets format (for example,+10:30
) or in the IANA Time Zone Database format (for example,Asia/Singapore
). -
To restrict the number of operations information about which is returned in a single response, use the
limit
parameter. This parameter can take a value between0
and1000
. By default, it is set to1000
, while the number of the returned operations in the response can be lower than the specified value.If you need information about more than one thousand operations, send multiple requests with the
offset
parameter specified in each. This parameter determines the offset value for selecting operations. When both thelimit
andoffset
parameters are passed in the request, then the number of the operations that equals the value of theoffset
parameter is skipped, and the remaining number of operations returned in the response does not exceed the value of thelimit
parameter.For example, if you need to retrieve operation data on
1125
operations, then you can specify the following values for thelimit
andoffset
parameters in the requests:"limit": "1000"
and"offset": "0"
in the first one,"limit": "125"
and"offset": "1000"
in the second one. - To restrict the number of operations returned in a single response, use the
limit
parameter with a value between0
and1000
. If you need information about more than one thousand operations, send multiple requests with theoffset
parameter specified in each. This parameter determines the offset value for selecting operations. -
If you need to retrieve specific operation data parameters, use the
fields
array. If the request does not contain this array, the payment platform returns the default set of data for each operation. For a customised set of data, pass the names of parameters you need in thefields
array.The names of parameters in the array are separated with a comma and a space (if you need more than one) and can be listed in an arbitrary order. However, the order in which the data are listed in responses is fixed. The full list of parameters can be found in the specification: see the list of parameters in the
operations
object included in the format description of the response to the request sent to the /operations/get endpoint. In this description, the parameters are listed in the fixed order that cannot be customised in responses. The parameters included in the default set of data are marked as required. - If you need to retrieve specific operation data parameters, use the
fields
array. The full list of available data can be found in the specification: see the list of parameters in theoperations
object included in the format description of the response to the request sent to the /operations/get endpoint. -
To retrieve operation data by certain operation types and/or statuses, use the
operation_type
andoperation_status
parameters. By default, if the request does not contain these parameters, the payment platform returns operation data for all operation types and statuses. If you use these parameters, specify operation types and statuses that you need and separate multiple values within the arrays by a comma with a space if necessary. The comprehensive list of operation types and statuses can be found in Payment processing.The
operation_type
andoperation_status
parameters can be passed as strings (if you need to pass a single value) and as arrays (if you need to pass one or more values). -
To filter operation data by customer identifiers and/or customer emails, use the
customer_id
andcustomer_email
parameters. By default, if the request does not contain these parameters, the payment platform returns itemised data for all operations that otherwise meet the query criteria. Thecustomer_id
parameter can be passed as a string (if you need to pass a single value) and as an array (if you need to pass one or more values), and thecustomer_email
parameter can only be passed as a string.
Responses to such requests contain operation data for a specified time period, retrieved according to the request criteria.
If the default set of parameters returned in responses is enough, there is no need to pass the fields
array in the requests.
If you need to customise the default set of data retrieved for each operation, you can specify the required parameters in the fields
array. If, in addition, you need to filter operation data, specify filtering criteria by using such parameters as operation_type
, operation_status
, and customer_email
.
Retrieving data on operations initiated within a specific payment
Requests to retrieve information about all operations initiated within a specific payment should be sent to the /operations/get-by-payment endpoint.
These requests must contain parameters payment_id
(ID of the target payment), token
(a token associated with the specific Dashboard user account), and signature
(details). Responses to such requests contain information about the operations initiated within the target payment.
Retrieving currency conversion rates data
Requests to retrieve information on currency conversion rates applied to operating and non-operating inflows and outflows in the payment platform should be sent to the /currency-rates/get endpoint. Conversion rates information is provided for reference use only.
operations
endpoints.The request to the /currency-rates/get endpoint must contain the following objects and parameters:
token
—a token associated with the specific Dashboard user account that has permissions to access all required projects.signature
—a request signature generated after all required parameters have been specified (details).filter
—an object with parameters to filter currency conversion rates by:merchant
—an internal identifier of the merchant in the payment platform provided by the ecommpay technical support upon request (specified as an integer, for example,97
).currency
—the code of the required currency in the ISO-4217 alpha-3 format (learn more).interval
—an object with the specified start and end dates of the time period:from
—start date and time of the interval, inYYYY-MM-DD hh:mm:ss
format.to
—end date and time of the interval, inYYYY-MM-DD hh:mm:ss
format.
Note: If the specified time period is less than one hour (including cases when start and end times match), the retrieved conversion rates data will be relevant for the time specified in thefrom
parameter. If the specified time period is invalid (set in the future, for example), the response to such request will not contain conversion rates data.
tz
—time zone specified in the UTC offsets format (for example,+10:30
) or in the IANA Time Zone Database format (for example,Asia/Singapore
).