> For the complete documentation index, see [llms.txt](https://useepay.gitbook.io/developer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://useepay.gitbook.io/developer/reference/api-reference-xin-yong-ka/order/refund.md).

# 退款

## 退款

<mark style="color:green;">`POST`</mark> `BASE_URL/api`

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| content-type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

#### Request Body

| Name                                                    | Type   | Description                                         |
| ------------------------------------------------------- | ------ | --------------------------------------------------- |
| version<mark style="color:red;">\*</mark>               | String | max=5 调用的接口版本，固定为：1.0                               |
| merchantNo<mark style="color:red;">\*</mark>            | String | max=16 商户号，由 USEEPAY 分配                             |
| transactionId<mark style="color:red;">\*</mark>         | String | max=64 商户订单号，建议每次请求的 transactionId 唯一，有利于后续订单查询和对账。 |
| transactionType<mark style="color:red;">\*</mark>       | String | max=18 交易类型：refund                                  |
| originalTransactionId<mark style="color:red;">\*</mark> | String | max=64 原始预授权完成/支付商户订单号                              |
| amount<mark style="color:red;">\*</mark>                | String | max=12 订单金额（必须大于 0），单位为对应币种的最小货币单位(详见 ISO 4217)     |
| currency<mark style="color:red;">\*</mark>              | String | max=3 3 位 ISO 大写字母货币代码(详见 ISO 4217)。退款币种需与正向交易币种相同  |
| signType<mark style="color:red;">\*</mark>              | String | max=4 商户生成签名字符串所使用的签名算法类型                           |
| sign<mark style="color:red;">\*</mark>                  | String | max=256 商户请求参数的签名串                                  |
| notifyUrl                                               | String | USEEPAY 回调商户地址                                      |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "amount": "1", 
    "resultCode": "pending",
    "sign": "035bfd3acf5732e6ce9c9f772bf85158",
    "errorCode": "0000",
    "transactionId": "202110141059261", // 商户订单号，需保证在商户端不重复
    "errorMsg": "Approved or completed successfully",
    "transactionType": "refund", // 交易类型：refund
    "reference": "1062110141059650859", 
    "echoParam": "echoParam",
    "originalTransactionId": "202110141054086",
    "reserved": "reserved",
    "signType": "MD5",
    "currency": "USD",
    "merchantNo": "500000000007381" // 商户编号，由 USEEPAY 分配
}
```

{% endtab %}
{% endtabs %}

### Response

<table data-header-hidden><thead><tr><th width="182.21637426900585">字段</th><th>描述</th><th width="150" data-type="checkbox">必要</th><th data-hidden>描述</th></tr></thead><tbody><tr><td>version</td><td>max=5 调用的接口版本，固定为：1.0</td><td>true</td><td></td></tr><tr><td>merchantNo</td><td>max=16 商户编号，由 USEEPAY 分配</td><td>true</td><td></td></tr><tr><td>transactionId</td><td>max=64商户订单号，需保证在商户端不重复</td><td>true</td><td></td></tr><tr><td>transactionType</td><td>max=18 交易类型：refund</td><td>true</td><td></td></tr><tr><td>reference</td><td>max=32USEEPAY 订单号</td><td>false</td><td></td></tr><tr><td>amount</td><td>max=12 支付金额，单位为对应币种的最小货币单位(详见 ISO 4217)</td><td>true</td><td></td></tr><tr><td>currency</td><td>max=3 3 位 ISO 大写字母货币代码(详见 ISO 4217)</td><td>true</td><td></td></tr><tr><td>resultCode</td><td>max=32 业务结果（<a href="https://useepay.gitbook.io/useepay/api/resultCode">详见 业务结果码）</a></td><td>true</td><td></td></tr><tr><td>errorCode</td><td>max=4 错误码（<a href="https://useepay.gitbook.io/useepay/api/errorCode">详见 错误码 errorCode）</a></td><td>false</td><td></td></tr><tr><td>errorMsg</td><td>max=256 错误码消息描述</td><td>false</td><td></td></tr><tr><td>echoParam</td><td>max=256 回声参数，响应报文会原样返回</td><td>false</td><td></td></tr><tr><td>reserved</td><td>max=256 预留字段，值同请求报文</td><td>false</td><td></td></tr><tr><td>sign</td><td>max=256 商户请求参数的签名串</td><td>true</td><td></td></tr></tbody></table>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://useepay.gitbook.io/developer/reference/api-reference-xin-yong-ka/order/refund.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
