Bank Transfer Payment Request

Definition: POST https://paytest.smart2pay.com/v1/payments

Below you will find a full example of a payment request for Bank Transfer method (with Success and Bad response). The parameters of the payment are sent in the message body as a JSON object.

In order to display the bank transfer details to your customers on your own page, you can send in the request the CustomerName and Country parameters. Use the information received in Response in the ReferenceDetails object.

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

For more information about status codes, please go to Basic HTTP Status Codes.

Request: 

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

{
  "Payment":{
    "MerchantTransactionID": "s2ptest_h35",
    "Amount": 400,
    "Currency": "PLN",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "BankTransferTestdetails",
    "MethodID": "1",
    "BillingAddress": {
      "Country": "DE"
    },
    "Customer": {
      "FirstName": "John",
      "LastName": "Doe"
    }
  }
}

Response:

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

{
    "Payment": {
        "ID": 4178425,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20181107093433",
        "MerchantTransactionID": "s2ptest_h35",
        "OriginatorTransactionID": null,
        "Amount": "400",
        "Currency": "PLN",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "BankTransferTestdetails",
        "MethodID": 1,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": {
            "ID": 142823,
            "MerchantCustomerID": null,
            "Email": null,
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "SocialSecurityNumber2": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 420,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "DE"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": {
            "BankCode": null,
            "BankName": "ING Bank",
            "EntityID": null,
            "EntityNumber": null,
            "ReferenceID": null,
            "ReferenceNumber": "HPP4178425",
            "SwiftBIC": "INGBDEFF",
            "AccountCurrency": "EUR",
            "AccountNumber": "0010126423",
            "AccountHolder": "Stichting Smart2Pay Escrow Services",
            "IBAN": "DE72 5002 1000 0010 1264 23",
            "AmountToPay": "0.93 EUR",
            "QRCodeURL": null,
            "Instructions": null
        },
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": 1,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=F152AF870FFF05B98A83F7B8C35A81D9.4178425"
    }
}

There is another possibility to initiate a Bank Transfer transaction where you can send your own Reference Number in the request. Checkout the below example with the ReferenceNumber parameter sent in the request together with Customer parameters:

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_h39",
    "Amount": 400,
    "Currency": "PLN",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "BankTransferTestdetails",
    "MethodID": "1",
    "BillingAddress": {
      "Country": "DE"
    },
    "Customer": {
      "FirstName": "John",
      "LastName": "Doe"
    },
    "Details": {
      "ReferenceNumber": "your_reference_number"
    }
  }
}

Response:

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

{
    "Payment": {
        "ID": 4178441,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20181107095318",
        "MerchantTransactionID": "s2ptest_h39",
        "OriginatorTransactionID": null,
        "Amount": "400",
        "Currency": "PLN",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "BankTransferTestdetails",
        "MethodID": 1,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": {
            "ID": 142823,
            "MerchantCustomerID": null,
            "Email": null,
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "SocialSecurityNumber2": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 420,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "DE"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": {
            "AccountNumber": null,
            "AccountHolder": null,
            "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": {
            "BankCode": null,
            "BankName": "ING Bank",
            "EntityID": null,
            "EntityNumber": null,
            "ReferenceID": null,
            "ReferenceNumber": "your_reference_number",
            "SwiftBIC": "INGBDEFF",
            "AccountCurrency": "EUR",
            "AccountNumber": "0010126423",
            "AccountHolder": "Stichting Smart2Pay Escrow Services",
            "IBAN": "DE72 5002 1000 0010 1264 23",
            "AmountToPay": "0.93 EUR",
            "QRCodeURL": null,
            "Instructions": null
        },
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": 1,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=DDC981EDC0426B8C22F57F88FD8B0FF4.4178441"
    }
}

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_h36",
    "Amount": 400,
    "Currency": "PLN",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "BankTransferTestdetails",
    "MethodID": "1",
    "BillingAddress": {
      "Country": "Germany"
    },
    "Customer": {
      "FirstName": "John",
      "LastName": "Doe"
    }
  }
}

Response:

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

{
    "Payment": {
        "ID": 4178427,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20181107094050",
        "MerchantTransactionID": "s2ptest_h36",
        "OriginatorTransactionID": null,
        "Amount": "400",
        "Currency": "PLN",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "BankTransferTestdetails",
        "MethodID": 1,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": "20181107094050",
        "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
    }
}