Create a Payment

Definition: POST /v1/payments

To initiate a payment, you must create a payment object. The parameters of the payment are sent in the message body as a JSON object.

We recommend that the billing country (Payment.BillingAddress.Country) parameter to be sent. If this parameter is not sent the country is determined using IP detection, which is not always reliable. This parameter is used in various scenarios and an accurate value will increase conversion.

A 201 HTTP response (Created) is returned if the payment was correctly initialized.

The Customer ID parameter, the unique number that identifies the customer in the GlobalPay system, it will only be returned in response for the following payment methods: Debito Banco do Brasil (32), MercadoPago(46), Boleto (1000), Transferencia entre contas (1002), Cards Argentina (1079), Santander Rio (1080), Cash Payments Argentina (1081), Credit Cards Brazil (1082), Boleto Brazil (1083), Online Bank Transfer Brazil (1084), Credit Cards Chile (1085), Servipag (1086), WebPay (1087), Cards Colombia (1088), PSE Colombia (1089), Cash payment Colombia (1090), Cards Mexico (1091), Oxxo (1092), SPEI (1093), Bank Transfer Mexico (1094), Credit Cards Uruguay (1095), Redpagos (1096), Credit Cards(Visa) (1097), Cash payment Peru (1098), Bank Transfer Peru (1099).

Request:

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



{
  "Payment": {
    "MerchantTransactionID": "s2ptest_ga1",
    "Amount": 11,
    "Currency": "CNY",      
    "MethodID": 1066,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",      
    "TokenLifetime": 10,
    "Customer": {    
      "Email": "youremail@email.com"   
    },
    "BillingAddress": {
      "Country": "CN"
    }
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4683165,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20190621075306",
        "MerchantTransactionID": "s2ptest_ga1",
        "OriginatorTransactionID": null,
        "Amount": "11",
        "Currency": "CNY",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "",
        "MethodID": 1066,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": {
            "MerchantCustomerID": null,
            "Email": "youremail@email.com",
            "FirstName": null,
            "LastName": null,
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 291,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "CN"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": {
            "BankCode": null,
            "BankName": null,
            "EntityID": null,
            "EntityNumber": null,
            "ReferenceID": null,
            "ReferenceNumber": null,
            "SwiftBIC": null,
            "AccountCurrency": null,
            "AccountNumber": null,
            "AccountHolder": null,
            "IBAN": null,
            "AmountToPay": null,
            "QRCodeURL": "weixin://wxpay/bizpayurl?pr=dHj3ZkU",
            "Instructions": null,
            "BoletoURL": null
        },
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=D70DBE70D7A4FE3E0E6E035665B5598A.4683165"
    }
}

In order to initiate a Card payment, the payment object must contain the necessary card details.

Request:

POST https://securetest.smart2pay.com/v1/payments
Authorization: Basic MTAxMDpnYWJp

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_h2",
    "Amount": 2000,
    "Currency": "EUR",
    "Card": {
      "HolderName": "John Doe",
      "Number": "4111111111111111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2018",
      "SecurityCode": "312"
    },		
     "Capture": true
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "Payment": {
    "ID": 202230,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205084103",
    "MerchantTransactionID": "s2ptest_h2",
    "OriginatorTransactionID": null,
    "Amount": "2000",
    "Currency": "EUR",
    "CapturedAmount": 2000,
    "ReturnURL": null,
    "Description": null,
    "StatementDescriptor": null,
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Card": {
      "HolderName": "John Doe",
      "Number": "VISA-1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2018"
    },
    "CreditCardToken": null,
    "Status": {
      "ID": 11,
      "Info": "Captured",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": true,
    "Retry": false,
    "RedirectURL": null,
    "3DSecure": null
  }
}

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.

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_g213",
    "Amount": 11,
    "Currency": "CNY",      
    "MethodID": 1066,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",      
    "TokenLifetime": 10,
    "Customer": {    
      "Email": "youremail@email.com"   
    },
    "BillingAddress": {
      "Country": "CNN"
    }
  }
}

Response:

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

