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.

EnvironmentHTTP MethodAPI
SandboxGEThttps://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/order/{merchantOrderId}/status
ProductionGEThttps://api.phonepe.com/apis/pg/payments/v2/order/{merchantOrderId}/status
Request Headers
Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <merchant-auth-token>
Request Parameters
Parameter NameDescription
detailstrue → return all attempt details under paymentDetails list
false → return only latest attempt details under paymentDetails list
errorContexttrue → 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 details and errorContext are optional.
    By default, both are set to false.
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 NameData TypeDescription
orderIdStringPayment Gateway generated internal order ID
stateStringState of order; Expected Values:
PENDING
FAILED
COMPLETED
amountStringOrder amount in paisa
expireAtLongOrder expiry time in epoch
metaInfoObjectMeta information passed at the time of order creation
paymentDetailsListContains a list of details of each payment attempt made corresponding to this order
paymentDetails.paymentModeStringMode of payment; Expected Values:
UPI_INTENT
UPI_COLLECT
UPI_QR, CARD
TOKEN
NET_BANKING
paymentDetails.timestampLongTransaction attempt timestamp in epoch
paymentDetails.amountLongAmount in paisa, corresponding to payment attempt
paymentDetails.transactionIdStringInternal transaction ID for given payment attempt
paymentDetails.stateStringTransaction attempt state; Expected Values:
PENDING
COMPLETED
FAILED
paymentDetails.errorCodeStringError code (Only present when the transaction state is failed)
paymentDetails.detailedErrorCodeStringDetailed Error Code (Only present when the transaction state is failed)
paymentDetails.railStringContains processing rail details under which payment attempt is made
paymentDetails.instrumentStringType of rail. Expected values:
UPI
PG
paymentDetails[*].instrumentObjectContains instrument details
paymentDetails.instrument.typeStringType of payment instrument; Expected values:
ACCOUNT
CREDIT_CARD
DEBIT_CARD
NET_BANKING]
headers
url params

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.

Is this article helpful?