> 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/api-reference/reference/refunds.md).

# Refunds

## Issue a partial refund

> Issues a total or partial refund for an approved/paid order. By default the response is the boolean true. Set returnExtendedResponse to true to receive the refund object instead, including its RefundId, which can be passed to GET /refunds/. ExternalOrderReference is response-only: it is read from the order and is not an input field.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/orders/{RefNo}/refund/":{"post":{"tags":["Refunds"],"summary":"Issue a partial refund","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}},{"name":"RefNo","in":"path","description":"Unique, system-generated order identifier.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"description":"Issues a total or partial refund for an approved/paid order. By default the response is the boolean true. Set returnExtendedResponse to true to receive the refund object instead, including its RefundId, which can be passed to GET /refunds/. ExternalOrderReference is response-only: it is read from the order and is not an input field.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body_3"}}}},"responses":{"200":{"description":"OK. true by default, or the refund object when returnExtendedResponse is true.","content":{"application/json":{"schema":{"oneOf":[{"type":"boolean"},{"$ref":"#/components/schemas/RefundExtendedResponse"}]}}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundApiError"}}}}}}}},"components":{"schemas":{"body_3":{"type":"object","properties":{"amount":{"type":"number"},"items":{"type":"array","description":"The line items to refund. Send an empty array for a total refund.","items":{"$ref":"#/components/schemas/RefundRequestItem"}},"comment":{"type":"string"},"reason":{"type":"string","description":"The refund reason label configured for your account. Reason codes are not accepted."},"returnExtendedResponse":{"type":"boolean","default":false,"description":"Optional. When true, the response is the refund object (including RefundId) instead of the boolean true. Any non-boolean value returns ORDER_REFUND_INVALID_RETURN_EXTENDED_RESPONSE and no refund is created."}}},"RefundRequestItem":{"type":"object","required":["LineItemReference"],"properties":{"LineItemReference":{"type":"string","description":"The reference of the order line item to refund."},"Quantity":{"type":"integer","description":"The quantity of the line item to refund."},"Amount":{"type":"number","description":"The amount to refund for the line item."}}},"RefundExtendedResponse":{"type":"object","properties":{"RefundId":{"type":"string","description":"Unique identifier of the refund, 40 hexadecimal characters. The internal database id is never returned."},"ExternalOrderReference":{"type":"string","nullable":true,"description":"The external reference already associated with the order. Response-only, null if the order has none."},"RefNo":{"type":"string"},"Amount":{"type":"number","description":"The granted amount, or the requested amount while the refund is pending."},"Currency":{"type":"string"},"Status":{"type":"string","enum":["PENDING","APPROVED","PROCESSED","REJECTED","CANCELLED"]},"RequestedBy":{"type":"string","description":"For example API, VENDOR or SHOPPER."},"Reason":{"type":"string","description":"The refund reason label, not a code."},"Comment":{"type":"string"},"Items":{"type":"array","description":"Empty for a total refund.","items":{"$ref":"#/components/schemas/RefundItem"}},"RequestedAt":{"type":"string","description":"Format YYYY-MM-DD HH:MM:SS."}}},"RefundItem":{"type":"object","properties":{"LineItemReference":{"type":"string","description":"The reference of the refunded order line item."},"Quantity":{"type":"integer"},"Amount":{"type":"number"}}},"RefundApiError":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## DELETE /orders/{RefNo}/refund/

> Working example: Cancel a refund request

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/orders/{RefNo}/refund/":{"delete":{"tags":["Refunds"],"summary":"Working example: Cancel a refund request","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}},{"name":"RefNo","in":"path","description":"Unique, system-generated order identifier.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelRefundReference200"}}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelRefundReference400"}}}}}}}},"components":{"schemas":{"CancelRefundReference200":{"type":"object","properties":{"RefundId":{"type":"string"}}},"CancelRefundReference400":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Retrieve refunds