{
  "Payment": {
    "ID": 3470485,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20171216150143",
    "MerchantTransactionID": "s2ptest_g213",
    "OriginatorTransactionID": null,
    "Amount": "11",
    "Currency": "CNY",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": null,
    "MethodID": 1066,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": "20171216150143",
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 4,
      "Info": "Failed",
      "Reasons": [
        {
          "Code": 147,
          "Info": "Address details are invalid (BillingAddress)Country - RegEx: ^[a-zA-Z]{2}$;"
        }
      ]
    },
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

When the validation fails for a Card payment, an invalid request is inserted in the database and the ID of the newly inserted invalid request is sent in the Payment response. The value of the element InvalidRequestID is prefixed with ”i” to not be confused with the Payment ID.

Request:

POST https://securetest.smart2pay.com/v1/payments
Authorization: Basic MTAxMDpnYWJp

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_h2",
    "Amount": 2000,
    "Currency": "EUR",
    "Card": {
      "HolderName": "John Doe",
      "Number": "4111111111111111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2018",
      "SecurityCode": "312"
    },		
     "Capture": true
  }
}

Response:

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

{
  "Payment": {
    "InvalidRequestID": "i3065",
    "ID": null,
    "ClientIP": null,
    "SkinID": null,
    "Created": null,
    "MerchantTransactionID": "s2ptest_h2",
    "OriginatorTransactionID": null,
    "Amount": "2000",
    "Currency": "EUR",
    "CapturedAmount": 0,
    "ReturnURL": null,
    "Description": null,
    "StatementDescriptor": null,
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Card": {
      "HolderName": "John Doe",
      "Number": "Ends with 1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2018"
    },
    "CreditCardToken": null,
    "Status": {
      "ID": null,
      "Info": null,
      "Reasons": [
        {
          "Code": 20,
          "Info": "Key is duplicated"
        }
      ]
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": true,
    "Retry": false,
    "RedirectURL": null,
    "3DSecure": null
  }
}

Please visit our section: Create a complex payment in order to see a full example of a payment with all the parameters needed for the request. The parameters are sent in the message body as a JSON object.

Capture a Payment

Definition: Full Capture – POST /v1/payments/{id}/capture
Partial Capture – POST /v1/payments/{id}/capture?{amount}

Where:
  • {id} – GlobalPay Payment ID
  • {amount} – The amount to be captured smaller or equal than the initial authorized amount

A payment can only be captured if it has an Authorized status. The Authorized status can only be obtained for Cards, Klarna methods, Cards Russsia, Paysafecard, Paypal and PostFinance payment methods.

Once the payment has an Authorized status, you can capture either the full amount or a partial amount of the initial authorized amount for the transaction.

For more detailed information regarding different Capture scenarios for a specific payment method, please click on the appropriate link: Cards, Klarna Payments, Cards Russia and PostFinance.

A 200 HTTP response (OK) is returned if the request was completed successfully.

Full capture means you capture the entire authorized amount for the initial transaction.

Request:

POST https://paytest.smart2pay.com/v1/payments/3897941/capture
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

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

{
  "Payment": {
    "ID": 3897941,
    "SkinID": 11,
    "ClientIP": null,
    "Created": "20180615085707",
    "MerchantTransactionID": "s2ptest_g241",
    "OriginatorTransactionID": null,
    "Amount": "899",
    "Currency": "GBP",
    "CapturedAmount": 899,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": null,
    "MethodID": 1078,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": "20180615085820",
    "Customer": {
      "ID": 340,
      "MerchantCustomerID": "0125",
      "Email": "youremail@email.com",
      "FirstName": "Doe",
      "LastName": "Test",
      "Gender": "0",
      "SocialSecurityNumber": "0801363945",
      "Phone": "+440745785615",
      "Company": "S2P",
      "DateOfBirth": null
      },
    "BillingAddress": {
      "ID": 3959,
      "City": "London",
      "ZipCode": "W13 3BG",
      "State": "London",
      "Street": "New Burlington St 113",
      "StreetNumber": "Apt 214",
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "GB"
      },
    "ShippingAddress": {
      "ID": 3959,
      "City": "London",
      "ZipCode": "W13 3BG",
      "State": "London",
      "Street": "New Burlington St 113",
      "StreetNumber": "Apt 214",
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "GB"
      },
    "Articles": [
      {
      "MerchantArticleID": "1235",
      "Name": "Physical",
      "Quantity": 1,
      "Price": "1000",
      "VAT": "1200",
      "Discount": "0.09",
      "Type": "5",
      "DiscountValue": "100"
      }
    ],
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
      },
    "MethodTransactionID": null,
    "TokenLifetime": 10,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=8E9EBC84E9E19B696BC9A805564E85A7.3897941"
  }
}

Partial capture means you have the possibility to capture a smaller amount than the one from the initial authorized transaction.

You can perform only one partial capture for an authorized transaction with the limitation that the amount of the partial capture to be smaller or equal than the initial authorized amount.

Request:

