# 查询 Ethoca 预警

> 按预警标识、预警类型、时间范围、账单描述或处理结果查询 Ethoca 预警记录。

```yaml
openapi: 3.1.0
info:
  title: 查询 Ethoca 预警
  version: 1.0.0
  description: 按预警标识、预警类型、时间范围、账单描述或处理结果查询 Ethoca 预警记录。
paths:
  /ethoca/agency-cw/detail-page:
    post:
      summary: 查询 Ethoca 预警
      description: 按预警标识、预警类型、时间范围、账单描述或处理结果查询 Ethoca 预警记录。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Onerway 分配的商户号；用于限定查询的商户账户范围。
                ethocaId:
                  type: string
                  description: Ethoca 预警唯一标识；传入后可按单条预警精确查询。
                alertTypes:
                  type: string
                  description: 按预警类型筛选；不同类型对应客户争议、欺诈或拒付等风险来源。
                  enum:
                    - CustomerDispute
                    - FraudAlert
                    - ChargebackAlert
                  x-enum-descriptions:
                    CustomerDispute: 客户争议预警。
                    FraudAlert: 欺诈预警。
                    ChargebackAlert: 拒付预警。
                alertTimeStart:
                  type: string
                  description: 预警生成时间范围的起点，格式为 `yyyy-MM-dd HH:mm:ss`。
                  x-onerway-condition:
                    - 按预警生成时间范围筛选时提供。
                alertTimeEnd:
                  type: string
                  description: 预警生成时间范围的终点，格式为 `yyyy-MM-dd HH:mm:ss`。
                  x-onerway-condition:
                    - 按预警生成时间范围筛选时提供。
                txnTimeStart:
                  type: string
                  description: 原交易时间范围的起点，格式为 `yyyy-MM-dd HH:mm:ss`。
                  x-onerway-condition:
                    - 按原交易时间范围筛选时提供。
                txnTimeEnd:
                  type: string
                  description: 原交易时间范围的终点，格式为 `yyyy-MM-dd HH:mm:ss`。
                  x-onerway-condition:
                    - 按原交易时间范围筛选时提供。
                outcomeUpdatedTimeStart:
                  type: string
                  description: 预警处理状态更新时间范围的起点，格式为 `yyyy-MM-dd HH:mm:ss`。
                  x-onerway-condition:
                    - 按预警处理状态更新时间范围筛选时提供。
                outcomeUpdatedTimeEnd:
                  type: string
                  description: 预警处理状态更新时间范围的终点，格式为 `yyyy-MM-dd HH:mm:ss`。
                  x-onerway-condition:
                    - 按预警处理状态更新时间范围筛选时提供。
                billDesc:
                  type: string
                  description: 商户账单描述；可按账单描述筛选预警记录。
                resellerSubMerchantId:
                  type: string
                  description: 代理运营商的子商户标识。
                  x-onerway-required: conditional
                  x-onerway-condition:
                    - 代理运营商为其子商户查询预警记录时必填；普通商户无需传入。
                outcomeList:
                  type: string
                  description: 按预警处理结果筛选，便于区分已处置与待处理的预警。
                  enum:
                    - stopped
                    - partially_stopped
                    - previously_cancelled
                    - missed
                    - notfound
                    - account_suspended
                    - in_progress
                    - shipper_contacted
                    - other
                    - resolved
                    - previously_refunded
                    - unresolved_dispute
                  x-enum-descriptions:
                    stopped: 订单已停止。
                    partially_stopped: 订单部分停止。
                    previously_cancelled: 交易已被取消。
                    missed: 已过期，订单已发货或服务已消费。
                    notfound: 未找到相关订单。
                    account_suspended: 账户已被暂停。
                    in_progress: 正在处理该请求。
                    shipper_contacted: 已联系发货方并尝试拦截货物。
                    other: 其他未列出的情况。
                    resolved: 已解决。
                    previously_refunded: 已退款。
                    unresolved_dispute: 未解决的争议。
                  x-onerway-constraints:
                    - kind: rule
                      text: 可传一个或多个状态，多个状态以英文逗号分隔。
                current:
                  type: string
                  description: 查询页码，从 `1` 开始。
                sign:
                  type: string
                  description: 请求签名字符串；生成方式详见[请求签名](/zh/payments/get-started/request-signing)。
              required:
                - merchantNo
                - current
                - sign
            examples:
              query-ethoca-alerts:
                summary: 查询 Ethoca 预警
                value:
                  alertTypes: ChargebackAlert
                  current: "1"
                  merchantNo: replace_with_merchant_no
                  outcomeList: in_progress,previously_refunded
                  sign: "{{SIGN}}"
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: 响应码；`20000`
                      表示查询请求处理成功，其余为错误码。完整码表见[响应码](/zh/payments/api-reference/response-codes)。
                  respMsg:
                    type: string
                    description: 响应码对应的可读说明。
                  data:
                    type: object
                    properties:
                      content:
                        type: array
                        description: 符合查询条件的 Ethoca 预警记录列表；每条含原交易信息与拒付 / 处置信息。
                        items:
                          type: object
                          properties:
                            merchantNo:
                              type: string
                              description: Onerway 分配的商户号，标识商户账户。
                            ethocaId:
                              type: string
                              description: Ethoca 预警唯一标识；后续提交处理结果时使用该值。
                            alertTime:
                              type:
                                - string
                                - "null"
                              description: 预警生成时间。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Can return `null`.
                                  zh: 可能返回 `null`。
                            alertAge:
                              type:
                                - string
                                - "null"
                              description: 预警时效期限；商户应在该时效内完成核单与处置，以在拒付正式发生前介入。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Can return `null`.
                                  zh: 可能返回 `null`。
                            initiatedBy:
                              type: string
                              description: 预警发起方，通常为卡组织或发卡相关网络标识。
                            liability:
                              type: string
                              description: 预警或争议的责任方判定结果；为辅助信息，不替代商户对 `alertType`、`outcome` 与退款状态的处置判断。
                            billDesc:
                              type: string
                              description: 商户账单描述。
                            ethocaMerchantId:
                              type: string
                              description: Ethoca 商户标识。
                            resellerSubMerchantId:
                              type:
                                - string
                                - "null"
                              description: 代理子商户号。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Has a value for agency sub-merchant alert records. Regular merchant records
                                    can return `null`.
                                  zh: 代理运营商子商户预警记录中有值；普通商户记录可能为空。
                            integratorMemberId:
                              type: string
                              description: 集成商会员编号。
                            issuer:
                              type: string
                              description: 发卡机构标识。
                            cardNumber:
                              type: string
                              description: 脱敏交易卡号。
                            arn:
                              type: string
                              description: 收单参考号 ARN。
                            txnTime:
                              type: string
                              description: 原交易时间。
                            mcc:
                              type: string
                              description: 商户类别代码 MCC。
                            txnAmount:
                              type:
                                - string
                                - "null"
                              description: 原交易金额。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Can return `null`.
                                  zh: 可能返回 `null`。
                            txnCurrency:
                              type: string
                              description: 原交易币种，符合 [ISO
                                4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes)
                                标准。
                            transactionType:
                              type: string
                              description: 交易类型。
                            authCode:
                              type: string
                              description: 原交易授权码。
                            transactionId:
                              type: string
                              description: 原交易流水号。
                            chargebackReasonCode:
                              type:
                                - string
                                - "null"
                              description: 拒付原因代码。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Usually has a value for chargeback-related alerts; can be empty outside a
                                    chargeback context.
                                  zh: 拒付相关预警中通常有值；非拒付语境可能为空。
                            chargebackAmount:
                              type:
                                - string
                                - "null"
                              description: 拒付金额。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Can return `null`.
                                  zh: 可能返回 `null`。
                            chargebackCurrency:
                              type:
                                - string
                                - "null"
                              description: 拒付币种，符合 [ISO
                                4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes)
                                标准。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Usually has a value for chargeback-related alerts; can be empty outside a
                                    chargeback context.
                                  zh: 拒付相关预警中通常有值；非拒付语境可能为空。
                            outcome:
                              type:
                                - string
                                - "null"
                              description: 商户回报的预警处置结果。
                              enum:
                                - stopped
                                - partially_stopped
                                - previously_cancelled
                                - missed
                                - notfound
                                - account_suspended
                                - in_progress
                                - shipper_contacted
                                - other
                                - resolved
                                - previously_refunded
                                - unresolved_dispute
                                - null
                              x-enum-descriptions:
                                stopped: 订单已停止。
                                partially_stopped: 订单部分停止。
                                previously_cancelled: 交易已被取消。
                                missed: 已过期，订单已发货或服务已消费。
                                notfound: 未找到相关订单。
                                account_suspended: 账户已被暂停。
                                in_progress: 正在处理该请求。
                                shipper_contacted: 已联系发货方并尝试拦截货物。
                                other: 其他未列出的情况。
                                resolved: 已解决。
                                previously_refunded: 已退款。
                                unresolved_dispute: 未解决的争议。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Can be empty before the alert is handled or before the outcome is
                                    synchronized back.
                                  zh: 预警尚未处理或处理结果未回填时可能为空。
                            refundStatus:
                              type:
                                - string
                                - "null"
                              description: 与处置结果对应的退款状态。
                              enum:
                                - refunded
                                - not refunded
                                - not settled
                                - null
                              x-enum-descriptions:
                                refunded: 已完成退款。
                                not refunded: 未进行退款。
                                not settled: 退款处理中。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Can be empty before the alert is handled or before refund status is
                                    synchronized back.
                                  zh: 预警尚未处理或退款状态未回填时可能为空。
                            outcomeUpdatedTime:
                              type:
                                - string
                                - "null"
                              description: 预警处理状态更新时间。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Can be empty before the alert outcome is updated.
                                  zh: 预警处理状态尚未更新时可能为空。
                            alertType:
                              type: string
                              description: 预警类型，标识本条预警的风险来源。
                              enum:
                                - CustomerDispute
                                - FraudAlert
                                - ChargebackAlert
                              x-enum-descriptions:
                                CustomerDispute: 客户争议预警。
                                FraudAlert: 欺诈预警。
                                ChargebackAlert: 拒付预警。
                            sign:
                              type:
                                - string
                                - "null"
                              description: 记录级响应签名字符串。
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Can return `null`.
                                  zh: 可能返回 `null`。
                      current:
                        type: string
                        description: 当前返回的页码（1-based）。
                      size:
                        type: number
                        description: 每页记录数 / 页大小（当前固定为 10 条）。
                      totalPages:
                        type: number
                        description: 按当前页大小计算的总页数。
                      totalElements:
                        type: number
                        description: 符合查询条件的预警记录总条数。
                    description: 业务数据对象，包含预警记录列表与分页信息。
```
