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.
Note:
Your customers cannot use Recurring Payments without the Cancel Recurring Payments API being implemented.
HTTP Method: POST
Environment
Test Environment | <https://test.payu.in/merchant/> |
Production Environment | <https://info.payu.in/merchant/> |
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. | { “authPayuId”: “10731087875”, “requestId”: “23123abut12123osd14” } |
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
var1 parameter (JSON format) 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. |
Response parameters
Parameter Name | Description |
---|---|
action | Always returned as “MANDATE_REVOKE” to highlight the type of action. |
statusCode | 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:
{
"action": "MANDATE_REVOKE",
"statusCode": 1,
"Message": "Request Initiated"
}
- Sample Response for failed cancellation
{
"action": "MANDATE_REVOKE",
"statusCode": 0,
"Message": "Mandate is not active”
}