POST https://paytest.smart2pay.com/v1/payments/202239/capture?amount=1000
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

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

{
  "Payment": {
    "ID": 202239,
    "SkinID": 11,
    "ClientIP": null,
    "Created": "20180615085707",
    "MerchantTransactionID": "s2ptest_g241_a",
    "OriginatorTransactionID": null,
    "Amount": "2000",
    "Currency": "GBP",
    "CapturedAmount": "1000",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": null,
    "MethodID": 1078,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": "20180615085820",
    "Customer": {
      "ID": 340,
      "MerchantCustomerID": "0125",
      "Email": "youremail@email.com",
      "FirstName": "Doe",
      "LastName": "Test",
      "Gender": "0",
      "SocialSecurityNumber": "0801363945",
      "SocialSecurityNumber2": null,
      "Phone": "+440745785615",
      "Company": "S2P",
      "DateOfBirth": null
      },
    "BillingAddress": {
      "ID": 3959,
      "City": "London",
      "ZipCode": "W13 3BG",
      "State": "London",
      "Street": "New Burlington St 113",
      "StreetNumber": "Apt 214",
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "GB"
      },
    "ShippingAddress": {
      "ID": 3959,
      "City": "London",
      "ZipCode": "W13 3BG",
      "State": "London",
      "Street": "New Burlington St 113",
      "StreetNumber": "Apt 214",
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "GB"
      },
    "Articles": [
      {
      "MerchantArticleID": "1235",
      "Name": "Physical",
      "Quantity": 1,
      "Price": "1000",
      "VAT": "1200",
      "Discount": "0.09",
      "Type": "5",
      "DiscountValue": "100"
      }
    ],
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
      },
    "MethodTransactionID": null,
    "TokenLifetime": 10,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=8E9EBC84E9E19B696BC9A805564E85A7.3897941"
  }
}

For more information regarding Full and Partial Capture for Klarna Payments, please visit our Klarna Payments section.

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.

Request:

POST https://paytest.smart2pay.com/v1/payments/3897941/capture
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

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

{
  "Payment": {
    "ID": 3897941,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20180615085707",
    "MerchantTransactionID": null,
    "OriginatorTransactionID": null,
    "Amount": null,
    "Currency": null,
    "CapturedAmount": null,
    "ReturnURL": null,
    "Description": null,
    "MethodID": 1078,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": "20180615085820",
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": [
      {
        "Code": "17",
        "Info": "Payment is invalid - 3897941"
        }
      ]
    },
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

Cancel a Payment

Definition: POST /v1/payments/{id}/cancel

Where:
  • {id} – GlobalPay Payment ID

A payment can be cancelled if it has an Authorized or an Open status. The Authorized status can only be obtained for some payment methods like: Cards, Klarna methods, Cards Russsia, Paysafecard, Paypal and PostFinance.

A payment with an Open status can be cancelled if the payment has been initiated but the customer hasn’t accessed the RedirectURL or the customer didn’t get to the provider’s side. For the offline payment methods the payment can be cancelled if the customer hasn’t yet received the payment details.

A 200 HTTP response (OK) is returned if the request was completed successfully.

Request:

POST https://paytest.smart2pay.com/v1/payments/3897979/cancel
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

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

{
  "Payment": {
    "ID": 3897979,
    "SkinID": 11,
    "ClientIP": null,
    "Created": "20180615091144",
    "MerchantTransactionID": "s2ptest_g242",
    "OriginatorTransactionID": null,
    "Amount": "899",
    "Currency": "GBP",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": null,
    "MethodID": 1078,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": "20180615091304",
    "Customer": {
      "ID": 340,
      "MerchantCustomerID": "0125",
      "Email": "youremail@email.com",
      "FirstName": "Doe",
      "LastName": "Test",
      "Gender": "0",
      "SocialSecurityNumber": "0801363945",
      "Phone": "+440745785615",
      "Company": "S2P",
      "DateOfBirth": null
      },
    "BillingAddress": {
      "ID": 3959,
      "City": "London",
      "ZipCode": "W13 3BG",
      "State": "London",
      "Street": "New Burlington St 113",
      "StreetNumber": "Apt 214",
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "GB"
      },
    "ShippingAddress": {
      "ID": 3959,
      "City": "London",
      "ZipCode": "W13 3BG",
      "State": "London",
      "Street": "New Burlington St 113",
      "StreetNumber": "Apt 214",
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "GB"
      },
    "Articles": [
      {
      "MerchantArticleID": "1235",
      "Name": "Physical",
      "Quantity": 1,
      "Price": "1000",
      "VAT": "1200",
      "Discount": "0.09",
      "Type": "5",
      "DiscountValue": "100"
      }
    ],
    "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
  }
}

