Refund Status

The getRefundStatus() method is used to retrieve the status of the initiated refund by passing the below parameters:

Parameters

Parameter NameData TypeMandatoryDescription
refundIdStringyesRefund Id created by the merchant at the time of initiating the refund

Example :

import com.phonepe.sdk.pg.Env; import com.phonepe.sdk.pg.common.models.response.RefundStatusResponse; import com.phonepe.sdk.pg.subscription.v2.SubscriptionClient; String clientId = "<clientId>"; String clientSecret = "<clientSecret>"; Integer clientVersion = 1; //insert your client version here Env env = Env.SANDBOX; //change to Env.PRODUCTION when you go live SubscriptionClient subscriptionClient = SubscriptionClient.getInstance(clientId, clientSecret, clientVersion, env); String refundId = "<REFUND_ID>"; RefundStatusResponse refundStatusResponse = subscriptionClient.getRefundStatus(refundId); String state = refundStatusResponse.getState();

Returns:

It returns a RefundStatusResponse Object

RefundStatusResponse

PropertyData TypeDescription
merchantIdStringMerchant Id who initiated the refund
merchantRefundIdStringRefund Id created by the merchant at the time of refund initiation
originalMerchantOrderIdStringOrder Id for which refund has initiated. Created by the merchant at the time of order creation
amountLongAmount to refund
stateStringState of the refund
paymentDetailsList<PaymentRefundDetail>Contains the list of details of each transaction attempt made corresponding to this particular order

PaymentRefundDetail :

PropertyData TypeDescription
transactionIdStringTransaction Id generated by the PhonePe
paymentModeStringMode of Payment. It can be anyone of the following modes:
1. UPI_INTENT
2. UPI_COLLECT
3. UPI_QR
4. CARD
5. TOKEN
6. NET_BANKING
timestampLongTimestamp of the attempted transaction in epoch
stateStringAttempted transaction state. It can be any one of the following states:
1. COMPLETED
2. FAILED
3. PENDING
errorCodeStringError code present only when the transaction state is Failed
detailedErrorCodeStringDetailed Error Code present only when transaction state is Failed
railPaymentRailContains processing rail details under which transaction attempt is made.
instrumentPaymentInstrumentV2Contains instrument details of that particular transaction Id
splitInstrumentsList<InstrumentCombo>Type of transaction instrument. It can be any one of the following types:
1. ACCOUNT
2. CREDIT_CARD
3. DEBIT_CARD
4. NET_BANKING