Refund Status

Refund Status

It is used to retrieve the status of a refund using getRefundStatus() function.

Parameters

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

Example :

import {StandardCheckoutClient, Env} from 'pg-sdk-node'; const clientId = "<clientId>"; const clientSecret = "<clientSecret>"; const clientVersion = 1; //insert your client version here const env = Env.SANDBOX; //change to Env.PRODUCTION when you go live const client = StandardCheckoutClient.getInstance(clientId, clientSecret, clientVersion, env); const refundId = '<REFUND_ID>'; //refundId used to initiate the refund client.getRefundStatus(refundId).then((response) => { const state = response.state })

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
amountNumberAmount 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
timestampNumberTimestamp of the attempted transaction in epoch
stateStringAttempted transaction state. It can be any one of the following states: 1. PENDING
2. COMPLETED
3. FAILED
errorCodeStringError code present only when the transaction state is Failed
detailedErrorCodeStringDetailed Error Code present only when transaction state is Failed
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