PayWithMyBank Change a Preapproval

Definition: PATCH /v1/preapprovals/{id}

Where:
  • {id} – GlobalPay Preapproval ID

You can change the attributes of an already created preapproval by applying a PATCH.

Checkout the below example to change a preapproval for PayWithMyBank (58):

Request:

PATCH https://paytest.smart2pay.com/v1/preapprovals/19800
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
 "Preapproval": {
   "MerchantPreapprovalID": "s2ptest_h-1",
   "PreapprovedMaximumAmount": 20,
   "Currency": "USD",
   "Description": "Update: 1 year subscription",
   "ReturnURL": "http://demo.smart2pay.com/redirect.php",
   "MethodID": 58,
   "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "jdoe@gmail.com"
     },
   "BillingAddress": {
      "Country": "US"
      }
   }
}

Response:

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

{
    "Preapproval": {
        "ID": 19800,
        "Created": "20190729134913",
        "MethodID": 58,
        "SiteID": 30201,
        "MerchantPreapprovalID": "s2ptest_h-1",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": "20",
        "Currency": "USD",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "Update: 1 year subscription",
        "Customer": {
            "ID": 2625948,
            "MerchantCustomerID": null,
            "Email": "jdoe@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 520,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "US"
        },
        "Status": {
            "ID": 1,
            "Info": "Pending",
            "Reasons": null
        },
        "RedirectURL": "https://europaytest.smart2pay.com/PWMB/Landing/PreapprovalLanding.aspx?ID=15352&Hash=8FCF71570B0E7CE025C33B27E34F4493",
        "MethodOptionID": 0,
        "PreapprovedFrequency": null,
        "MandateReference": null,
        "Details": null
    }
}