Check Transaction Status

It is mandatory for the merchant to check the status of a transaction post callback from Accept Payments or Refund workflows.

  • Once customer is redirected back to merchant website, it is recommended to make a transaction status check with PhonePe backend systems to know the actual status of the payment and, then accordingly process the result.
  • The payment status can be Success, Failed or Pending. When Pending, merchants should retry until the status changes to Success or Failed.

<html-block html=”

Request Headers

“>

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(“/v4/transaction/{merchantId}/{transactionId}/status” +
saltKey) + “###” + saltIndex

<html-block html=”

Path Parameters

“>

Parameter NameTypeDescriptionMandatory
merchantIdSTRINGUnique Merchant ID assigned to the merchant by PhonePeYes
transactionIdSTRINGMerchant transactionID for which status is to be fetchedYes

<html-block html=”

Response Parameters

“>

Parameter NameTypeDescription
successBOOLEANA boolean to indicate the success/failure of the request.
codeENUMPlease see the list of Transaction Status Response Codes below. You should base your decision on this parameter.
messageSTRINGShort message about status of transaction
transactionId
STRINGUnique Transaction ID generated by the merchant to track this request to PhonePe
merchantIdSTRINGUnique Merchant ID assigned to the merchant by PhonePe
amountLONGTransaction amount in paise
providerReferenceIdSTRINGPhonePe transaction Id
paymentStateSTRINGPlease ignore this. Use “code” parameter to get latest status of transaction.
payResponseCodeSTRINGPhonePe internal status code. Please note this is a string value and new codes are likely to be added in the future. (Please don’t do the marshalling/unmarshalling into an enum for this at your side). This is an informative value.

<html-block html=”

Transaction Status Response Codes

“>

CodeDescription
TRANSACTION_NOT_FOUNDPayment not initiated inside PhonePe
BAD_REQUESTInvalid request
AUTHORIZATION_FAILEDX-VERIFY header is incorrect
INTERNAL_SERVER_ERRORSomething went wrong. Merchant needs to call Check Transaction Status to verify the transaction status.
PAYMENT_SUCCESSPayment is successful or In case of refund – Refund is successful.
PAYMENT_ERRORPayment failed
PAYMENT_PENDINGPayment is pending. It does not indicate failed payment. Merchant needs to call Check Transaction Status to verify the transaction status.
PAYMENT_DECLINEDPayment declined by user
PAYMENT_CANCELLEDPayment cancelled by the merchant using Cancel API

Cross-check the amount which has been passed in forward payment path(Accept payment API) and in the response of Check Transaction Status API.

{“method”:”get”,”url”:”/v4/transaction/{merchantId}/{transactionId}/status”,”auth”:”required”,”apiSetting”:”5ecf9143b5bd210023b3b738″,”examples”:{“codes”:[]},”results”:{“codes”:[{“status”:200,”language”:”json”,”code”:”{\n \”success\”: true,/* Rely on success flag and\n code parameter as PAYMENT_SUCCESS for \n successful transaction */\n \n \”code\”: \”PAYMENT_SUCCESS\”,\n \”message\”: \”Your payment is successful.\”,\n \”data\”: {\n \”transactionId\”: \”TX123456789\”,\n \”merchantId\”: \”U123456789\”,\n \”amount\”: 100,\n \”providerReferenceId\”: \”PPXXXXXX\”,\n \”payResponseCode\”: \”SUCCESS\”,\n \”paymentState\”: \”COMPLETED\”/* This is an\n informative field. For making decisions\n rely on “code” field */\n }\n}”,”name”:”Success Response”},{“status”:200,”language”:”json”,”code”:”{\n \”success\”: false,\n \”code\”: \”TRANSACTION_NOT_FOUND\”,\n \”message\”: \”No Transaction found with the given details.\”,\n \”data\”: {}\n}”,”name”:”Error Response”}]},”params”:[{“name”:”merchantId”,”type”:”string”,”enumValues”:””,”default”:”M2306160483220675579140″,”desc”:”Unique Merchant ID assigned to the merchant by PhonePe”,”required”:false,”in”:”path”,”ref”:””,”_id”:”5d63bf28c2c0cc005f6b6f69″},{“name”:”transactionId”,”type”:”string”,”enumValues”:””,”default”:”1511522079″,”desc”:”Merchant transaction id for which status is to be fetched”,”required”:false,”in”:”path”,”ref”:””,”_id”:”5d63bf28c2c0cc005f6b6f68″},{“name”:”Content-Type”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”application/json”,”required”:true,”in”:”header”,”ref”:””,”_id”:”5d63bf28c2c0cc005f6b6f67″},{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:”6ab24e24ae92646c82e0450f029478117d8a1a0a00390e266ea1178a0c68e419###1″,”desc”:”SHA256(\”/v3/transaction/{merchantId}/{transactionId}/status\” + saltKey) + \”###\” + saltIndex”,”required”:true,”in”:”header”,”ref”:””,”_id”:”5d63bf28c2c0cc005f6b6f66″}]}
https://api-preprod.phonepe.com/apis/pg-sandbox