Get information on a specific payment

You can get information about a one-off payment or a recurring payment by using a few actions based on GET HTTP request.

The details about a recurring payment can be retrieved in the exact same manner you do for one-off payments.

Definition: GET /v1/payments/{id}

Where:
  • {id} – GlobalPay Payment ID

Request:

GET https://paytest.smart2pay.com/v1/payments/2427075
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "Payment": {
    "ID": 2427075,
    "SkinID": null,
    "Created": "20160314094549",
    "MerchantTransactionID": "s2ptest_5",
    "Amount": 100,
    "Currency": "EUR",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": null,
    "MethodID": 2,
    "MethodOptionID": 37,
    "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": 2,
      "Info": "Success",
      "Reasons": null
    },
    "MethodTransactionID": null,
    "TokenLifetime": 1,
    "Capture": null,
    "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=4F35965A546A94DE14C0126A4946B7DA.2427075"
  }
}

Get a list of payments

Without specifying any parameters a list of payments is returned. Please be aware that only a limited amount of details for each payment will be provided.

Definition: GET /v1/payments

Request:

GET https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "Payments": [
    {
      "ID": 2427075,
      "SkinID": null,
      "Created": "20160314094549",
      "MerchantTransactionID": "s2ptest_5",
      "Amount": 100,
      "Currency": "EUR",
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": null,
      "MethodID": 2,
      "MethodOptionID": 37,
      "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": 2,
        "Info": "Success",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "RedirectURL": null
    },
    {
      "ID": 2427073,
      "SkinID": 11,
      "Created": "20160314094121",
      "MerchantTransactionID": "s2ptest_4",
      "Amount": 980,
      "Currency": "EUR",
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "test smart2pay",
      "MethodID": 75,
      "MethodOptionID": null,
      "IncludeMethodIDs": null,
      "ExcludeMethodIDs": null,
      "PrioritizeMethodIDs": null,
      "SiteID": 30201,
      "NotificationDateTime": "20160314094220",
      "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,
      "RedirectURL": null
     }
  ]
}

Get a list of payments (filtered)

You can specify various filters as parameters in the query string in order to get a customized list of payments.

Requests:

GET https://paytest.smart2pay.com/v1/payments?limit=3
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
GET https://securetest.smart2pay.com/v1/payments?startDate=20160803150000&endDate=20161003140000
Authorization: Basic MTAxMDpnYWJp

The following table describes the possible filters you can use. You can mix the filters so you can obtain the desired results.

FILTERS
Field Description Data type
limit The maximum number of items that will be returned Long
offset A list of payments starting with the value of the offset parameter will be returned. The offset parameter can also be used together with the limit parameter to select specific entries within a list of payments. String
startDate The date and time after which the payments are returned DateTime (YYYYMMDDHHMMSS)
endDate The date and time until which the payments are returned DateTime (YYYYMMDDHHMMSS)
methodID Only the transactions having this methodID will be returned Long
country Only the transactions having this country code will be returned String (ISO 3166-1-alpha-2)
currency Only the transactions having this currency code will be returned String (ISO 4217)
minimumAmount Only the payments with an amount higher than this will be returned Integer (last 2 digits representing the decimal part)
maximumAmount Only the payments with an amount lower than this will be returned Integer (last 2 digits representing the decimal part)
merchantTransactionID Only the payment having this merchantTransactionID will be returned String

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

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.

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}$

typeID Only the transactions having this typeID will be returned. Integer

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

Here is an example of a request with the limit filter set to 3.

Request:

GET https://paytest.smart2pay.com/v1/payments?limit=3
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "Payments": [
    {
      "ID": 2427075,
      "SkinID": null,
      "Created": "20160314094549",
      "MerchantTransactionID": "s2ptest_5",
      "Amount": 100,
      "Currency": "EUR",
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": null,
      "MethodID": 2,
      "MethodOptionID": 37,
      "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": 2,
        "Info": "Success",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "RedirectURL": null
    },
    {
      "ID": 2427073,
      "SkinID": 11,
      "Created": "20160314094121",
      "MerchantTransactionID": "s2ptest_4",
      "Amount": 980,
      "Currency": "EUR",
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "test smart2pay",
      "MethodID": 75,
      "MethodOptionID": null,
      "IncludeMethodIDs": null,
      "ExcludeMethodIDs": null,
      "PrioritizeMethodIDs": null,
      "SiteID": 30201,
      "NotificationDateTime": "20160314094220",
      "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,
      "RedirectURL": null
    },
    {
      "ID": 2427069,
      "SkinID": 11,
      "Created": "20160314093342",
      "MerchantTransactionID": "s2ptest_2",
      "Amount": 980,
      "Currency": "EUR",
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "test smart2pay",
      "MethodID": 75,
      "MethodOptionID": null,
      "IncludeMethodIDs": null,
      "ExcludeMethodIDs": null,
      "PrioritizeMethodIDs": null,
      "SiteID": 30201,
      "NotificationDateTime": "20160314094102",
      "Customer": null,
      "BillingAddress": null,
      "ShippingAddress": null,
      "Articles": null,
      "Details": null,
      "ReferenceDetails": null,
      "CustomParameters": null,
      "PreapprovalID": null,
      "Status": {
        "ID": 2,
        "Info": "Success",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "RedirectURL": null
    }
  ]
}

You can also mix various filters to get specific results. Here is an example of a request with the limit filter set to 2 and the offset 3. This means that it will return two payments entries starting with the third one.

Request:

GET https://paytest.smart2pay.com/v1/payments?limit=2&offset=3
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

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",
   "ReturnURL": "https://docs.smart2pay.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",
   "ReturnURL": "https://docs.smart2pay.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,
   "RedirectURL": null
    }
  ]
}

Get the Status of a Direct Card Payment

You can get the status of a direct card payment by using the following GET HTTP request.

Please note that this method sends only the status information about the payment. To receive more information about the payment go to Get information on a specific payment section.

Definition: GET /v1/payments/{id}/status

Where:
  • {id} – GlobalPay Payment ID

Request:

GET https://securetest.smart2pay.com/v1/payments/202230/status
Authorization: Basic MTAxMDpnYWJp

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "Payment": {
    "ID": 202230,
    "MerchantTransactionID": "s2ptest_h2",
    "Status": {
      "ID": 11,
      "Info": "Captured",
      "Reasons": []
    }
  }
}