It is mandatory for the merchant to check the status of a transaction post callback from Show Payments Page 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
orPending
. WhenPending
, merchants should retry until the status changes toSuccess
orFailed
.
Request Headers
Header Name | Header Value |
---|---|
Content-Type | application/json |
X-VERIFY | SHA256(“/v3/transaction/{merchantId}/{transactionId}/status” + saltKey) + “###” + saltIndex |
X-CLIENT-ID | This will vary corresponding to the merchants. The default value will be merchant ID. |
Path Parameters
Parameter Name | Type | Description | Mandatory |
---|---|---|---|
merchantId | STRING | Unique Merchant ID assigned to the merchant by PhonePe | Yes |
transactionId | STRING | Merchant transactionID for which status is to be fetched | Yes |
Response Parameters
Parameter Name | Type | Description |
---|---|---|
success | BOOLEAN | A boolean to indicate the success/failure of the request. |
code | ENUM | Please see the list of Transaction Status Response Codes below. You should base your decision on this parameter. |
transactionId | STRING | Unique Transaction ID generated by the merchant to track this request to PhonePe |
merchantId | STRING | Unique Merchant ID assigned to the merchant by PhonePe |
amount | LONG | Transaction amount in paise |
providerReferenceId | STRING | PhonePe transaction Id |
Transaction Status Response Codes
Code | Description |
---|---|
TRANSACTION_NOT_FOUND | Payment not initiated inside PhonePe |
INVALID_TRANSACTION_ID | Transaction ID sent is wrong. Need to send transaction ID as sent in the initiate API |
BAD_REQUEST | Invalid request |
AUTHORIZATION_FAILED | X-VERIFY header is incorrect |
INTERNAL_SERVER_ERROR | Something went wrong. Merchant needs to call Check Transaction Status to verify the transaction status. |
PAYMENT_SUCCESS | Payment is successful or In case of refund – Refund is successful. |
PAYMENT_ERROR | Payment failed |
PAYMENT_PENDING | Payment is pending. It does not indicate failed payment. Merchant needs to call Check Transaction Status to verify the transaction status. |
PAYMENT_DECLINED | Payment declined by user |
PAYMENT_CANCELLED | Payment cancelled by the merchant using Cancel API |
API_RATE_LIMIT_REACHED | If the API call limit is breached then HTTP status code 429 would be sent |
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”:”/v3/transaction/{merchantId}/{transactionId}/status”,”auth”:”required”,”apiSetting”:”5da600be463ecf036287d7f3″,”examples”:{“codes”:[]},”results”:{“codes”:[{“status”:200,”language”:”json”,”code”:”{\n \”success\”: true,\n \”code\”: \”PAYMENT_SUCCESS\”,\n \”data\”: {\n \”transactionId\”: \”177f1c2f-ccf5-4c21-88bb-e3087c6e22c3sandip\”,\n \”merchantId\”: \”XXXXXXX\”,\n \”amount\”: 9300,\n \”providerReferenceId\”: \”T2006161957466544984324\”,\n \”paymentState\”: \”COMPLETED\”,\n \”payResponseCode\”: \”SUCCESS\”\n }\n}\n”,”name”:””},{“status”:400,”language”:”json”,”code”:”{}”,”name”:””}]},”params”:[{“name”:”merchantId”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”Unique Merchant ID assigned to the merchant by PhonePe”,”required”:false,”in”:”path”,”ref”:””,”_id”:”5da63a228f8d7e002439a0e0″},{“name”:”transactionId”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”Merchant transaction id for which status is to be fetched”,”required”:false,”in”:”path”,”ref”:””,”_id”:”5da63a228f8d7e002439a0df”},{“name”:”X-CLIENT-ID”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”This will vary corresponding to the merchants. The default value will be merchant ID”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5da63a6dd53c94002767e6d7″},{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”SHA256(\”/v3/transaction///status\” + saltKey) + \”###\” + saltIndex”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5da63a6dd53c94002767e6d6″}]}
https://apps-uat.phonepe.com