Skip to main content
knowledgecenter.avangate.com

Partial refund

Overview

Use the issueRefund method to issue a partial refund for an order processed by 2Checkout.

Requirements 

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 = "72711777";
$items = array("my_subscription_1", 1, 26.00); // items array is mandatory when issuing partial refunds
$amount = 26.00; // amount parameter is still mandatory, even though is sent as part of the items array
$comment = "This is a comment";
$reason = "Duplicate purchase";


try {
    $refundedOrder = $client->issueRefund($sessionID, $orderReference, $items, $amount, $comment, $reason);
}
catch (SoapFault $e) {
    echo "refundedOrder: " . $e->getMessage();
    exit;
}
var_dump("refundedOrder", $refundedOrder);


Response

Response Type/Description
Boolean

TRUE is the refund was processed successfully

FALSE otherwise