Refund Order API
Create a refund for an Order. Refunds can be initiated only for transactions that are CHARGED. The response of refund initiation is similar to that of order status API Response with the addition of refund block.
Consists of two parts.
Username: API Key obtained from Juspay dashboard
Password: Empty string
Example:-
Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
Pass the current date in YYYY-MM-DD format
application/x-www-form-urlencoded
The merchant_id/username that you hold at Juspay
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
eulwh5QbZSBvwpt7333f3
merchant_success-JP1636474794-1
eulwh5QbZSBvwpt7333f3
merchant_success-JP1636474794-1
JP1636474794
RAZORPAY
INR
2021-11-09T16:20:52Z
CHARGED
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
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
https://api.juspay.in/merchant/pay/ordeh_57dfd768bb7d4896bc0c3f30bc9ad77
https://api.juspay.in/merchant/pay/ordeh_57dfd768bb7d4896bc0c3f30bc9ad77?mobile=true
https://api.juspay.in/merchant/ipay/ordeh_57dfd768bb7d4896bc0c3f30bc9ad77
merchant_success-JP1636474794-1
156555
SUCCESS
SUCCESS
pay_IJZKtTpkiYWE24
2021-11-09T16:21:11Z
156555
JP1636474794
testmid
merchant_success
ordeh_57dfd768bb7d4896bc0c3f30bc9ad77
testmid
2021-11-09T16:19:55Z
9999999999
testcardenc1
test@gmail.com
INR
2024
12
CREDIT
17a2ec4f27c918ttvbc58c9ae74090e
JP Morgan
411111
32qqi3svf5t5t37fq7ura2rgqqb
VISA
THREE_DS
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

