Refund API
Create a refund for an Order.
Refunds can be initiated directly to the amount debited source or other payment modes with payouts. This API supports both refunds and Payout for Juspay orders.
Refunds/Payouts can be initiated only for transactions that are CHARGED. The response of refund/payout initiation is similar to that of order status API Response with the addition of refunds block.
Either txn_id or order_id has to be passed in request.
Consists of two parts.
Username: API Key obtained from Juspay dashboard
Password: Empty string
Example:-
Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
application/x-www-form-urlencoded
Unique identifier for the merchant. This is the Merchant ID provided by Juspay. The value is case sensitive.
Passing this value will help us route efficiently at network level.
Example:- x-merchantid: testaccount
Request ID that uniquely identifies this request. You cannot reuse the value for two different refund requests. This is to avoid processing duplicate refund requests.The length of the unique_request_id should be less than 21 characters
Amount that has to be refunded. Amount has to be less than or equal to the amount of the order that is not yet refunded. If this parameter is not passed, then the order is refunded entirely
Pass txn_id if you want to perform a refund based on txn_id. Not needed if passing order id.
Its optional if txn_id is passed
An identifier for the order for which the refund has to be processed. Not needed if order_id is used.
Its optional if txn_id is passed
Reason for the refund. Default will be “CANCELLATION”
Possible values:
GOODWILL
WAIVER
PRODUCT_OR_SERVICE_NOT_DELIVERED
UNSATISFACTORY_PRODUCT_OR_SERVICE
CANCELLATION
PARTIAL_CANCELLATION
TECHNICAL_ISSUES
OFFER_OR_SUBSCRIPTION_ISSUES
DUPLICATE_PAYMENT
DELAYED_SUCCESS
Its Required for payout case and Optional for back to source cases
Identifier to determine the refund type, taking the value as “PAYOUT”
Its Required for payout case and Optional for back to source cases
Beneficiary details on which payout will be done. Not needed if you are sending beneficiary_id
Beneficiary Details which includes first_name, last_name, account, bank_code, address
Format:
Example:- BeneficiaryDetails = {"account" : String, "first_name" : String, "last_name" : String, "bank_code": String, "address": {"city" : String, "country_code" : String, "postcode" : String, "street_address" : String, "state" : String } }
Type of payout
Example:- Possible value: INTERNATIONAL,LOCAL
Example:- Possible value: IBAN,FAST
type of payout mode
Example:- Possible value: BANK_TRANSFER
Specify your preferred Payout gateway details for this refund.
Specify the Payout gateway to process payouts
Example:- Sample Value: 2C2P, AIRWALLEX
Pass the gateway_reference_id if the payout gateway configured with gateway_reference_id on juspay dashboard.
Example:- Sample Value: Bus, Train
The unique request id that is passed during refund initiation. Do not pass any special characters.
The status of the refund initiated. Initial status will always be PENDING
The flag denotes if the refund was initiated to gateway. The initial status is always false, as refunds are queued at juspay for a max of 15minutes.
The type of refund. Values can be STANDARD, INSTANT,PAYOUT
The name of gateway
The refund id provided by the PG
The source of initiation.
The reference id provided by PG, if not available then its mapped to unique request id.
The error message provided by the PG
The error code provided by the PG
The refund amount passed in the request
The timestamp of refund creation
The currency for the refund processed amount
Transaction ID of the refund processed
Payout processed gateway details
Specifies the payout processed gateway
Specifies the gateway reference id of the payout processed gateway
ERROR
duplicate.call
A refund call was already completed with this unique_request_id for the order.
ERROR
duplicate.call
A refund call was already processing with this amount for the order.
ERROR
invalid.amount.exceeded
Refund amount exceeds the refundable amount.
Bad Request
Mandatory fields are missing
Mandatory fields are missing
ERROR
invalid amount
Amount is invalid
NOT_FOUND
40
66721145_keexeV8cNyb7DrYzs
ERROR
invalid.order.not_successful
Cannot process unsuccessful order
25 refunds per order is the default limit
ERROR
request.exceeded
Refund create exceeded the limit
error
access_denied
Have questions?
- Need help? Contact support
- LLM? Read llms.txt