For Card payments the Authorized status can be obtained when a payment is initiated with the Capture parameter set to false.

Request:

POST https://paytest.smart2pay.com/v1/payments/202237/cancel
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "Payment": {
    "ID": 202237,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205091456",
    "MerchantTransactionID": "s2ptest_h8",
    "OriginatorTransactionID": null,
    "Amount": "2000",
    "Currency": "EUR",
    "CapturedAmount": 0,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 115,
      "MerchantCustomerID": "null",
      "Email": "customer@test.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": "1",
      "SocialSecurityNumber": "45908-28324",
      "Phone": "0744-783322",
      "Company": "S2P"
    },
    "BillingAddress": {
      "ID": 253,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "ShippingAddress": {
      "ID": 87,
      "City": "Iasi",
      "ZipCode": "700049",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "-",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "Articles": null,
    "Card": null,
    "CreditCardToken": null,
    "Status": {
      "ID": 3,
      "Info": "Cancelled",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": null
  }
}

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.

Request:

POST https://paytest.smart2pay.com/v1/payments/3897979/cancel
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

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

{
  "Payment": {
    "ID": 3897979,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20180615091144",
    "MerchantTransactionID": null,
    "OriginatorTransactionID": null,
    "Amount": null,
    "Currency": null,
    "CapturedAmount": null,
    "ReturnURL": null,
    "Description": null,
    "MethodID": 1078,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": "20180615091304",
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 3,
      "Info": "Cancelled",
      "Reasons": [
        {
        "Code": "17",
        "Info": "Payment is invalid - 3897979"
        }
      ]
    },
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

Payment Notification

Whenever a payment process is completed, we notify you of the event and whether it was successful or not. GlobalPay will send a POST message to the notification URL you setup in the Merchant Dashboard.

You need to respond with HTTP code 204 (No Content)!

Please note that you need to respond within a 30 seconds time limit otherwise we will resend the notification.

We recommend you to always verify the Notification content we sent and not just simply/automatically respond to our notifications. Also it is highly recommended to match the values for notification Amount and Currency with the ones from your database!

In exceptional cases it is possible to receive different notifications and your system should be able to handle such situations. If an additional notification is received with Success Status, it overwrites any previous notification.

If you do not respond to the notifications of type Payment our system will keep sending the notifications until it receives a response. At first you will be notified more often. Once the time passes the notifications from our system will be rare and they will eventually stop (after a period of time defined in our system, currently set to 7 days).

Payment Notification Format

We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

For the payment methods where the Customer ID parameter is not being sent in the initial payment response, the notification format will contain a Customer object with a NULL value.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
    "Payment": {
        "ID": 4683165,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20190621075306",
        "MerchantTransactionID": "s2ptest_ga1",
        "OriginatorTransactionID": null,
        "Amount": "11",
        "Currency": "CNY",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "",
        "MethodID": 1066,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer":  null,
        "BillingAddress": {
            "ID": 291,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "CN"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": {
            "BankCode": null,
            "BankName": null,
            "EntityID": null,
            "EntityNumber": null,
            "ReferenceID": null,
            "ReferenceNumber": null,
            "SwiftBIC": null,
            "AccountCurrency": null,
            "AccountNumber": null,
            "AccountHolder": null,
            "IBAN": null,
            "AmountToPay": null,
            "QRCodeURL": "weixin://wxpay/bizpayurl?pr=dHj3ZkU",
            "Instructions": null,
            "BoletoURL": null
        },
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=D70DBE70D7A4FE3E0E6E035665B5598A.4683165"
    }
}

Response:

204 No Content

For the payment methods where the Customer ID parameter is being sent in the initial payment response, the notification format will contain a Customer object with all the details.

Payment notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "ID": 232662304,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20190612180443",
    "MerchantTransactionID": "1560362681423",
    "OriginatorTransactionID": null,
    "Amount": "30000",
    "Currency": "BRL",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "Test Payment",
    "MethodID": 46,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 31547,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 2403413,
      "MerchantCustomerID": null,
      "Email": "test@gmail.com",
      "FirstName": "Test Person",
      "LastName": null,
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "ID": 89794,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "BR"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": 5,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": "https://globalapi.smart2pay.com/Home?PaymentToken=6F00D7B7444DA35A316F184DA554E965.232662304"
  }
}

Response:

