Skip to main content
Version: Lab (preview)

Query Settlement Data

Settlements are a batch of payments, disputes, and refunds that are grouped together and paid out to a merchant. This guide will walk you through how to write a query for a settlement.

GraphQL
query GetSettlement{
settlements(limit: 10, direction: FORWARD, offset: "", offset_id: "", query:{
query_list:[
{
key: "status",
value: "SUCCEEDED",
operator : EQUAL
}
]
}) {
items {
gross_amount
merchant_uid
settlement_batch
status
transaction_debit_count
transaction_reversal_count
}
}
}

Arguments​

Sending a request is required in order to get query settlement data. To obtain the query data, the following three parameters are necessary.

Keytypedescription
limitintThe number of settlements to return.
directionstringThe direction of the pagination. Make sure the results are returned in the correct order.
  • FORWARD
  • BACKWARD
querySqlQueryThe query to filter the settlements with. Detailed information about the query object can be found here.

Required Arguments​

The following parameters must be used in order to get the query settlement data. The query may fail to execute if any parameter is omitted, in which case the required data for processing will need to be requested.

Keytypedescription
gross_amountintThe total amount of the settlement before any fees and adjustments.
merchant_uidstringThe Pay Theory unique identifier assigned to the merchant that the settlement belongs to.
querySqlQueryThe query to filter the settlements with. Detailed information about the query object can be found here[query].
settlement_batchintThe unique settlement batch number.
statusstringThe status of the settlement.
  • PENDING
  • SUCCEEDED
transaction_debit_countintThe number of transactions of type DEBIT that were included in the settlement.

Returns​

This returns an array of settlement objects and the total number of items that match that query.

JSON
{
"data": {
"settlements": {
"items": [
{
"settlement_batch": int
},
{
"settlement_batch": int
},
],
"total_row_count": int
}
}
}