# MED (/zh/docs/conta-digital/med)

<QuickLinks>
  <QuickLink href="/docs/conta-digital/endpoints/infractions/get_infractions" title="列出 MED 争议" method="GET" path="/transactions/infractions" />

  <QuickLink href="/docs/conta-digital/endpoints/infractions/get_infraction" title="查询 MED 争议" method="GET" path="/transactions/infractions/{protocol}" />
</QuickLinks>

MED（特殊退款机制）是巴西央行用于退回被争议 Pix 的流程。付款人的银行针对收款账户发起争议，并设有答复期限。不答复时，金额可能退还给付款人，从账户余额中扣出。

<Callout type="info">
  答复争议需要账户持有人提供文件并作出决定，在数字账户控制台中完成，须在 `dueAt` 的期限之前。通过 API，使用作用域 `INFRACTION_READ`，你可以跟踪每一个争议。
</Callout>

## 流程与余额 [#流程与余额]

<Mermaid
  chart="`
flowchart LR
  A[&#x22;INFRACTION_OPENED&#x22;] --> B[&#x22;金额被冻结&#x22;]
  B --> C{&#x22;结果&#x22;}
  C -->|&#x22;AGREED&#x22;| D[&#x22;金额退还给付款人&#x22;]
  C -->|&#x22;DISAGREED&#x22;| E[&#x22;金额退回余额，扣除费用&#x22;]
  C -->|&#x22;CANCELLED&#x22;| F[&#x22;金额全额退回&#x22;]

  style A fill:#f59e0b,stroke:#d97706,color:#ffffff
  style D fill:#ef4444,stroke:#dc2626,color:#ffffff
  style E fill:#14ce71,stroke:#0eb464,color:#ffffff
  style F fill:#14ce71,stroke:#0eb464,color:#ffffff
`"
/>

| 时点               | Webhook                                   | 账单条目                                                                                                          |
| ---------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| 发起               | `INFRACTION_OPENED`                       | `INFRACTION_BLOCK`：[限额](/docs/conta-digital/statement#限额)中的 `infraction.blocksBalance` 为 `true` 时，金额从可用余额中扣出。 |
| 期限临近             | `INFRACTION_DEADLINE`，在剩余 48、24 和 6 小时时   |                                                                                                               |
| 成立（`AGREED`）     | `INFRACTION_CLOSED`                       | `INFRACTION_SETTLED`：金额已退还给付款人。                                                                               |
| 不成立（`DISAGREED`） | `INFRACTION_CLOSED`                       | `INFRACTION_RELEASED`：金额退回余额，扣除分析费。                                                                           |
| 已取消              | `INFRACTION_CLOSED`，带 `status: CANCELLED` | `INFRACTION_RELEASED`：金额全额退回，不收费。                                                                             |

争议结束之前，被争议收款的退款和被争议存款的退回都会以 `REFUND_INFRACTION_OPEN` 被拒绝。

## 列出 [#列出]

[`GET /transactions/infractions`](/docs/conta-digital/endpoints/infractions/get_infractions)，按发起日期从新到旧排列，按游标分页。

只跟踪尚未结束的争议时，使用 `open=true` 筛选：返回所有既不是 `CLOSED` 也不是 `CANCELLED` 的争议。所有筛选条件见[列出 MED 争议](/docs/conta-digital/endpoints/infractions/get_infractions)。

## 查询 [#查询]

[`GET /transactions/infractions/{protocol}`](/docs/conta-digital/endpoints/infractions/get_infraction)，使用 `INFRACTION_OPENED` Webhook 中的 `protocol`。

```json
{
  "id": "cmu6f0a1b000001s6abcd1234",
  "protocol": "b1c2d3e4-5f60-4a7b-8c9d-0e1f2a3b4c5d",
  "type": "REFUND_REQUEST",
  "status": "OPEN",
  "reportedBy": "DEBITED_PARTICIPANT",
  "reportDetails": "Cliente não reconhece a compra.",
  "analysisResult": null,
  "analysisDetails": null,
  "endToEndId": "E99999999202610051433a1b2c3d4e5f",
  "blockedAmount": 1500,
  "feeCharged": 0,
  "settledAmount": 0,
  "reportedAt": "2026-10-06T10:00:00.000Z",
  "dueAt": "2026-10-13T10:00:00.000Z",
  "closedAt": null,
  "origin": {
    "kind": "PAYMENT",
    "id": "cmu2wbljx0000e8gtlic8q1gi",
    "amount": 1500,
    "paidAt": "2026-10-05T14:33:10.004Z",
    "payerName": "Maria Souza",
    "payerDocument": "***.982.247-**"
  }
}
```

| 字段                           | 说明                                                                                                                                                          |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`                     | `OPEN`、`ACKNOWLEDGED`、`DEFENDED`、`ANSWERED`、`WAITING_PSP`、`WAITING_ADJUSTMENTS`、`CANCELLED` 或 `CLOSED`。只有 `OPEN`、`CLOSED` 和 `CANCELLED` 会影响余额；其他是银行之间的处理阶段。 |
| `analysisResult`             | 结果，状态为 `CLOSED` 时返回：`AGREED`（成立，金额退还给付款人）或 `DISAGREED`（不成立，金额退回余额，扣除分析费）。                                                                                   |
| `blockedAmount`              | 分析期间从可用余额中划出的金额。                                                                                                                                            |
| `feeCharged`、`settledAmount` | 收取的分析费和退还给付款人的金额。有结果前为 `0`。                                                                                                                                 |
| `origin`                     | 被争议的操作。`kind` 为 `PAYMENT`（收款）或 `DEPOSIT`（无收款单的入账 Pix），`id` 与 Webhook 中的 `paymentId` 或 `depositId` 相同。                                                       |

所有字段见[查询 MED 争议](/docs/conta-digital/endpoints/infractions/get_infraction)。