204 No Content

For Card payment notifications, you will also receive the new status of the card payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MTAxMDpnYWJp

{
  "Payment": {
    "ID": 202238,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205091735",
    "MerchantTransactionID": "s2ptest_h9",
    "OriginatorTransactionID": null,
    "Amount": "2000",
    "Currency": "EUR",
    "CapturedAmount": "2000",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 115,
      "MerchantCustomerID": "null",
      "Email": "customer@test.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": "1",
      "SocialSecurityNumber": "45908-28324",
      "Phone": "0744-783322",
      "Company": "S2P"
    },
    "BillingAddress": {
      "ID": 253,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "ShippingAddress": {
      "ID": 87,
      "City": "Iasi",
      "ZipCode": "700049",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "-",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "Articles": null,
    "Card": null,
    "CreditCardToken": null,
    "Status": {
      "ID": 11,
      "Info": "Captured",
      "Reasons": []
    },
    "CaptureDetails": {
      "ID": 264,
      "Amount": 2000,
      "Status": {
        "ID": 2,
        "Info": "Success",
        "Reasons": []
      }
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": null
  }
}

Response:

204 No Content

Whenever a payment changes its status, we notify you of the event and whether it was successful or not. In case of a non-successful payment, additional information to why the payment got to this status will be sent in the Reasons Code and Info fields.

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

Payment notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{

  "Payment": {
    "ID": 3470169,        
    "SkinID": null,        
    "ClientIP": null,        
    "Created": "20171216132024",        
    "MerchantTransactionID": "s2ptest_g282",
    "OriginatorTransactionID": null,
    "Amount": 100,
    "Currency": "EUR",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": null,
    "MethodID": 2,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": "20171216132024",
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 4,
      "Info": "Failed",
      "Reasons": [
        {
          "Code": "147",
          "Info": "Address details are invalid (BillingAddress)Country - RegEx: ^[a-zA-Z]{2}$;"
        }
      ]
    },
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

Response:

204 No Content

Payment Notification Security

You will receive a notification whenever a payment process is completed, successful or not. GlobalPay will send a POST message to the Notification URL you initially setup in the Merchant Dashboard.

To ensure that a payment has been securely processed you will need to validate the authorization header using your SiteID and API Key in the same manner you compute the authorization header for a request. For more details, please go to Authentication section.

Also, you will have to whitelist Smart2Pay’s IPs for Test and Live Environment.
Here you will find the complete list of GlobalPay’s Environments and IPs.

Redirection status vs. Notification status

After a payment flow is completed, the customer will be redirected to the ReturnURL you provided in the initial request. We will append to the URL a redirection status, called data, in case you want to display customized messages to the customer (recommended as best practice).

We are also appending the MerchantTransactionID so you can link it with a payment in your system.

However, a successful redirection status does not guarantee that the transaction will have a success notification status. Please be aware that only based on our successful notification status you should release the goods or services!

REDIRECTION STATUS
Data Description Example
2 Success http://demo.smart2pay.com/_redirectURLs/success.html?data=2&MerchantTransactionID=543642229015;
3 Cancelled http://demo.smart2pay.com/_redirectURLs/cancel.html?data=3&MerchantTransactionID=5436794534015
4 Failed http://demo.smart2pay.com/_redirectURLs/failure.html?data=4&MerchantTransactionID=5436422294534015
7 Processing http://demo.smart2pay.com/_redirectURLs/processing.html?data=7&MerchantTransactionID=905017166382&StatusID=7&StatusName=PendingOnProvider
9 Authorized http://demo.smart2pay.com/_redirectURLs/authorized.html?data=9&MerchantTransactionID=747536794534015

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/4168568
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

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

{
    "Payment": {
        "ID": 4168568,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20181102144444",
        "MerchantTransactionID": "s2ptest_h15",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "EUR",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": null,
        "MethodID": 2,
        "MethodOptionID": 10,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": "20181102144530",
        "Customer": null,
        "BillingAddress": {
            "ID": 309,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "NL"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": {
            "AccountNumber": "NL53INGB0654422370",
            "AccountHolder": "Hr E G H Küppers en/of MW M.J. Küppers-Veeneman",
            "IBAN": null,
            "BIC": null,
            "PrepaidCard": null,
            "PrepaidCardPIN": null,
            "SerialNumbers": null,
            "Wallet": null,
            "ReferenceNumber": null,
            "PayerCountry": null,
            "PayerEmail": null,
            "PayerPhone": null,
            "BankCode": null,
            "BankName": null,
            "BankSortCode": null,
            "SocialSecurityNumber": null,
            "BillingCycleStart": null,
            "BillingCycleEnd": null,
            "UnsubscribeInstructions": null,
            "CustomerLoginID": null,
            "PaidAmount": null,
            "PaidCurrency": null,
            "ProviderExchangeRate": 0,
            "PayerBankAccountID": null
        },
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 2,
            "Info": "Success",
            "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": 1,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=FD56DAA48DAC61477DA6838CBDFC03D7.4168568"
    }
}

The same action can be used to get information on a specific card payment.

Request:

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

Response:

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

{
  "Payment": {
    "ID": 202230,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205084103",
    "MerchantTransactionID": "s2ptest_h2",
    "OriginatorTransactionID": null,
    "Amount": "2000",
    "Currency": "EUR",
    "CapturedAmount": 2000,
    "ReturnURL": null,
    "Description": null,
    "StatementDescriptor": null,
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Card": null,
    "CreditCardToken": null,
    "Status": {
      "ID": 11,
      "Info": "Captured",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": true,
    "Retry": false,
    "RedirectURL": null,
    "3DSecure": null
  }
}

Get a list of payments

This action allows you to get a list of payments. Without specifying any parameter, the default number of transactions that will be returned per page will be the one configured in our system. Please be aware that only a limited amount of details for each payment will be provided.

Definition: GET /v1/payments

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

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": 3127172,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170818080941",
      "MerchantTransactionID": "WPD_1503043646_2119_1662",
      "OriginatorTransactionID": null,
      "Amount": "1",
      "Currency": "EUR",
      "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": null,
      "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,
      "PreapprovalDetails": null,
      "RedirectURL": null
    },
    {
      "ID": 3121249,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170817144711",
      "MerchantTransactionID": "cristinatesting125",
      "OriginatorTransactionID": null,
      "Amount": "500",
      "Currency": "EUR",
      "CapturedAmount": null,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "TestPayment",
      "MethodID": 9,
      "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": 2,
        "Info": "Success",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "PreapprovalDetails": null,
      "RedirectURL": null
    },
    {
      "ID": 3121248,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170817144412",
      "MerchantTransactionID": "cristinatesting124",
      "OriginatorTransactionID": null,
      "Amount": "5",
      "Currency": "MXN",
      "CapturedAmount": null,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "TestPayment",
      "MethodID": 9,
      "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
    },
    {
      "ID": 3121247,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170817144329",
      "MerchantTransactionID": "cristinatesting123",
      "OriginatorTransactionID": null,
      "Amount": "5",
      "Currency": "MXN",
      "CapturedAmount": null,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "TestPayment",
      "MethodID": 49,
      "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": 2,
        "Info": "Success",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "PreapprovalDetails": null,
      "RedirectURL": null
    },
    {
      "ID": 3121242,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170817143541",
      "MerchantTransactionID": "cristinatest16",
      "OriginatorTransactionID": null,
      "Amount": "980",
      "Currency": "EUR",
      "CapturedAmount": null,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "smart2pay test",
      "MethodID": 9,
      "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": 2,
        "Info": "Success",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "PreapprovalDetails": null,
      "RedirectURL": null
    },
    {
      "ID": 3121241,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170817143454",
      "MerchantTransactionID": "cristinatest15",
      "OriginatorTransactionID": null,
      "Amount": "980",
      "Currency": "EUR",
      "CapturedAmount": null,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "smart2pay test",
      "MethodID": 75,
      "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": 9,
        "Info": "Authorized",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "PreapprovalDetails": null,
      "RedirectURL": null
    },
    {
      "ID": 3120486,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170817131458",
      "MerchantTransactionID": "s2psabaassaSadadeedte99xst_g20",
      "OriginatorTransactionID": null,
      "Amount": "1",
      "Currency": "EUR",
      "CapturedAmount": null,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": null,
      "MethodID": 2,
      "MethodOptionID": 20,
      "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": 1,
        "Info": "Open",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "PreapprovalDetails": null,
      "RedirectURL": null
    },
    {
      "ID": 3119625,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170817121535",
      "MerchantTransactionID": "s2psabaassaSaaedtexst_g20",
      "OriginatorTransactionID": null,
      "Amount": "1",
      "Currency": "EUR",
      "CapturedAmount": null,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": null,
      "MethodID": 2,
      "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": 1,
        "Info": "Open",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "PreapprovalDetails": null,
      "RedirectURL": null
    },
    {
      "ID": 3119610,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170817121352",
      "MerchantTransactionID": "s2psabaassaSedtexst_g20",
      "OriginatorTransactionID": null,
      "Amount": "1",
      "Currency": "EUR",
      "CapturedAmount": null,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": null,
      "MethodID": 2,
      "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": 1,
        "Info": "Open",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "PreapprovalDetails": null,
      "RedirectURL": null
    },
    {
      "ID": 3119557,
      "SkinID": null,
      "ClientIP": null,
      "Created": "20170817121224",
      "MerchantTransactionID": "s2psabaassaSdtexst_g20",
      "OriginatorTransactionID": null,
      "Amount": "11",
      "Currency": "CNY",
      "CapturedAmount": null,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": null,
      "MethodID": 2,
      "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": 1,
        "Info": "Open",
        "Reasons": null
      },
      "MethodTransactionID": null,
      "TokenLifetime": null,
      "Capture": null,
      "PreapprovalDetails": null,
      "RedirectURL": null
    }
  ],
      "Count": 10,
      "TotalPages": 358,
      "TotalCount": 3576,
      "PageIndex": 1,
      "PageSize": 10  
}

