curl --request POST \
--url https://sandbox.hyperswitch.io/v2/refunds \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 654,
"merchant_reference_id": "ref_123",
"payment_id": "{{payment_id}}",
"refund_type": "instant"
}
'{
"id": "<string>",
"payment_id": "<string>",
"amount": 6540,
"currency": "AED",
"status": "succeeded",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"connector": "absa_sanlam",
"profile_id": "<string>",
"merchant_connector_id": "<string>",
"merchant_reference_id": "ref_mbabizu24mvu3mela5njyhpit4",
"reason": "<string>",
"metadata": {},
"error_details": {
"code": "<string>",
"message": "<string>"
},
"connector_refund_reference_id": "<string>",
"raw_connector_response": "<string>",
"feature_metadata": {
"multi_currency_processing": {
"amount": 123,
"currency": "AED"
}
}
}{
"error_type": "invalid_request",
"message": "Missing required param: {param}",
"code": "IR_04"
}Refunds
Refunds - Create
Creates a refund against an already processed payment. In case of some processors, you can even opt to refund only a partial amount multiple times until the original charge amount has been refunded
POST
/
v2
/
refunds
curl --request POST \
--url https://sandbox.hyperswitch.io/v2/refunds \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 654,
"merchant_reference_id": "ref_123",
"payment_id": "{{payment_id}}",
"refund_type": "instant"
}
'{
"id": "<string>",
"payment_id": "<string>",
"amount": 6540,
"currency": "AED",
"status": "succeeded",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"connector": "absa_sanlam",
"profile_id": "<string>",
"merchant_connector_id": "<string>",
"merchant_reference_id": "ref_mbabizu24mvu3mela5njyhpit4",
"reason": "<string>",
"metadata": {},
"error_details": {
"code": "<string>",
"message": "<string>"
},
"connector_refund_reference_id": "<string>",
"raw_connector_response": "<string>",
"feature_metadata": {
"multi_currency_processing": {
"amount": 123,
"currency": "AED"
}
}
}{
"error_type": "invalid_request",
"message": "Missing required param: {param}",
"code": "IR_04"
}Authorizations
Body
application/json
Total amount for which the refund is to be initiated. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., If not provided, this will default to the amount_captured of the payment
Required range:
x >= 100Example:
6540
Response
Refund created
The three-letter ISO 4217 currency code (e.g., "USD", "EUR") for the payment amount. This field is mandatory for creating a payment.
Available options:
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL Available options:
absa_sanlam, authipay, adyenplatform, stripe_billing_test, phonypay, fauxpay, pretendpay, stripe_test, adyen_test, checkout_test, paypal_test, aci, adyen, affirm, airwallex, amazonpay, archipel, authorizedotnet, bambora, bamboraapac, bankofamerica, barclaycard, betterpayment, billwerk, bitpay, bluesnap, blackhawknetwork, calida, boku, braintree, breadpay, cardinal, cashtocode, celero, chargebee, checkbook, checkout, citigate, coinbase, coingate, custombilling, cryptopay, ctp_mastercard, ctp_visa, cybersource, cybersourcedecisionmanager, d24, datatrans, deutschebank, digitalvirgo, dlocal, dwolla, ebanx, ecommpay, envoy, elavon, etisalat, elavon_pg, facilitapay, finix, fiserv, fiservemea, fiservcommercehub, fiuu, flexiti, forte, getnet, gigadat, givepayments, globalpay, globalpayments_heartland, globalpayments_realex, globepay, gocardless, gotyme_sanlam, gpayments, hipay, helcim, hyperpg, hyperswitch_vault, interpayments, inespay, iatapay, ilixium, imerchantsolutions, itaubank, jpmorgan, jpmorgan_orbital, juspay, juspaythreedsserver, klarna, loonio, merchante, mifinity, mollie, moneris, multisafepay, netcetera, nexinets, nexixpay, nmi, nomupay, noon, nordea, novalnet, nuvei, opennode, paybox, paydotcom, payhound, payload, payme, paynearme, payone, paypal, paysafe, paystack, paytm, payconex, payu, peachpayments, payjustnow, payjustnowinstore, phonepe, placetopay, powertranz, prophetpay, rapyd, razorpay, recurly, redsys, revolv3, saferpay, santander, shift4, silverflow, square, stax, stripe, stripebilling, taxjar, threedsecureio, tesouro, tokenex, tokenio, trustly, truelayer, trustpay, trustpayments, tsys, tsys_transit, vgs, volt, wellsfargo, wise, worldline, worldpay, worldpayraft, worldpayvantiv, worldpayxml, worldpaymodular, signifyd, nsure, plaid, riskified, sanlam_payshield, xendit, zen, zift, zsl Was this page helpful?