Transaction ID based and Instant refund
Instant Refund:
This API supports refunds for only JUSPAY orders, which are paid through cards and card details stored.
The API retrieves card details from the card vault from the order_id/txn_id passed in the refund request and attempt a payout on that card.
NON_JUSPAY orders and payment methods as NB and UPI refunds are not supported through this API, currently.
To enable Instant refunds, you will need to configure the MORPHEUS gateway from the Juspay dashboard. Please get in touch with biz@juspay.in
to get the credentials.
Please set Instant refund to TRUE from the Settings section of the Juspay dashboard.
Consists of two parts.
Username: API Key obtained from Juspay dashboard
Password: Empty string
Example:-
Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
application/x-www-form-urlencoded
Merchant ID provided by Juspay
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.
This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.
Example:- customer_1122
The amount to be refunded as requested by the merchant
Unique id for the refund transaction. This cannot be re-used to avoid duplication refunds
An identifier for the order for which the refund has to be processed
Pass txn_id if you want to perform a refund based on txn_id. Applicable only for Juspay orders.
Required for Payouts product. Identifier to determine the refund type, taking the values ‘INSTANT’ or ‘INSTANT_WITH_FALLBACK’ or ‘GATEWAY’.
STANDARD - This is the default. For refunds to be initiated to Gateways from where payment was done. This is a normal refund process.
INSTANT - If passed, Juspay will attempt Instant refund when payment source (e.g. stored card) is available. If the payment source is not available, the API will return 400 bad request.
INSTANT_WITH_FALLBACK - This will work only for orders created via juspay system i.e. JUSPAY order_type. In case if an instant refund is not eligible, this option will initiate refunds with gateway where payment was done.
Values can be JUSPAY or NON_JUSPAY. Pass JUSPAY if the transaction was made through Juspay Express Checkout, otherwise NON_JUSPAY. The default is JUSPAY.
Beneficiary details on which payout will be done
Required for INSTANT REFUND WITH ACCOUNT NUMBER
Required for INSTANT REFUND WITH ACCOUNT NUMBER
Required for INSTANT REFUND WITH VPA
The unique ID provided by the merchant to identify refund object.
Transaction ID against which the refund was initiated.
Status of the refund. Can be one of PENDING, SUCCESS, FAILURE, MANUAL_REVIEW.
SUCCESS: This means that the refund has been successfully executed.
PENDING: This would mean that the refund has been queued with JusPay or with the downstream system.
FAILURE: We were unable to process the refund successfully. You have to try again with new unique_request_id.
MANUAL_REVIEW: This would mean that the refund request was sent an ambiguous response from the payment gateway and the merchant has to manually reconcile it with the payment gateway to get the proper response.
This will be set to true once the refund is initiated to a gateway from Juspay
The Response code from the gateway when refund
‘INSTANT’ or ‘STANDARD’
Underlying gateway used to initiate the refund transaction, this will be populated in instant refund case
The Reference number provided by Acquirers bank to track the refund at Issuers bank. May not be available for all the gateways
Reference number provided by the underlying gateway
Order ID for which the refund was initiated.
Username of the initiating user. This will be “API” in case of initiated via API
Underlying gateway used to initiate the refund transaction
The response message from the gateway when refund
Refund transaction id provided by the underlying gateway
Date time (ISO representation) when a refund was created
Authorization Identification Code issued by the Issuer bank for a successful refund transaction. May not be available for all the gateways
Amount refunded (or to be refunded)
The unique ID provided by the merchant to identify refund object.
Status of the refund. Can be one of PENDING, SUCCESS, FAILURE, MANUAL_REVIEW.
SUCCESS: This means that the refund has been successfully executed.
PENDING: This would mean that the refund has been queued with JusPay or with the downstream system.
FAILURE: We were unable to process the refund successfully. You have to try again with new unique_request_id.
MANUAL_REVIEW: This would mean that the refund request was sent an ambiguous response from the payment gateway and the merchant has to manually reconcile it with the payment gateway to get the proper response.
This will be set to true once the refund is initiated to a gateway from Juspay
Transaction ID against which the refund was initiated.
‘INSTANT’ or ‘STANDARD’
Underlying gateway used to initiate the refund transaction, this will be populated in instant refund case
Reference number provided by the underlying gateway
The Response code from the gateway when refund
The Reference number provided by Acquirers bank to track the refund at Issuers bank. May not be available for all the gateways
Order ID for which the refund was initiated.
Username of the initiating user. This will be “API” in case of initiated via API
The response message from the gateway when refund
Underlying gateway used to initiate the refund transaction
Refund transaction id provided by the underlying gateway
Date time (ISO representation) when a refund was created
Amount refunded (or to be refunded)
Authorization Identification Code issued by the Issuer bank for a successful refund transaction. May not be available for all the gateways
invalid_request_error
invalid
instant refund flag is not enabled

