Cancel Auth Request

Cancel the authorization. This would release the amount captured back to the user as a usable wallet balance.

Headers

Field NameMandatoryDescription
Content-TypeYesapplication/json
X-VerifyYesSHA256(base64 encoded payload + '/v3/auth/cancel' + salt key) + '###' + salt index
{  
   "merchantId": "MID12345",
   "transactionId": "TX123456789"
}
{
   "request": "eyAgCiAgICJtZXJjaGFudElkIjogIk1JRDEyMzQ1IiwKICAgInRyYW5zYWN0aW9uSWQiOiAiVFgxMjM0NTY3ODkiCn0K"
}

Request Parameters

Field NameData TypeMandatoryDescription
merchantIdStringYesUnique merchantId assigned to the merchant
transactionIdStringYesThe transaction Id sent by merchant in the authorize request
{
  "code": "SUCCESS",
  "message": "Your request has been successfully completed.",
  "data": {
    "transactionId": "TX123456789",
    "authState": "CANCELLED"
    }
}

Response Parameters

Field NameData TypeDescription
transactionIdStringSame as Request
authStateStringCurrent state of the auth & capture transaction. For details, check the authState flow diagram below.

Response codes for the edge cases where cancel fails

CodeDescription
AUTHORIZATION_ALREADY_CANCELLEDCancel failed as the authorization for the given transaction is already canceled/expired.
AUTHORIZATION_ALREADY_CAPTUREDCancel failed as the authorization for the given transaction is already captured.

Other Response Codes

CodeDescription
SUCCESSYour request has been successfully completed.
BAD_REQUESTInvalid request payload
AUTHORIZATION_FAILEDValue of X-VERIFY is incorrect
INTERNAL_SERVER_ERRORSomething went wrong. Please call status and try again.
TRANSACTION_NOT_FOUNDNo Authorization found with the given details.
USER_BLACKLISTEDCustomer is blacklisted on PhonePe side
USER_DOESNOT_EXISTInvalid user

🚧

If the Cancel Auth Request API fails, then merchants should retry Cancel Auth Request API to release the authorized amount.

Language
Click Try It! to start a request and see the response here!