Cancel Payment Request
post https://mercury-uat.phonepe.com/enterprise-sandbox/v3/charge/{merchantId}/{transactionId}/cancel

Request Headers

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

Path Parameters

Parameter NameDescription
merchantId
String
Mandatory
Unique Merchant ID assigned to the merchant by PhonePe
transactionId
String
Mandatory
Unique Transaction ID generated by the merchant to track this request to PhonePe

Response Parameters

Parameter NameDescription
success
Boolean
Success status of the request
code
Enum
See below section for list of codes
message
String
Short message about status
data
Object
Empty object

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”:”5ce68ac4d3a82d0051af9e17″,”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/enterprise-sandbox

HEADERS
merchantId string
Unique Merchant ID assigned to the merchant by PhonePe
transactionId string
Unique Transaction ID generated by the merchant to track this request to PhonePe
Content-Type string required
X-VERIFY string required
SHA256("/v3/charge/{merchantId}/{transactionId}/cancel" + salt key) + ### + salt index

RESPONSES