The Refund API can be used to refund the money for a completed charge, should your customer request for one or you see any other need to do so. For example, a wrong purchase was made, or the customer changed their mind.
There are two types of refunds:
Xendit does not charge any additional fees for you to perform a refund. Thus, when you refund a charge:
Refunds can be issued via API. Request for refunds are:
curl https://api.xendit.co/credit_card_charges/:credit_card_charge_id/refunds -X POST \ -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \ -H X-IDEMPOTENCY-KEY: unique-id-12345 \ -d amount=17000 \ -d external_id=unique-external-id
<?php require("vendor/autoload.php"); $options['secret_api_key'] = "xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg=="; $xenditPHPClient = new XenditClientXenditPHPClient($options); $credit_card_charge_id = "5877255293ff67900c6aa64e"; $amount = 15000; $external_id = "unique-external-id"; $response = $xenditPHPClient->issueCreditCardRefund($credit_card_charge_id, $amount, $external_id); print_r($response); ?>
To look at the full Refund API references, please refer to our API reference .