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 |
Related articles
Rate this article: