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' \
--header 'Cookie: PHPSESSID=jp38t4gvop7ami1ksncksj398v; USERTXNINFO=68ed4df291d9b7.27710642' \
--form 'form="2"' \
--form 'key="BmTY3G"' \
--form 'command="upi_mandate_revoke"' \
--form 'var1="{\"authpayuid\":\"19504273314\",\"requestId\":\"test000212\"}"' \
--form 'hash="358fae564df0f392b959af59ec1445ca36d7a6749fc9dc70c4e5722eeb3a0ef8d11f02c124e319ce92cbb06e5611323f60d6020bae953953a2028408656fa573"' \
--form 'salt="{{salt}}"'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"
}