API Command: mandate_revoke
The Cancel Recurring Payments API allows the merchants to cancel their Cards registration from their website. After the registration is canceled for a customer, the merchant cannot restore it, and the customer must register a fresh mandate with the merchant.
Method: POST
Environment
Environment | URL |
---|---|
Test Environment | https://test.payu.in/merchant/postservice.php?form=2 |
Production Environment | https://info.payu.in/merchant/postservice.php?form=2 |
Request parameters
Variable | Description | Example |
---|---|---|
key mandatory |
varchar This parameter is the unique Merchant Key provided by PayU for your merchant account. |
Your Test Key |
command mandatory |
varchar For initiating a recurring transaction, "mandate_revoke" must be passed in this parameter. |
mandate_revoke |
var1 mandatory |
JSON This parameter is JSON parameter and description of the fields are described in the var1 JSON Fields Description table of this section. |
{ |
hash mandatory |
512 SHA hash strings generated by encrypting request parameters so that any tampering can be avoided.hash = sha512(key|command|var1|SALT) |
var1 JSON Fields Description
Field | Description |
---|---|
authPayuId mandatory |
This parameter must contain the mihpayid returned in the payment response of the Registration transaction when the transaction is successfully completed. As explained earlier in the Register a Recurring Payment section, the merchant needs to map this value against the customer profile at their end so that correct authPayuid will be passed in the request. |
requestId mandatory |
This parameter must contain the unique request value generated at merchant's end to distinguish independent request call. |
Sample request
curl --location 'https://info.payu.in/merchant/postservice.php?form=2' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'key=PRiQvJ' \
--data-urlencode 'command=upi_mandate_revoke' \
--data-urlencode 'var1={"authpayuid":"19504273314","requestId":"test000212"}' \
--data-urlencode 'hash='
Response parameters
Parameter Name | Description |
---|---|
action | Always returned as "MANDATE_REVOKE" to highlight the type of action. |
status | Status defines acknowledgment from PayU. Possible values are: 1- This value indicates that Cards mandate is successfully canceled 0 – This value indicates that Cards mandate failed to get canceled |
Message | Description of the Mandate cancellation process. |
Sample response
- Sample response for successful cancellation of Cards mandate:
{"status":1,"message":"Mandate Revoked Successfully","action":"MANDATE_REVOKE"}
- Sample Response for failed cancellation
{"status":0,"message":"Mandate not in appropriate state to perform action","action":"MANDATE_REVOKE"}