Cancel Payment Request

<html-block html=”

Request Headers

“>

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(“/v3/charge/{merchantId}/{transactionId}/cancel” +
salt key) + ### + salt index

<html-block html=”

Path Parameters

“>

Parameter NameTypeDescriptionMandatory
merchantIdSTRINGUnique Merchant ID assigned to the merchant by PhonePeYes
transactionIdSTRINGUnique Transaction ID generated by the merchant to track this request to PhonePeYes

<html-block html=”

Response Parameters

“>

Parameter NameTypeDescription
successBOOLEANSuccess status of the request
codeENUMSee below section for list of codes
messageSTRINGShort message about status
dataOBJECTEmpty object

<html-block html=”

Response Codes

“>

The code in the above API response could be.

  • SUCCESS
  • INTERNAL_SERVER_ERROR : There can be internal server error. Merchant should retry the cancel API request.
  • INVALID_TRANSACTION_ID
  • PAYMENT_ALREADY_COMPLETED : Payment has been succesful hence can’t cancel the request. For this case merchant should trigger successful transaction, generating the bill.
{“method”:”post”,”url”:”/v3/charge/{merchantId}/{transactionId}/cancel”,”auth”:”required”,”apiSetting”:”5ecf9143b5bd210023b3b738″,”examples”:{“codes”:[]},”results”:{“codes”:[{“status”:200,”language”:”json”,”code”:”{\n \”success\”: true,\n \”code\”: \”SUCCESS\”,\n \”message\”:\”Your request has been successfully completed.\”,\n \”data\”:{}\n}”,”name”:”Success Response”}]},”params”:[{“name”:”merchantId”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”Unique Merchant ID assigned to the merchant by PhonePe”,”required”:false,”in”:”path”,”ref”:””,”_id”:”5a1f8c74986fec001e5a8759″},{“name”:”transactionId”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”Unique Transaction ID generated by the merchant to track this request to PhonePe”,”required”:false,”in”:”path”,”ref”:””,”_id”:”5a1f8c74986fec001e5a8758″},{“name”:”Content-Type”,”type”:”string”,”enumValues”:””,”default”:”application/json”,”desc”:””,”required”:true,”in”:”header”,”ref”:””,”_id”:”5a1f8c74986fec001e5a8757″},{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”SHA256(\”/v3/charge/{merchantId}/{transactionId}/cancel\” + salt key) + ### + salt index”,”required”:true,”in”:”header”,”ref”:””,”_id”:”5a1f8c74986fec001e5a8756″}]}
https://mercury-uat.phonepe.com