Get a list of filtered payments

You can specify various filters as parameters in the query string in order to get a customized list of payments. This type of request allows you to get a list of payments according to your own needs and requirements, simplifying the process of finding transactions.

You can get a list of paginated payments by adding the pageSize and pageIndex parameters to the URL. The pageIndex parameter is recommended to be used together with the pageSize parameter to select the number of transactions on a specific page.

The following table describes all the filters that you can use. Please note that you can mix the filters to get specific results.

FILTERS
Field Description Data type
pageSize The maximum number of transactions that will be returned per page. The pageSize parameter used together with the pageIndex parameter will also represent the number of transactions returned for a specific page. Please note that without specifying any parameter the default number of transactions that will be returned is 50! Long
Request:
GET https://paytest.smart2pay.com/v1/payments?pagesize=20&pageindex=3
pageIndex Using the pageIndex parameter you will be able to receive the transactions paginated. The default number of transactions that will be returned per page is 50. Transactions are ordered by ID descending. The pageIndex parameter is recommended to be used together with the pageSize parameter in order to choose the desired number of transactions returned per page. Long
Request:
GET https://paytest.smart2pay.com/v1/payments?pagesize=20&pageindex=3
sortDirection By default, the transactions are ordered by ID descending. By using the sortDirection parameter, you have the possibility to order the transactions by ID ascending (sortdirection=asc). String
Request:
GET https://paytest.smart2pay.com/v1/payments?pagesize=20&pageindex=3&sortdirection=asc
sortBy By default, the transactions are ordered by ID descending. By using the sortBy parameter you will be able to receive the transactions sorted after merchanttransactionid / inputdatetime / amount in combination with sortDirection (=asc / =desc) parameter. Long
Request:
GET https://paytest.smart2pay.com/v1/payments?pagesize=20&pageindex=3&sortby=amount&sortdirection=asc
startDate The date and time after which the payments are returned. DateTime

YYYYMMDDHHMMSS

Request:
GET https://paytest.smart2pay.com/v1/payments?startDate=20170803150000
endDate The date and time until which the payments are returned. DateTime

YYYYMMDDHHMMSS

Request:
GET https://paytest.smart2pay.com/v1/payments?startDate=20170803150000&endDate=20171003140000
methodID Only the transactions having this methodID will be returned. Long
Request:
GET https://paytest.smart2pay.com/v1/payments?methodID=2
country Only the transactions having this country code will be returned. String

(ISO 3166-1-alpha-2)

Request:
GET https://paytest.smart2pay.com/v1/payments?country=NL
currency Only the transactions having this currency code will be returned. String

(ISO 4217)

Request:
GET https://paytest.smart2pay.com/v1/payments?currency=EUR
minimumAmount Only the payments with an amount higher than this will be returned. Integer (last 2 digits representing the decimal part)
Request:
GET https://paytest.smart2pay.com/v1/payments?minimumAmount=100
maximumAmount Only the payments with an amount lower than this will be returned. Integer (last 2 digits representing the decimal part)
Request:
GET https://paytest.smart2pay.com/v1/payments?maximumAmount=1000
merchantTransactionID Only the payment having this merchantTransactionID will be returned. String

^[0-9a-zA-Z_-]{1,50}$

Request:
GET https://paytest.smart2pay.com/v1/payments?merchantTransactionID=123456
statusID Only the transactions having this statusID will be returned. Integer

The ID of the payment status can have the following values: 1 – Open, 2 – Success, 3 – Cancelled, 4 – Failed, 5 – Expired, 9 – Authorized.

Request:
GET https://paytest.smart2pay.com/v1/payments?statusID=2
methodTransactionID Only the payments having this methodTransactionID will be returned. This transaction ID from the payment method provider can be used for customer support. String

^[0-9a-zA-Z_-]{1,50}$

Request:
GET https://paytest.smart2pay.com/v1/payments?methodTransactionID=100200
typeID Only the transactions having this typeID will be returned. Integer

The typeID filter can have the following values: 1 – Payments, 2 – Recurring payments.

Request:
GET https://paytest.smart2pay.com/v1/payments?typeID=1

Here is an example request where the transactions are divided in pages (groups of transactions) of 2 transactions and the third group of transactions is returned.

Request:

