Check Order Status with .NET SDK


The Order Status API allows you to check the current status of a payment order by using the getOrderStatus() function.

Parameter NameData TypeMandatory
(Yes/No)
Description
merchantOrderIdStringYesThe order ID for which the status needs to be fetched
detailsBooleanNo• true → Returns all payment attempt details under the paymentDetails list.
• false → Returns only the latest payment attempt details

Sample Request
var response = await checkoutClient.GetOrderStatus(orderId, details: true);
logger.LogInformation("Order Status Response:\n{Response}", JsonSerializer.Serialize(response, new JsonSerializerOptions { WriteIndented = true }));

The function returns a OrderStatusResponse object with the following properties:

PropertyData TypeDescription
orderIdStringOrder ID generated by PhonePe PG.
stateStringCurrent state of the order: Expected values:
PENDING
FAILED
COMPLETED
expireAtLongExpiry time in epoch.
amountLongOrder amount in paisa.
paymentDetailsList<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.

splitInstruments provides a list of InstrumentCombo objects. Details of each InstrumentCombo object are explained in the table below.

PropertyData TypeType
instrumentPaymentInstrumentV2Instrument used for the payment.
railsPaymentRailRail used for the payment.
amountNumberAmount transferred using the above instrument and rail.

You’ve understood how to retrieve the status of an order using the getOrderStatus() function. Now, let’s move on to learn how to process refunds, which allows you to return funds to the customer for eligible transactions.

Is this article helpful?