Cancel subscription interface stops subscription and further processing of the associted immediately. Merchant needs to be mindful before executing this because once Cancelled, same subscription cannot be resumed.
HTTP method: DELETE
Path: {base_url}/api/sub/v1/merchant/subscriptions/{subscriptionId}
Request parameters
Header
Parameter | Description |
---|---|
X-PayU-_ _Subscription- Signature mandatory | SHA512 Signature generated by encrypting request parameters in body by Merchant Key, Merchant Salt and Subscription Id. |
merchantId mandatory | Merchant Key received during onboarding. Example: YQeVda |
Generating X-PayU-Subscription-Signature
Signature = SHA512("merchantId:" + merchantId + "|subscriptionId:" + subscriptionId + "|" + merchantSalt)
Example –
Signature = SHA512(merchantId:YQeVda|subscriptionId:5acb64a8070c9406b0928207|1v9b 1)
Where “YQeVda” is merchant key and “1v9b1” is merchant salt.
HTTP response codes
If subscription is cancelled successfully, then the HTTP method code 204 is returned to merchant as a part of API call.
HTTP Status Code | Description |
204 | Subscription deleted successfully |
403 | Forbidden request |
400 | Request is malformed |
500 | Interval Server Error |