The same action can be used to get a list of card payments. Please be aware that only a limited amount of details for each direct card payment will be provided.

Request:

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

Response:

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

{
  "Payments": [
    {
      "ID": 202245,
      "ClientIP": null,
      "SkinID": null,
      "Created": "20161205094557",
      "MerchantTransactionID": "s2ptest_h17",
      "OriginatorTransactionID": null,
      "Amount": "2000",
      "Currency": "EUR",
      "CapturedAmount": 2000,
      "ReturnURL": null,
      "Description": null,
      "StatementDescriptor": null,
      "MethodID": 6,
      "MethodOptionID": null,
      "SiteID": 1010,
      "NotificationDateTime": null,
      "Customer": null,
      "BillingAddress": null,
      "ShippingAddress": null,
      "Articles": null,
      "Card": null,
      "CreditCardToken": null,
      "Status": {
        "ID": 11,
        "Info": "Captured",
        "Reasons": []
      },
      "MethodTransactionID": null,
      "PaymentTokenLifetime": null,
      "Capture": null,
      "Retry": null,
      "RedirectURL": null,
      "3DSecure": null
    },
    {
      "ID": 202244,
      "ClientIP": null,
      "SkinID": null,
      "Created": "20161205094546",
      "MerchantTransactionID": "s2ptest_h16",
      "OriginatorTransactionID": null,
      "Amount": "2000",
      "Currency": "EUR",
      "CapturedAmount": 0,
      "ReturnURL": null,
      "Description": null,
      "StatementDescriptor": null,
      "MethodID": 6,
      "MethodOptionID": null,
      "SiteID": 1010,
      "NotificationDateTime": null,
      "Customer": null,
      "BillingAddress": null,
      "ShippingAddress": null,
      "Articles": null,
      "Card": null,
      "CreditCardToken": null,
      "Status": {
        "ID": 9,
        "Info": "Authorized",
        "Reasons": []
      },
      "MethodTransactionID": null,
      "PaymentTokenLifetime": null,
      "Capture": null,
      "Retry": null,
      "RedirectURL": null,
      "3DSecure": null
    },
    {
      "ID": 202243,
      "ClientIP": null,
      "SkinID": null,
      "Created": "20161205093245",
      "MerchantTransactionID": "s2ptest_h13",
      "OriginatorTransactionID": null,
      "Amount": "2000",
      "Currency": "EUR",
      "CapturedAmount": 0,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "payment product",
      "StatementDescriptor": "bank statement message",
      "MethodID": 6,
      "MethodOptionID": null,
      "SiteID": 1010,
      "NotificationDateTime": null,
      "Customer": {
        "ID": 115,
        "MerchantCustomerID": "null",
        "Email": "customer@test.com",
        "FirstName": "John",
        "LastName": "Doe",
        "Gender": "1",
        "SocialSecurityNumber": "45908-28324",
        "Phone": "0744-783322",
        "Company": "S2P"
      },
      "BillingAddress": {
        "ID": 253,
        "City": "Iasi",
        "ZipCode": "7000-49",
        "State": "Iasi",
        "Street": "Sf Lazar",
        "StreetNumber": "37",
        "HouseNumber": "5A",
        "HouseExtension": "-",
        "Country": "RO"
      },
      "ShippingAddress": {
        "ID": 87,
        "City": "Iasi",
        "ZipCode": "700049",
        "State": "Iasi",
        "Street": "Sf Lazar",
        "StreetNumber": "37",
        "HouseNumber": "-",
        "HouseExtension": "-",
        "Country": "RO"
      },
      "Articles": null,
      "Card": null,
      "CreditCardToken": null,
      "Status": {
        "ID": 1,
        "Info": "Open",
        "Reasons": []
      },
      "MethodTransactionID": null,
      "PaymentTokenLifetime": null,
      "Capture": null,
      "Retry": null,
      "RedirectURL": null,
      "3DSecure": null
    },
    {
      "ID": 202242,
      "ClientIP": null,
      "SkinID": null,
      "Created": "20161205093117",
      "MerchantTransactionID": "s2ptest_h12",
      "OriginatorTransactionID": null,
      "Amount": "2000",
      "Currency": "EUR",
      "CapturedAmount": 2000,
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "payment product",
      "StatementDescriptor": "bank statement message",
      "MethodID": 6,
      "MethodOptionID": null,
      "SiteID": 1010,
      "NotificationDateTime": null,
      "Customer": {
        "ID": 115,
        "MerchantCustomerID": "null",
        "Email": "customer@test.com",
        "FirstName": "John",
        "LastName": "Doe",
        "Gender": "1",
        "SocialSecurityNumber": "45908-28324",
        "Phone": "0744-783322",
        "Company": "S2P"
      },
      "BillingAddress": {
        "ID": 253,
        "City": "Iasi",
        "ZipCode": "7000-49",
        "State": "Iasi",
        "Street": "Sf Lazar",
        "StreetNumber": "37",
        "HouseNumber": "5A",
        "HouseExtension": "-",
        "Country": "RO"
      },
      "ShippingAddress": {
        "ID": 87,
        "City": "Iasi",
        "ZipCode": "700049",
        "State": "Iasi",
        "Street": "Sf Lazar",
        "StreetNumber": "37",
        "HouseNumber": "-",
        "HouseExtension": "-",
        "Country": "RO"
      },
      "Articles": null,
      "Card": null,
      "CreditCardToken": null,
      "Status": {
        "ID": 11,
        "Info": "Captured",
        "Reasons": []
      },
      "MethodTransactionID": null,
      "PaymentTokenLifetime": null,
      "Capture": null,
      "Retry": null,
      "RedirectURL": null,
      "3DSecure": null
    },
    {
      "ID": 202240,
      "ClientIP": null,
      "SkinID": null,
      "Created": "20161205092303",
      "MerchantTransactionID": "s2ptest_h11",
      "OriginatorTransactionID": null,
      "Amount": "2000",
      "Currency": "EUR",
      "CapturedAmount": 1000,
      "ReturnURL": null,
      "Description": null,
      "StatementDescriptor": null,
      "MethodID": 6,
      "MethodOptionID": null,
      "SiteID": 1010,
      "NotificationDateTime": null,
      "Customer": null,
      "BillingAddress": null,
      "ShippingAddress": null,
      "Articles": null,
      "Card": null,
      "CreditCardToken": null,
      "Status": {
        "ID": 35,
        "Info": "PartiallyCaptured",
        "Reasons": []
      },
      "MethodTransactionID": null,
      "PaymentTokenLifetime": null,
      "Capture": null,
      "Retry": null,
      "RedirectURL": null,
      "3DSecure": null
    }
  ]
}

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

Get Exchange Rates

You can get information about exchange rates for all our supported currencies (200 + transaction currencies) by using the following GET HTTP request. The parameters are sent in the message body as a JSON object.

This action can be exploited when DCC (Dynamic Currency Conversion) is being used. DCC means Dynamic currency conversion which allows you to initiate transactions in any currency you want, even if specific payment method doesn’t support that currency. Our system will take care of converting the transaction currency in a currency supported by the payment method.

Just replace the fields From and To in the request below with the currency codes you want exchange rate for and make a GET request.

Definition: GET /v1/exchangerates/{FromCurrency}/{ToCurrency}

Where:
  • {FromCurrency} – The three letter currency code (Alphabetic code of ISO 4217) I want exchage rate from;
  • {ToCurrency} – The three letter currency code (Alphabetic code of ISO 4217) I want exchage rate to.

Request:

GET https://paytest.smart2pay.com/v1/exchangerates/EUR/USD
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

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

{
  "ExchangeRate": {
    "From": "EUR",
    "To": "USD",
    "DateTime": "20181022130450",
    "Rate": 1.05
  }
}

Get the status of a card payment

You can get the status of a 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": []
    }
  }
}