> Retrieves refunds. Send RefundId to get a single refund, send RefNo to get the refunds of an order, or send neither to get the refunds of your own account. All parameters are optional and are combined with AND. Lists are paginated and sorted with the most recently requested refund first. A refund of another merchant is never returned; an unknown order and an order of another merchant return the same error. RefNo and RefundId also work for cross-selling (affiliate) orders you can access, but the list of your own refunds does not include them. A RefNo with no refunds returns an empty Data array, not an error.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/refunds/":{"get":{"tags":["Refunds"],"summary":"Retrieve refunds","description":"Retrieves refunds. Send RefundId to get a single refund, send RefNo to get the refunds of an order, or send neither to get the refunds of your own account. All parameters are optional and are combined with AND. Lists are paginated and sorted with the most recently requested refund first. A refund of another merchant is never returned; an unknown order and an order of another merchant return the same error. RefNo and RefundId also work for cross-selling (affiliate) orders you can access, but the list of your own refunds does not include them. A RefNo with no refunds returns an empty Data array, not an error.","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}},{"name":"RefNo","in":"query","description":"Order reference. Digits only, 1 to 10 characters. Surrounding whitespace is ignored.","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"RefundId","in":"query","description":"Refund identifier, 40 hexadecimal characters, case-insensitive. When sent, the refund must also match the other filters (otherwise ORDER_REFUND_NOT_FOUND), and Page and Limit are ignored.","required":false,"style":"form","explode":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{40}$"}},{"name":"Status","in":"query","description":"One or more refund statuses, case-insensitive. Send a comma-separated list (Status=PENDING,APPROVED) or an array (Status[]=PENDING&Status[]=APPROVED). Repeating the plain key (Status=A&Status=B) is not supported.","required":false,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["PENDING","APPROVED","PROCESSED","REJECTED","CANCELLED"]}}},{"name":"RequestedBy","in":"query","description":"Returns only refunds requested by this value (for example API, VENDOR or SHOPPER). Exact match, one value, maximum 100 characters.","required":false,"style":"form","explode":true,"schema":{"type":"string","maxLength":100}},{"name":"Page","in":"query","description":"Page number. Must be 1 or higher.","required":false,"style":"form","explode":true,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"Limit","in":"query","description":"Refunds per page, between 1 and 1000. Between 1 and 250 when neither RefNo nor RefundId is sent.","required":false,"style":"form","explode":true,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}}],"responses":{"200":{"description":"OK. A paginated list, or a single refund object when RefundId is sent.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/RefundList"},{"$ref":"#/components/schemas/RefundExtendedResponse"}]}}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundApiError"}}}}}}}},"components":{"schemas":{"RefundList":{"type":"object","properties":{"Data":{"type":"array","items":{"$ref":"#/components/schemas/RefundExtendedResponse"}},"Pagination":{"$ref":"#/components/schemas/ListPagination"}}},"RefundExtendedResponse":{"type":"object","properties":{"RefundId":{"type":"string","description":"Unique identifier of the refund, 40 hexadecimal characters. The internal database id is never returned."},"ExternalOrderReference":{"type":"string","nullable":true,"description":"The external reference already associated with the order. Response-only, null if the order has none."},"RefNo":{"type":"string"},"Amount":{"type":"number","description":"The granted amount, or the requested amount while the refund is pending."},"Currency":{"type":"string"},"Status":{"type":"string","enum":["PENDING","APPROVED","PROCESSED","REJECTED","CANCELLED"]},"RequestedBy":{"type":"string","description":"For example API, VENDOR or SHOPPER."},"Reason":{"type":"string","description":"The refund reason label, not a code."},"Comment":{"type":"string"},"Items":{"type":"array","description":"Empty for a total refund.","items":{"$ref":"#/components/schemas/RefundItem"}},"RequestedAt":{"type":"string","description":"Format YYYY-MM-DD HH:MM:SS."}}},"RefundItem":{"type":"object","properties":{"LineItemReference":{"type":"string","description":"The reference of the refunded order line item."},"Quantity":{"type":"integer"},"Amount":{"type":"number"}}},"ListPagination":{"type":"object","properties":{"Page":{"type":"integer"},"Limit":{"type":"integer"},"Count":{"type":"integer","description":"Total number of matching items."}}},"RefundApiError":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```


---

# 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/api-reference/reference/refunds.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.
