API Command: check_mandate_status
The Check Mandate Status API enables you to understand the current state of the mandate with cards at any time.
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 initiating a recurring transaction, the value of the parameter will be passed as “check_mandate_status” | check_mandate_status |
var1 mandatory | JSON This parameter is in JSON format where:* authPayuId (mandatory): The value of mihpayid is returned in the payment response of the Registration transaction when the transaction is successfully completed. As described earlier, the merchant needs to map this value against the customer profile at his end so that correct authPayuid will be passed in the request. *. requestId (mandatory): Unique request value generated at merchant’s end to distinguish independent request call. | {"authPayuId":"403993715532526870", "requestId":"403993715532526858_check_3"} |
hash mandatory | varchar 512 SHA hash strings generated by encrypting request parameters so that any tampering can be avoided. hash = sha512(key|command|var1|SALT) |
Sample request
curl --location 'https://test.payu.in/merchant/postservice.php?form=2' \
--form 'key="PRiQvJ"' \
--form 'command="upi_mandate_status"' \
--form 'var1="{\"authPayuId\":\"403993715532526870\",\"requestId\":\"403993715532526858_check_3\"}"' \
--form 'hash="8255a64846497ecda42de1c047f1fff01ad5c185b84a2156f7342ba254e4e6cbd49558c898062200b86a3d1a402f16159b9fa5ad5bee843cdc470274caba718a"'
Response parameters
Parameter Name | Description |
---|---|
status | Status defines acknowledgment from PayU. Possible values are: - active -- Mandate is active - cancelled -- Mandate cancelled - discarded, deleted -- Mandate deleted by customer - failed -- Mandate was not registered - expired -- Mandate is expired - paused -- Mandate is paused Note: As the statuses are from a third-party vendor, it may vary if there is an addition of new status at the vendor end. |
action | Always returned as “MANDATE_STATUS” to highlight the type of action. |
authpayuid | Value of registration transaction ID sent in the request echoed back. |
amount | The billing amount echoed back. |
mandateStartDate | Mandate start date echoed back. |
mandateEndDate | Mandate end date echoed back. |
Sample response
Success scenario
{
"status": "active",
"action": "check_mandate_status",
"authpayuid": "20576519965",
"amount": 399,
"mandateStartDate": "2024-08-04",
"mandateEndDate": "2034-08-04"
}
Failure scenarios
- Mandate is cancelled
{
"status": "cancelled",
"action": "check_mandate_status",
"authpayuid": "19122384119",
"amount": 18029,
"mandateStartDate": "2024-02-06",
"mandateEndDate": "2030-02-06"
}
- SI is not valid
{
"status": 422,
"errorCode": "ER0816",
"errorMessage": "SI is not valid",
"action": "check_mandate_status"
}
- Mandate is discarded
{
"status": "discarded",
"action": "check_mandate_status",
"authpayuid": "16696314880",
"amount": 599,
"mandateStartDate": "2024-01-30",
"mandateEndDate": "2029-01-30"
}
- Consent is not mandated
{
"status": 0,
"message": "Consent is Not Mandated",
"action": "check_mandate_status"
}
- Mandate has failed
{
"status": "failed",
"action": "check_mandate_status",
"authpayuid": "15598035386",
"amount": 149,
"mandateStartDate": "2022-08-30",
"mandateEndDate": "2027-08-30"
}
- Deleted mandate
{
"status": "deleted",
"action": "check_mandate_status",
"authpayuid": "21830274499",
"amount": 23888,
"mandateStartDate": "2025-02-07",
"mandateEndDate": "2026-01-07",
"deletedon": "2025-01-26T01:00:33+05:30"
}
- Expired mandate
{
"status": "expired",
"action": "check_mandate_status",
"authpayuid": "20962358568",
"amount": 63000,
"mandateStartDate": "2024-11-07",
"mandateEndDate": "2025-01-07"
}
- Auth PayUID is missing
{
"status": 0,
"message": "authPayuId is mandatory",
"action": "check_mandate_status"
}
- Internal error
{
"status": 422,
"errorCode": "ER1002",
"errorMessage": "INTERNAL_ERROR",
"action": "check_mandate_status"
}
- Mandate is paused
{
"status": "paused",
"action": "check_mandate_status",
"authpayuid": 21652087097,
"amount": "5",
"mandateStartDate": "2024-11-24",
"mandateEndDate": "2025-12-07"
}
If you need any further assistance, feel free to ask!