> This page is for Afterpay Online Developer, version Chinese.
> For other versions, use one of these documentation indexes:
> - Main (default): https://developers.afterpay.com/afterpay-online-developer/main/llms.txt
> - v1: https://developers.afterpay.com/afterpay-online-developer/v-1/llms.txt
> - Chinese: https://developers.afterpay.com/afterpay-online-developer/chinese/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.afterpay.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.afterpay.com/_mcp/server.

# 接受或争辩争议

当创建争议时，Afterpay 鼓励商户联系其客户。然后商户可以决定执行以下操作之一：

* [接受争议](#接受争议)
* [收集并提交证据以帮助解决争议](#证据提交流程)

商户可以使用 Afterpay Business Hub 或以下 API 来接受或争辩争议。

> **Info**
>
> 目前，Afterpay 仅支持一轮证据提交，我们计划在未来支持多轮提交。

## 接受争议

商户可以调用以下端点来接受争议案例。此端点仅在争议处于非终态时有效，即争议状态不是 `won` 或 `lost`。

> **Info**
>
> 调用 API 会将争议状态转换为 `lost`。

## 接受争议 - 端点

```
POST https://{afterpay_global_url}/v2/disputes/{dispute_id}/accept
```

#### 连接超时

| 超时类型 | 时间（秒） |
| ---- | ----- |
| OPEN | 10    |
| Read | 20    |

#### 请求头

| 头部         | 类型     | 示例                                                                                                                                                 |
| ---------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| User-Agent | String | MyAfterpayModule/1.0.0 (E-Commerce Platform Name/1.0.0; PHP/7.0.0; Merchant/60032000) [https://merchant.example.com](https://merchant.example.com) |

| 头部     | 类型     | 默认值              |
| ------ | ------ | ---------------- |
| Accept | String | application/json |

### 请求参数

| 字段名称        | 数据类型   | 描述         |
| ----------- | ------ | ---------- |
| dispute\_id | String | （必需）争议标识符。 |

### 响应

| 字段名称    | 数据类型          | 描述       |
| ------- | ------------- | -------- |
| dispute | DisputeObject | 更新的争议对象。 |

### 争议对象示例

| 字段名称                   | 数据类型       | 示例                                                       |
| ---------------------- | ---------- | -------------------------------------------------------- |
| id                     | String     | dp\_ivpMnZkDhLykyXeoSr5WF4                               |
| order                  | String     | 123456789                                                |
| amount                 | String     | 48.46                                                    |
| currency               | String     | CAD                                                      |
| reason                 | String     | paid\_by\_other\_means                                   |
| status                 | String     | lost                                                     |
| open                   | Boolean    | false                                                    |
| responseDueBy          | Timestamp  | 1691884800                                               |
| createdAt              | Timestamp  | 1691884800                                               |
| openingNote            | String     | Customer has no knowledge of the Payment.                |
| openingNoteAttachments | FileId     | \["fi\_48vmw3sXdVqvtJGXbgKbAZ"]                          |
| updatedAt              | Timestamp  | 1691884800                                               |
| closingReason          | String     | merchant\_accepted                                       |
| closingNote            | String     | Merchant accepted the dispute                            |
| merchantOrderId        | String     | merchantorderid12345                                     |
| transactionDate        | Timestamp  | 1691884800                                               |
| settlementAmount       | String     | 48.46                                                    |
| meta                   | MetaObject | `"transactionAmount": "48.46"`,  `"orderType": "ONLINE"` |

## 证据提交流程

如果商户不想接受争议，Afterpay 提供了通过 Afterpay Business Hub 或 API 提交证据来争辩争议的方式。

Afterpay 为商户提供文件上传 API，用于上传争辩争议所需的证据。文件上传 API 返回的令牌随后可以作为争议 API 端点请求/响应的一部分指定。有关文件上传 API 的详细信息，请参见[上传文件](Disputes-Retrieve.md#uploading-files)。

## 回应争议

回应争议（例如，提交证据）端点使商户能够为争议提交证据。这仅在争议处于 `needs_response` 状态时允许。

这意味着，商户只有一次提交证据的机会。一旦收到 200 响应，此信息就无法更新或更改。

### 端点

```
POST https://{afterpay_global_url}/v2/disputes/{dispute_id}
```

#### 连接超时

| 超时类型 | 时间（秒） |
| ---- | ----- |
| OPEN | 10    |
| Read | 20    |

#### 请求头

| 头部         | 类型     | 示例                                                                                                                                                 |
| ---------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| User-Agent | String | MyAfterpayModule/1.0.0 (E-Commerce Platform Name/1.0.0; PHP/7.0.0; Merchant/60032000) [https://merchant.example.com](https://merchant.example.com) |

| 头部           | 类型     | 默认值              |
| ------------ | ------ | ---------------- |
| Accept       | String | application/json |
| Content-Type | String | application/json |

### 请求参数

证据字段直接在请求体中与争议 `id` 一起提交。至少需要提供一个证据字段。

| 字段名称                     | 数据类型   | 描述                                                           |
| ------------------------ | ------ | ------------------------------------------------------------ |
| id                       | String | 给定争议的唯一 ID。                                                  |
| productDescription       | String | 产品或服务的描述，以及在购买时向客户展示的任何相关详细信息。                               |
| refundPolicy             | String | 文件上传的令牌。向客户展示或提供的商户退款政策。                                     |
| refundPolicyDisclosure   | String | 解释在购买前如何以及何时向客户展示或提供商户的退款政策。                                 |
| refundRefusalExplanation | String | 商户解释为什么客户无权获得退款。                                             |
| shippingDocumentation    | String | 文件上传的令牌。争议支付的运输标签或收据。                                        |
| shippingAddress          | String | 实物产品发货的地址。                                                   |
| shippingDate             | String | 对于实物产品，实物产品开始运往收货地址的日期，采用清晰的人类可读格式。此日期应早于争议日期。               |
| shippingCarrier          | String | 对于实物产品，运送实物产品的快递服务，如 Fedex、UPS、USPS 等。如果此次购买使用了多个承运商，请用逗号分隔。 |
| shippingTrackingNumber   | String | 从快递服务获得的实物产品的跟踪号。                                            |
| uncategorizedFile        | String | 文件上传的令牌。不属于上述任何类别的其他文件。                                      |
| uncategorizedText        | String | 商户认为相关的任何其他文本。                                               |

### 响应

| 字段名称    | 数据类型          | 描述       |
| ------- | ------------- | -------- |
| dispute | DisputeObject | 更新的争议对象。 |

## 证据字段限制

| 字段                       | 限制               |
| ------------------------ | ---------------- |
| productDescription       | 长度：1-5000 字符     |
| refundPolicy             | 由上传文件端点生成的有效文件令牌 |
| refundPolicyDisclosure   | 长度：1-5000 字符     |
| refundRefusalExplanation | 长度：1-5000 字符     |
| shippingDocumentation    | 由上传文件端点生成的有效文件令牌 |
| shippingAddress          | 长度：1-5000 字符     |
| shippingDate             | 长度：1-5000 字符     |
| shippingCarrier          | 长度：1-5000 字符     |
| shippingTrackingNumber   | 长度：1-5000 字符     |
| uncategorizedFile        | 由上传文件端点生成的有效文件令牌 |
| uncategorizedText        | 长度：1-5000 字符     |