Skip to main content
knowledgecenter.2checkout.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 = "11370513";
$items = new stdClass();
$items->Quantity = 1;
$items->Amount = 25.39;

$amount = '100';
$comment = "This is a comment";
$reason = "Duplicate purchase";

$jsonRpcRequest          = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method  = 'issueRefund';
$jsonRpcRequest->params  = array($sessionID, $orderReference, $amount, $items, $comment, $reason);
$jsonRpcRequest->id      = $i++;

$partialRefund = callRPC($jsonRpcRequest, $host);
var_dump ($partialRefund);

Response

Response Type/Description
Boolean

TRUE is the refund was processed successfully

FALSE otherwise

  • Was this article helpful?