GET https://paytest.smart2pay.com/v1/payments?pagesize=2&pageindex=3

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"Payments": [
  {
   "ID": 2459122,
   "SkinID": null, 
   "Created": "20160411140447",
   "MerchantTransactionID": "WPD_1460383484_8795_5000",
   "Amount": "100",
   "Currency": "BAM",
   "CapturedAmount": null,
   "ReturnURL": "https://docs-apm.nuvei.com/wp-content/plugins/smart2pay-api/views/funcs/demo_clean_return.php",
   "Description": null,
   "MethodID": 79,
   "MethodOptionID": null,
   "IncludeMethodIDs": null,
   "ExcludeMethodIDs": null,
   "PrioritizeMethodIDs": null,
   "SiteID": 30201,
   "NotificationDateTime": "20160411140522",
   "Customer": null,
   "BillingAddress": null,
   "ShippingAddress": null,
   "Articles": null,
   "Details": null,
   "ReferenceDetails": null,
   "CustomParameters": null,
   "PreapprovalID": null,
   "Status": {
     "ID": 1,
     "Info": "Open",
     "Reasons": null
   },
   "MethodTransactionID": null,
   "TokenLifetime": null,
   "Capture": null,
   "RedirectURL": null
   },
   {
   "ID": 2459118,
   "SkinID": null,
   "Created": "20160411125607",
   "MerchantTransactionID": "WPD_1460379365_1783_6355",
   "Amount": "1100",
   "Currency": "NGN",
   "CapturedAmount": null,
   "ReturnURL": "https://docs-apm.nuvei.com/wp-content/plugins/smart2pay-api/views/funcs/demo_clean_return.php",
   "Description": null,
   "MethodID": null,
   "MethodOptionID": null,
   "IncludeMethodIDs": null,
   "ExcludeMethodIDs": null,
   "PrioritizeMethodIDs": null,
   "SiteID": 30201,
   "NotificationDateTime": "20160411125629",
   "Customer": null,
   "BillingAddress": null,
   "ShippingAddress": null,
   "Articles": null,
   "Details": null,
   "ReferenceDetails": null,
   "CustomParameters": null,
   "PreapprovalID": null,
   "Status": {
     "ID": 3,
     "Info": "Cancelled",
     "Reasons": null
       },
   "MethodTransactionID": null,
   "TokenLifetime": null,
   "Capture": null,
   "PreapprovalDetails": null,
   "RedirectURL": null
    }
  ],
   "TotalPages": 50,
   "PageSize": 2,
   "PageIndex": 3,
   "Count": 2,
   "TotalCount": 100
}

In the response you will receive additional information in order to keep track of your transactions, like: TotalPages, PageSize, PageIndex, Count and TotalCount.

Here is the example of the request where the transactions are divided in pages (groups of transactions) of 3 transactions and the last group of transactions is returned. In this case the Count parameter will refer to the number of the remaining transactions on the last page.

Request:

GET https://paytest.smart2pay.com/v1/payments?pagesize=3&pageindex=50

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "Payments": [
    {
      "ID": 3037285,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170808100902",
      "MerchantTransactionID": "WPD_1502186809_5528_8717",
      "OriginatorTransactionID": null,
      "Amount": "1",
      "Currency": "PHP",
      "CapturedAmount": null,
      "ReturnURL": "https://docs-apm.nuvei.com/wp-content/plugins/smart2pay-api/views/funcs/demo_clean_return.php",
      "Description": null,
      "MethodID": 1029,
      "MethodOptionID": null,
      "IncludeMethodIDs": null,
      "ExcludeMethodIDs": null,
      "PrioritizeMethodIDs": null,
      "SiteID": 30201,
      "NotificationDateTime": "20170808100927",
      "Customer": null,
      "BillingAddress": null,
      "ShippingAddress": null,
      "Articles": null,
      "Details": null,
      "ReferenceDetails": null,
      "CustomParameters": null,
      "PreapprovalID": null,
      "Status": {
        "ID": 3,
        "Info": "Cancelled",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "PreapprovalDetails": null,
      "RedirectURL": null
    },
    {
      "ID": 3037282,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170808100848",
      "MerchantTransactionID": "WPD_1502186795_5903_4452",
      "OriginatorTransactionID": null,
      "Amount": "1",
      "Currency": "PHP",
      "CapturedAmount": null,
      "ReturnURL": "https://docs-apm.nuvei.com/wp-content/plugins/smart2pay-api/views/funcs/demo_clean_return.php",
      "Description": null,
      "MethodID": 1051,
      "MethodOptionID": null,
      "IncludeMethodIDs": null,
      "ExcludeMethodIDs": null,
      "PrioritizeMethodIDs": null,
      "SiteID": 30201,
      "NotificationDateTime": null,
      "Customer": null,
      "BillingAddress": null,
      "ShippingAddress": null,
      "Articles": null,
      "Details": null,
      "ReferenceDetails": null,
      "CustomParameters": null,
      "PreapprovalID": null,
      "Status": {
        "ID": 4,
        "Info": "Failed",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "PreapprovalDetails": null,
      "RedirectURL": null      
        }
     ],
      "TotalPages": 50,
      "PageSize": 3,
      "PageIndex": 50,
      "Count": 2,
      "TotalCount": 149
}

In case of an API error, an HTTP 4xx (you did something wrong) or HTTP 5xx (we did something wrong) response is returned.

For more information about the reasons of a wrong request response see our section GlobalPay Return Codes.

Please note that when a request is initiated with PageIndex filter greater than the TotalPages, an HTTP 4xx status is returned with return code 184: PageIndex Out of Range!

Request:

GET https://paytest.smart2pay.com/v1/payments?pagesize=20&pageindex=500

Response:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
  "Payments": [],
  "Count": 0,
  "TotalPages": 178,
  "TotalCount": 3552,
  "PageIndex": 500,
  "PageSize": 20,
  "Error": "PageIndex Out of Range"
}