> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/refund-an-order.md).

# Refund an order

Refund a sale made in 2Checkout via the **issueRefund** API method. Depending on your business needs, you can refund only one sale item, the entire order amount, or a partial amount from the total order.

## Requirements <a href="#requirements" id="requirements"></a>

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 parameters <a href="#parameters" id="parameters"></a>

| Parameter                | Type / Description                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RefNo`                  | <p><strong>Required (string)</strong></p><p>The order reference number of the sale for which the refund is issued. Example: '721924012'.</p>                                                                                                                                                                                                                                                                                                          |
| `Amount`                 | <p><strong>Required (double)</strong></p><p>Refundable amount. Required as a supplementary check for partial refunds. Example: '26.00'.</p>                                                                                                                                                                                                                                                                                                           |
| `Comment`                | <p><strong>Optional (string)</strong></p><p>Comments are displayed to customers in the refund confirmation they receive. Example: 'Let us know if you are satisfied with the refund process'. </p>                                                                                                                                                                                                                                                    |
| `Reason`                 | <p><strong>Required (string)</strong></p><p>In case you have custom refund reasons defined on your account, send one of the reasons. If not, send one of the platform defined reasons. <a href="https://docs.2checkout.com/payments/payments/refunds-and-chargebacks/refunds">Read more about 2Checkout refund reasons</a>. </p><p>Comments displayed on the order are also retrieved via this parameter.</p><p>Example: 'Unwanted auto-renewal'.</p> |
| `Items`                  | <p><strong>Required only for partial refunds (array)</strong></p><p>In case you issue a partial refund, send the array with the information below.</p>                                                                                                                                                                                                                                                                                                |
| `Items.ProductCode`      | <p><strong>Required (string)</strong></p><p>Send the product code belonging to the products to be refunded. The product code is available at product level, in the <strong>Information</strong> tab.</p>                                                                                                                                                                                                                                              |
| `Items.Quantity`         | <p><strong>Required (integer)</strong></p><p>Quantity to be refunded. Send only positive values.</p>                                                                                                                                                                                                                                                                                                                                                  |
| `Items.Amount`           | <p><strong>Required (double)</strong></p><p>Total amount of the refunded line item, not the unit amount.</p>                                                                                                                                                                                                                                                                                                                                          |
| `ReturnExtendedResponse` | <p><strong>Optional (boolean)</strong></p><p>Set to <code>true</code> to receive the full refund object. Default value is <code>false</code>.</p>                                                                                                                                                                                                                                                                                                     |

## Request sample

```php
<?php
 
require ('PATH_TO_AUTH');
 
$refNo = 'YOUR_ORDER_REFERENCE';
$items = array();
 
try {
    // Returns true
    $result = $client->issueRefund($sessionID, $refNo, 23.00, $items, 'requested by vendor', 'Not as described');
 
    // Returns the refund object, including RefundId
    $refund = $client->requestRefund($sessionID, $refNo, 23.00, $items, 'requested by vendor', 'Not as described');
}
catch (SoapFault $e) {
    echo "refund: " . $e->getMessage();
    exit;
}
 
var_dump("refund", $refund);
 
?>

```

## Response sample

```php
<?php

require ('PATH_TO_AUTH');

$refNo = 'YOUR_ORDER_REFERENCE';
$items = array(
    (object) array(
        'LineItemReference' => 'f1d3a6c8e0b2495d7a1c3e5f7b9d0a2c4e6f8a1b',
        'Quantity' => 1,
        'Amount' => 10.00
    )
);

$refund = $client->requestRefund($sessionID, $refNo, 10.00, $items, 'partial refund', 'Not as described');

var_dump($refund);

 object(stdClass)#5 (11) {
   ["RefundId"]=> string(40) "015081d74b9c49d4a5b687061f44bf2c59a41de1"
   ["ExternalOrderReference"]=> string(13) "ORD-2026-0001"
   ["RefNo"]=> string(9) "734881310"
   ["Amount"]=> float(10)
   ["Currency"]=> string(3) "USD"
   ["Status"]=> string(8) "APPROVED"
   ["RequestedBy"]=> string(3) "API"
   ["Reason"]=> string(16) "Not as described"
   ["Comment"]=> string(14) "partial refund"
   ["Items"]=> array(1) {
     [0]=> object(stdClass)#6 (3) {
       ["LineItemReference"]=> string(40) "f1d3a6c8e0b2495d7a1c3e5f7b9d0a2c4e6f8a1b"
       ["Quantity"]=> int(1)
       ["Amount"]=> float(10)
     }
   }
   ["RequestedAt"]=> string(19) "2026-09-30 10:15:00"
 }
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/refund-an-order.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
