Cancel subscription interface stops subscription and further processing of the associated immediately. Merchant needs to be mindful before executing this because once Cancelled, same subscription cannot be resumed.
Environment
Path: {base_url}/api/sub/v1/merchant/subscriptions/subscriptionId
HTTP method: DELETE
Request parameters
Header
| Parameter | Description |
|---|---|
X-PayU-_ |
SHA512 Signature generated by encrypting request parameters in body by Merchant Key, Merchant Salt and Subscription Id. |
merchantId |
Merchant Key received during onboarding. |
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.
Sample request
curl --location --request DELETE 'https://subscription.payu.in/api/sub/v1/merchant/subscriptions/5eecba0b652d402548fcd2da' \
--header 'Authorization: Bearer 810aa8723c4a626bf2c157e50204aebca72d33e9f2bf350e29eade8ae912c703' \
--header 'merchantId: 0BVomn' \
--header 'X-PayU-Subscription-Signature: 36c0c4b22d1c616237d518c939107e3b01ed14c32147f2c79232444392e0656b040782af69cef7e0640a3f7868145695be3903eb2692a8ef5b68e4bf0a1803ff' \
--header 'Content-Type: application/json' \
--header 'Cookie: PHPSESSID=jp38t4gvop7ami1ksncksj398v; USERTXNINFO=68ed4df291d9b7.27710642'Sample response
Status: 204
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 |
