Skip to main content

Total refund

Last updated: 19-May-2021
Rate this article:

Overview

Use the issueRefund method to issue a total 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.

We recommend you to create a new order with placeOrder to have one that can be refunded.

The order’s status must be ’COMPLETE’ and it should have a Total price.

The order’s date cannot be older than a year from the current date.

To obtain LineItemReference, use the getOrder method: https://knowledgecenter.2checkout.com/API-Integration/JSON-RPC_API_6.0/Reference/14Retrieve-an-order

Request

require ('PATH_TO_AUTH'); // authentication call

$orderReference = "11714895";

$items = [];

$amount = '50';
$comment = "This is a comment";
$reason = "No reason";

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

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

Response

Response Type/Description
Boolean

TRUE is the refund was processed successfully

FALSE otherwise

 

Rate this article:

Need help?

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.

Not yet a Verifone customer?

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.

Verifone logo