Definition: DELETE /v1/preapprovals/{id}
Where:
- {id} – GlobalPay Preapproval ID
To close a preapproval, you must send a DELETE action for an existing preapproval object. See below our examples for closing a preapproval for MercadoPago (46) and SEPA Direct Debit (84).
- Checkout the below example to close a preapproval for MercadoPago (46):
Request:
DELETE https://paytest.smart2pay.com/v1/preapprovals/4217 Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
Response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "Preapproval": { "ID": 4217, "Created": "20170804065155", "MethodID": 46, "SiteID": 30201, "MerchantPreapprovalID": "s2ptest_g107", "RecurringPeriod": 0, "PreapprovedMaximumAmount": null, "Currency": null, "ReturnURL": "http://demo.smart2pay.com/redirect.php", "Description": "1 year subscription update1", "Customer": { "ID": 3627, "MerchantCustomerID": null, "Email": "test_user_83022133@testuser.com", "FirstName": "John", "LastName": "Doe", "Gender": null, "SocialSecurityNumber": null, "Phone": "0765260000", "Company": null, "DateOfBirth": null }, "BillingAddress": { "ID": 1257, "City": "Rio de Janeiro", "ZipCode": "23900-000", "State": null, "Street": "Tonelero", "StreetNumber": "1", "HouseNumber": null, "HouseExtension": null, "Country": "BR" }, "Status": { "ID": 4, "Info": "ClosedByCustomer", "Reasons": null }, "RedirectURL": null, "MethodOptionID": 0, "PreapprovedFrequency": null, "MandateReference": null } }
- Checkout the below example to close a preapproval for SEPA Direct Debit (84):
Request:
DELETE https://paytest.smart2pay.com/v1/preapprovals/12351 Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
Response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "Preapproval": { "ID": 12351, "Created": "20180912102819", "MethodID": 84, "SiteID": 30201, "MerchantPreapprovalID": "s2ptest_f102", "RecurringPeriod": 0, "PreapprovedMaximumAmount": null, "Currency": null, "ReturnURL": "http://demo.smart2pay.com/redirect.php", "Description": "SEPA DD preapproval request", "Customer": { "ID": 114724, "MerchantCustomerID": null, "Email": "youremail@gmail.com", "FirstName": "John", "LastName": "Smith", "Gender": null, "SocialSecurityNumber": null, "SocialSecurityNumber2": null, "Phone": "+4976526000", "Company": "Smart2Pay", "DateOfBirth": null }, "BillingAddress": { "ID": 4796, "City": "Oyenhausen", "ZipCode": "32547", "State": null, "Street": "Schulstrasse", "StreetNumber": "4", "HouseNumber": null, "HouseExtension": null, "Country": "DE" }, "Status": { "ID": 4, "Info": "ClosedByCustomer", "Reasons": null }, "RedirectURL": null, "MethodOptionID": 0, "PreapprovedFrequency": null, "MandateReference": null } }