Cancel the Recurring Payment for Net Banking

API Command: mandate_revoke

The Cancel Recurring Payments API allows the merchants to cancel their Cards or Net Banking 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

Request parameters

VariableDescriptionExample
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
JSONThis 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(keycommand

var1 JSON fields description

var1 parameter (JSON format) fields description:

FieldDescription
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 Payment Consent Transaction using PayU Hosted Checkout 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

ParameterDescription
actionAlways returned as “MANDATE_REVOKE” to highlight the type of action.
statusCodeStatus defines acknowledgment from PayU. Possible values are:
1- This value indicates that NetBanking mandate is successfully canceled
0 – This value indicates that NetBanking mandate failed to get canceled
MessageDescription of the Mandate cancellation process.
authpayuidThe auth PayU ID is returned with this parameter.

Sample response

Immediate response

  • Sample response for successful cancellation of NetBanking mandate immediately:

📘

Note:

For NetBanking (Enach), the cancellation process is offline. After cancellation is initiated, an immediate response of acknowledgment will be similar to the following response. A file is uploaded on the bank server and within T+1 or T+2 days, the final status of cancellation is received and the merchant is updated via a webhook. For more information, refer to Webhook Response in this subsection.

  • Sample successful transaction
{
	"action": "MANDATE_REVOKE",
	"statusCode": 1,
	"Message": "Request Initiated"
	"authpayuid':"403993715521889530"
}
  • Sample response for failed request
{
	"status": 0,
	"action": "MANDATE_REVOKE",
	"message": "Mandate is not active”
}

Webhook response

After cancellation is initiated for the Net Banking mandate, a file is uploaded on the bank server, and within T+1 or T+2 days, the final status of cancellation is received and the merchant is updated through a webhook. You need to share a new webhook URL with your PayU Key Account Manager (KAM) for providing the final status of cancellation.

Response parameters

📘

Note:

For mandates that were declined by the destination bank during registration, PayU will send a cancellation webhook response on the same URL.

ParameterDescription
statusCodeStatus defines acknowledgment from PayU. Possible values are:
1- This value indicates that NetBanking mandate is successfully canceled
0 – This value indicates that NetBanking mandate failed to get canceled
notificationTypeAlways returned as “MANDATE_CANCELLATION” to highlight the type of action.
statusThe status of the Recurring Payment cancellation for the eNACH.
authPayuIdThe auth PayU ID is returned with this parameter.

Sample response

  • A successful response is similar to the following is shared on Webhook after the bank sends the final response of cancellation.
{
"statusCode": 1,
"notificationType": "MANDATE_CANCELLATION", 
"status"="CANCEL_SUCCESS",
“authPayuId”:"1234567”,
}
  • A failure response is similar to the following is shared on Webhook after the bank sends the final response of cancellation.
{
"status": 1,
"notificationType": "MANDATE_CANCELLATION", 
"status"="CANCEL_FAILURE",
“authPayuId”:"1234567”,
}