Revoke/Cancel Mandate

Revoke Mandate API

Purpose : This API is used to permanently cancel (revoke) an active mandate. Once a mandate is revoked, no further debits can be executed against it. This is typically used when a customer unsubscribes from merchant's service or explicitly requests to stop future payments.

Environment details:

Request Type : Post

Endpoint : /api/v2/updateTransaction

Request Attributes

These are the Request Attributes of Revoke Mandate API

Fields DataType Mandatory Description
merchantIdentifier String Y Zaakpay’s unique alphanumeric merchant identifier.
mode String Y 1 digit only, numeric, Allowed value is 0.
orderDetail.orderId String Y The Mandate Order ID.
(Note: This is the ID of the Mandate you want to cancel).
orderDetail.amount String Y Pass the amount as 0 or the original mandate amount. (This field is required by the endpoint structure but does not affect the revocation).
orderDetail.productDescription String Y Description of the action (e.g., "Revoke Subscription").
updateDesired String Y Value must be 54. This specific code tells Zaakpay to revoke the mandate.
updateReason String Y Reason for the revocation (e.g., "User Unsubscribed").
checksum String Y To be calculated on above parameters using HMAC SHA 256.

Response Attributes

These are the Response Attributes of the Revoke/ Cancel Mandate API.

Refund Response Attributes
Fields Description
merchantIdentifierUnique alphanumeric identifier for the merchant.
orderDetail.orderIdUnique transaction identifier for the order.
responseCodeResponse code indicating the status of the refund request.
responseDescriptionDescription of what the response code means.

Sample Request

For reference, below are the sample CURL request and Response of API . It takes all required attributes to hit the Revoke/ Cancel Mandate API.

cURL Request

We have created a sample request of Revoke/ Cancel Mandate API with all required attributes and their values, in the order in which they’ll be sent to the API.

The resulting checksum calculated should be posted to the Zaakpay API along with other required attributes.

curl --location 'https://zaakstaging.zaakpay.com/updateTxn' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: JSESSIONID=3253388BCF7BF29453346258402DBC3E; JSESSIONID=DCAA163F07B1059473CF320670097D62; JSESSIONID=FB68D3733DE355D732259D5D18101B9E; JSESSIONID=CE50AF6F6B4FFAC53D311580FF05B3E5.165.243' \
--data-urlencode 'data={"merchantIdentifier":fbXXXXXXXXXXXXXXXX71a4,"orderDetail":{"orderId":ZPLXXXXXXXX2375,"amount":100,"productDescription":"Revoke Mandate"},"mode":"0","updateDesired":"54","updateReason":"Revoke"}' \
--data-urlencode 'checksum=9bda580XXXXXXXXXXXXXXX0dead9fade0d6ccef478b308f2ea'

Sample Request

{
  "merchantIdentifier": "fbXXXXXXXXXXXXXXXX71a4",
  "orderDetail": {
    "orderId": "ZPLXXXXXXXX2375",
    "amount": 100,
    "productDescription": "Revoke Mandate"
  },
  "mode": "0",
  "updateDesired": "54",
  "updateReason": "Revoke"
}

Sample Response

{
    "merchantIdentifier": "fbXXXXXXXXXXXXXXXX71a4",
    "orderDetail": {
        "orderId": "ZPLXXXXXXXX2375"
    },
    "responseCode": "1114",
    "responseDescription": "UPI Mandate revoked successfully",
    "merchantRefId": "TXXXXXXXX3"
}
{
    "merchantIdentifier": "b1XXXXXXXXXXXXXXXXX3",
    "orderDetail": {
        "orderId": "ZaXXXXXXXX24"
    },
    "responseCode": "180",
    "responseDescription": "Checksum received with request is not equal to what we calculated."
}

Checksum Calculation

Create a string(JSON) using the request attributes as given below. Checksum string will create based on the request attributes which are posted to Zaakpay as same as given in the string below.

Now, Calculate the checksum using the HMAC SHA-256 algorithm using the string as data and your generated secret key. The resulting checksum calculated should be posted to the Zaakpay API along with other data.

The Checksum string will be:

Secret Key used: 0678056d96914a8583fb518caf42828a

{"merchantIdentifier":fbXXXXXXXXXXXXXXXX71a4,"orderDetail":{"orderId":ZPLXXXXXXXX2375,"amount":100,"productDescription":"Revoke Mandate"},"mode":"0","updateDesired":"54","updateReason":"Revoke"}
9bda580ef7XXXXXfc55ddc26XXXXXXfade0dXXXX478b308f2ea