Check Order Status
This API lets you check the real-time status of a payment using the merchant order ID. It is used when the Webhook response is not received. This helps you confirm whether the payment was successful, failed, or still in pending.
Environment
| Environment | HTTP Method | API |
| Sandbox | GET | https://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/order/{merchantOrderId}/status |
| Production | GET | https://api.phonepe.com/apis/pg/payments/v2/order/{merchantOrderId}/status |
Request
Request Headers
| Header Name | Header Value |
| Content-Type | application/json |
| Authorization | O-Bearer <merchant-auth-token> |
Request Parameters
| Parameter Name | Description |
details | • true → return all attempt details under paymentDetails list • false → return only latest attempt details under paymentDetails list |
errorContext | • true → To receive the errorContext block with error details if the state is FAILED • false → If the errorContext block is not required |
📘 Query Parameters for Order Status Endpoint
- The following endpoint is used for both UAT and Production:
/payments/v2/order/{merchantOrderId}/status?details=false&errorContext=true - The query parameters
detailsanderrorContextare optional.
By default, both are set tofalse.
Response
Case 1: Order is completed
{
"orderId": "OMOxx",
"state": "COMPLETED",
"amount": 10000,
"expireAt": 1291391291,
"errorCode": "AUTHORIZATION_ERROR",
"detailedErrorCode": "ZM",
"paymentDetails": [
{
"paymentMode": "UPI_INTENT",
"transactionId": "OM12334",
"timestamp": 12121212,
"amount": 10000,
"state": "COMPLETED",
"rail": {
"type": "UPI",
"upiTransactionId": "upi12313",
"vpa": "abcd@ybl"
},
"instrument": {
"type": "ACCOUNT",
"accountType": "SAVINGS",
"accountNumber": "XXXXX1212"
}
}
]
}Case 2: No payment attempt is made for order
{
"orderId": "OMOxx",
"state": "CREATED",
"amount": 10000,
"expireAt": 1291391291
}Case 3: Order is Failed
{
"orderId": "OMO2407121214395503786511",
"state": "FAILED",
"amount": 200,
"expireAt": 1720767279548,
"errorCode": "INVALID_MPIN", // Only present if the state is FAILED
"detailedErrorCode": "ZM", // Only present if the state is FAILED
"metaInfo": {
"udf1": "",
"udf2": "",
"udf3": "",
"udf4": "",
"udf5": ""
},
"paymentDetails": [
{
"transactionId": "OM2407121214579231302711",
"paymentMode": "UPI_COLLECT",
"timestamp": 1720766697944,
"amount": 200,
"payableAmount": 200,
"feeAmount": 0,
"state": "FAILED",
"errorCode": "INVALID_MPIN", // Only present if the state is FAILED
"detailedErrorCode": "ZM" // Only present if the state is FAILED
}
],
"errorContext": { // Only present if the state is FAILED
"errorCode" : "INVALID_MPIN",
"detailedErrorCode" : "ZM",
"source" : "CUSTOMER",
"stage" : "AUTHENTICATION",
"description" : "Wrong MPIN was entered"
}
}Response Parameters
| Field Name | Data Type | Description |
orderId | String | Payment Gateway generated internal order ID |
state | String | State of order; Expected Values: • PENDING • FAILED • COMPLETED |
amount | String | Order amount in paisa |
expireAt | Long | Order expiry time in epoch |
metaInfo | Object | Meta information passed at the time of order creation |
paymentDetails | List | Contains a list of details of each payment attempt made corresponding to this order |
paymentDetails.paymentMode | String | Mode of payment; Expected Values: • UPI_INTENT • UPI_COLLECT • UPI_QR, CARD • TOKEN • NET_BANKING |
paymentDetails.timestamp | Long | Transaction attempt timestamp in epoch |
paymentDetails.amount | Long | Amount in paisa, corresponding to payment attempt |
paymentDetails.transactionId | String | Internal transaction ID for given payment attempt |
paymentDetails.state | String | Transaction attempt state; Expected Values: • PENDING • COMPLETED • FAILED |
paymentDetails.errorCode | String | Error code (Only present when the transaction state is failed) |
paymentDetails.detailedErrorCode | String | Detailed Error Code (Only present when the transaction state is failed) |
paymentDetails.rail | String | Contains processing rail details under which payment attempt is made |
| String | Type of rail. Expected values: • UPI • PG |
paymentDetails[*].instrument | Object | Contains instrument details |
paymentDetails.instrument.type | String | Type of payment instrument; Expected values: • ACCOUNT • CREDIT_CARD • DEBIT_CARD • NET_BANKING] |
Try it yourself!
headers
url params
What’s Next?
After checking the status of an order, you may need to handle post-payment actions like issuing a refund, especially for failed, cancelled, or customer-returned transactions.
Head over to the next section to learn how to process refunds.