API Command: upi_mandate_modify
The upi_mandate_modify API allows you to modify UPI registration from their website for their existing mandates created for their consumers. If you are not willing to use the upi_mandate_modify API, you can revoke the previous registration mandate using the upi_mandate_revoke API and create a new registration mandate for that customer.
Note:
The upi_mandate_modify API must only be used for updating the UPI registration transaction.
HTTP Method: POST
Environment
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 updating a recurring transaction, “upi_mandate_modify” must be passed in this parameter. | upi_mandate_modify |
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", "amount": 1900," "endDate": "2021-11-15", "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) | a6105d0e5c8726fd37713d02ace8f6365 2bfe1337f14e4a3652084ba9787e4ee60 1a503bcc42ba101fb1c378b910d5637e9 806b92fc89322db01806 97ff906b3 |
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. |
amount optional | "The new amount of the mandate which has been modified. |
endDate optional | The new end date of the mandate which has been modified. |
requestId mandatory | This parameter must contain the unique request value generated at merchant’s end to distinguish independent request call. |
Response parameters
Parameter | Description | Example |
---|---|---|
status | Returns any of the following status of the transactions: active –Mandate is in active state revoked – Mandate is cancelled pause – Mandate is paused unpause –Mandate is un-paused | active |
authpayuid | This parameter returns the consent transaction ID. | 700010006213657 |
action | This parameter returns any of the following action of the mandate: MANDATE_UPDATE MANDATEPRE_DEBIT MANDATEREVOKE MANDATE_STATUS | |
dateTime | This parameter returns the start date of the mandate. | "2020-09-16 18:18:21" |
amount | This parameter returns the amount of the mandate created | 159.00 |
endDate | This parameter returns the last date of the mandate. | 2022-10-06 00:00:00 |
mandateN umber | This parameter returns the unique mandate number (UMN) for the registration. | 700010006213657@mybank |
hash | This parameter returns the SHA Hash string generated for the transaction. | f94e3af697dc09879997ae00 40d03b612abe739f70 1b5e1a 3c4d7b5cecaddc7c446e7bb 9fc44a854727e39e63c2059 d1ba5d31defaff305a7627c7 c4b190704 4 |
Sample response
Success scenario
- Update Recurring Registration for UPI - Success Response
{
"status": 1,
"action": "MANDATE_UPDATE",
"message": "Mandate modify request processed successfully"
}
- Update pending
{
"status": 1,
"action": "MANDATE_UPDATE",
"message": "Mandate update pending at PG. Please wait for webhook or use upi_mandate_status service to confirm updated status"
}
It will be an async call to customer for approving the mandate modification in their PSP app by entering their MPIN. After the UPI mandate is modified, you can check the UPI mandate status, or can consume the UPI mandate modification webhooks from PayU end. For checking UPI mandate status, refer to Get Mandate Status API.
Note:
UPI Mandate Modify is only applicable for the UPI Collect registration transactions. It does not works for the mandates created using the UPI Intent mode.
Failure scenarios
- Invalid data
{
"status":0,
"action": " MANDATE_UPDATE ",
"message": "Invalid Data "
}
- authPayuid is missing
{
"status":0,
"action": " MANDATE_UPDATE ",
"message": 'authPayuId is mandatory "
}
- requestId is missing
{
"status":0,
"action": " MANDATE_UPDATE ",
"message": "requestId is mandatory'"
}
- Amount or endDate needs to be updated or no updated values in the transaction
{
"status":0,
"action": " MANDATE_UPDATE ",
"message": "amount or endDate required to update"
}