Order Status
The Order Status allows you to check the current status of a payment order by using the getOrderStatus() function.
Request
| Parameter Name | Data Type | Mandatory (Yes/No) | Description |
merchantOrderId | String | Yes | The order ID for which the status needs to be fetched |
details | String | No | • true → Returns all payment attempt details under the paymentDetails list. • false → Returns only the latest payment attempt details |
Sample Request
import com.phonepe.sdk.pg.Env;
import com.phonepe.sdk.pg.payments.v2.CustomCheckoutClient;
import com.phonepe.sdk.pg.common.models.response.OrderStatusResponse;
String clientId = "<clientId>";
String clientSecret = "<clientSecret>";
Integer clientVersion = clientVersion; //insert your client version here
Env env = Env.SANDBOX; //change to Env.PRODUCTION when you go live
CustomCheckoutClient customCheckoutClient = CustomCheckoutClient.getInstance(clientId, clientSecret,
clientVersion, env);
String merchantOrderId = "<merchantOrderId>";
OrderStatusResponse orderStatusResponse = customCheckoutClient.getOrderStatus(merchantOrderId);
String state = orderStatusResponse.getState();Response
The function returns a OrderStatusResponse object with the following properties:
| Property | Data Type | Description |
orderId | String | Order ID generated by PhonePe PG. |
state | String | Current state of the order: Expected values: • PENDING • FAILED • COMPLETED |
expireAt | Number | Expiry time in epoch. |
amount | Long | Order amount in paisa. |
metaInfo | Object | A MetaInfo object containing additional metadata about the order. |
errorCode | String | Error code (only present when the transaction state is FAILED). |
detailedErrorCode | String | Detailed error code (only present when the transaction state is FAILED). |
paymentDetails | List<PaymentDetail> | Contain list of details of each payment attempt made corresponding to this order. |
The paymentDetails property contains a list of payment details for each payment attempt made against an order. The details of each payment are explained in the table below.
| Property | Data Type | Description |
transactionId | String | The transaction ID generated by PhonePe PG. |
paymentMode | String | The payment method used • UPI_INTENT • UPI_COLLECT • UPI_QR • CARD • TOKEN • NET_BANKING |
| timestamp | Long | Timestamp of the attempted transaction in epoch. |
state | String | Attempted transaction state. It can be any one of the following states: • PENDING • COMPLETED • FAILED |
errorCode | String | Error code (only if the transaction failed) |
detailedErrorCode | String | A more detailed error code (only if the transaction failed) |
splitInstruments | list<InstrumentCombo> | Contains split instrument details of all the transactions made. |
splitInstruments provides a list of InstrumentCombo objects. Details of each InstrumentCombo object are explained in the table below.
| Property | Data Type | Type |
| PaymentInstrumentV2 | Instrument used for the payment. |
| PaymentRail | Rail used for the payment. |
| Integer | Amount transferred using the above instrument and rail. |