You can refund and void eWallet transactions through API. The difference between the 2 are:
A. Refund:
- T+1 or next day transaction (cutoff time depends for each eWallet channel, can refer in this docs)
- Can be full or partial amount
- Not applicable for OVO one time payment and AstraPay
- If refund full amount Fee and VAT will be fully returned except DANA
B. Void:
- T+0 or same day transaction (cutoff time of 23:50:00)
- Can only be full amount
- Not applicable for AstraPay
- Fee and VAT will be fully returned
Both can be executed when the fund is Completed but not/have Settled yet and for payment made through Invoice/Payment Link and/or Direct API. For full information of the rules and limitations, please refer to this docs.
Steps on how to do Void and Refund via API:
1. Create secret API Key on your dashboard
Reference can be found in this doc.
2. Set your callback URL in Dashboard - Settings - Callbacks in eWallet payment status and make sure upon "test and save" it returns 2XX
3. Create Refund/Void eWallet Charge using endpoint:
POST https://api.xendit.co/ewallets/charges/{id}/refunds
POST https://api.xendit.co/ewallets/charges/{id}/void
4. Input you secret API key in Authorization
5. In Body Request you can leave it blank or add parameter "amount" if you wish to be partial and "reason". However for Void there is no body request/has to be blank.
6. You will get this response afterwards after clicking send:
{
"id": "ewc_c11b3e6e-1c06-4916-8824-4f26ef9dd3a4",
"business_id": "603f1c4172bbe840979fd408",
"reference_id": "testvoidrefund",
"status": "SUCCEEDED",
"currency": "IDR",
"charge_amount": 100,
"capture_amount": 100,
"payer_charged_currency": null,
"payer_charged_amount": null,
"refunded_amount": null,
"checkout_method": "ONE_TIME_PAYMENT",
"channel_code": "ID_SHOPEEPAY",
"channel_properties": {
"success_redirect_url": "https://redirect.me/payment"
},
"actions": {
"desktop_web_checkout_url": null,
"mobile_web_checkout_url": null,
"mobile_deeplink_checkout_url": "https://wsa.wallet.airpay.co.id/universal-link/wallet/pay?deep_and_deferred=1&token=Um80ZWF4Yk9xZmROApRFQetpQ9twSYVdH07s0oOLdEWATvwctJ5ir67u1HSxceLO",
"qr_checkout_string": "00020101021226590016ID.CO.SHOPEE.WWW011893600918000062711802066271180303UBE5204539953033605406100.005802ID5917Xendit Dummy QRIS6015KOTA JAKARTA SE61051216062270523cglt2e1ldv02h0tia07g-qr6304163C"
},
"is_redirect_required": true,
"callback_url": "https://hooks.zapier.com/hooks/catch/9675406/oj8regt/",
"created": "2023-04-04T07:26:48.536353Z",
"updated": "2023-04-04T07:27:59.023738Z",
"void_status": "PENDING",
"voided_at": null,
"capture_now": true,
"customer_id": null,
"customer": null,
"payment_method_id": null,
"failure_code": null,
"basket": null,
"metadata": {
"branch_area": "PLUIT",
"branch_city": "JAKARTA"
},
"shipping_information": null
}
7. You will then receive a callback of the successful refund where you can check on your callback tab.
8. The refunded transaction transaction will appear in Transactions Tab as "refund".
For more information please click this link.