Partial refund
Last updated: 15-Oct-2019
Use the issueRefund method to issue a partial refund for an order processed by 2Checkout.
The payment for the refundable order needs to be collected.
You cannot issue a refund for an amount higher than the total order amount.
Request
require ('PATH_TO_AUTH'); // authentication call
$orderReference = "11554831";
$amount = 48.36;
$item = new stdClass();
$item->LineItemReference = "20c7aaa07650e517b8df55db47d053b70f93764e";
$item->Quantity = 1;
$item->Amount = 10.00;
$items = array($item);
$comment = "We hope you are satisfied with the refund process.";
$reason = "Duplicate purchase";
try {
$refundedOrder = $client->issueRefund($sessionID, $orderReference, $amount, $items, $comment, $reason);
}
catch (SoapFault $e) {
echo "refundedOrder: " . $e->getMessage();
exit;
}
var_dump("refundedOrder", $refundedOrder);
Response | Type/Description |
---|---|
Boolean |
TRUE is the refund was processed successfully FALSE otherwise |
Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.
We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.