# 退款结果通知

> 退款结果（txnType=REFUND）发送到原交易请求的 notifyUrl。

```yaml
openapi: 3.1.0
x-onerway-docs-version: v2
x-onerway-spec-key: payments/versions/v2/webhooks/refund-result
info:
  title: 退款结果通知
  version: v2
  description: 退款结果（txnType=REFUND）发送到原交易请求的 notifyUrl。
webhooks:
  refund.result:
    post:
      summary: 退款结果通知
      description: 退款结果（txnType=REFUND）发送到原交易请求的 notifyUrl。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                notifyType:
                  type: string
                  description: 通知类别。
                  x-onerway-signature-participation: included
                transactionId:
                  type: string
                  description: Onerway 退款交易号。应答通知时原样返回该值。
                  x-onerway-signature-participation: included
                paymentId:
                  type: string
                  description: 本次退款关联的支付意图 ID。
                  x-onerway-signature-participation: included
                txnType:
                  type: string
                  description: 交易操作类型；`REFUND` 表示退款结果。
                  x-onerway-signature-participation: included
                merchantNo:
                  type: string
                  description: Onerway 分配的商户号。
                  x-onerway-signature-participation: included
                merchantTxnId:
                  type: string
                  description: 本次退款的商户交易号；申请退款时未传入则由 Onerway 自动生成。
                  x-onerway-signature-participation: included
                originMerchantTxnId:
                  type: string
                  description: 原支付交易的商户交易号。
                  x-onerway-signature-participation: included
                responseTime:
                  type: string
                  description: Onerway 生成通知结果的时间，使用北京时间（UTC+08:00），格式为 `yyyy-MM-dd HH:mm:ss`。
                  x-onerway-signature-participation: included
                txnTime:
                  type: string
                  description: Onerway 将本次退款提交渠道处理的时间，使用北京时间（UTC+08:00），格式为 `yyyy-MM-dd
                    HH:mm:ss`。不是退款申请创建时间或退款完成时间。
                  x-onerway-signature-participation: included
                txnTimeZone:
                  type: string
                  description: Onerway 生成本次通知时的 UTC 偏移量，为 `+08:00`（北京时间）。
                  x-onerway-signature-participation: included
                orderAmount:
                  type: string
                  description: 通知中的交易金额，以十进制字符串表示。币种见 `orderCurrency`。
                  x-onerway-signature-participation: included
                orderCurrency:
                  type: string
                  description: "`orderAmount` 对应的币种。"
                  x-onerway-signature-participation: included
                status:
                  type: string
                  description: 退款处理结果；`S` 表示成功，`F` 表示失败。
                  x-onerway-signature-participation: included
                cardBinCountry:
                  type: string
                  description: 卡 BIN 所属国家或地区。
                  x-onerway-signature-participation: included
                reason:
                  type: string
                  description: 以 JSON 字符串表示的结果说明，包含 `respCode` 和
                    `respMsg`。验签时直接使用收到的字段值，不要解析或重新序列化其中的 JSON。
                  x-onerway-signature-participation: included
                sign:
                  type: string
                  description: 通知体中为兼容保留的签名值，不参与签名计算。Onerway
                    计算该签名时，仅使用当时第一个启用的加签密钥。轮换期间，该签名可能与使用另一密钥计算的签名不同。请使用
                    `x-signature` 验证本通知。缺少 `x-signature` 或验签失败时，不要降级使用
                    `X-Rh-Signature` 或 body `sign`。
                  x-onerway-signature-participation: signature-field
                paymentMethod:
                  type: string
                  description: 通知中的支付方式或卡品牌；该字段不参与签名计算。
                  x-onerway-signature-participation: excluded
                walletTypeName:
                  type: string
                  description: 通知中的钱包类型；该字段不参与签名计算。
                  x-onerway-signature-participation: excluded
                channelRequestId:
                  type: string
                  description: 支付渠道的请求标识。
                  x-onerway-signature-participation: included
                paymentMethodDetails:
                  type: string
                  description: 以 JSON 字符串表示的支付方式详情。验签时直接使用收到的字段值，不要解析或重新序列化其中的 JSON。
                  x-onerway-signature-participation: included
            examples:
              refund_succeeded:
                summary: 退款成功
                value:
                  notifyType: TXN
                  transactionId: demo_transactionId
                  paymentId: demo_paymentId
                  txnType: REFUND
                  merchantNo: demo_merchantNo
                  merchantTxnId: demo_merchantTxnId
                  originMerchantTxnId: demo_originMerchantTxnId
                  responseTime: 2026-09-14 00:05:29
                  txnTime: 2026-09-14 00:05:28
                  txnTimeZone: +08:00
                  orderAmount: "13.36"
                  orderCurrency: USD
                  status: S
                  cardBinCountry: US
                  reason: '{"respCode": "20000", "respMsg": "Success"}'
                  sign: replace_with_signature
                  paymentMethod: VISA
                  walletTypeName: ApplePay
                  channelRequestId: demo_channelRequestId
                  paymentMethodDetails: '{"card": {"checks": null, "holderName": null, "year":
                    null, "month": null, "cardType": "ApplePay",
                    "productCategory": null, "issuer": null, "cardBinCountry":
                    "US", "authorizationCode": null, "cardNumber":
                    "[REDACTED]"}}'
                x-onerway-headers:
                  x-signature: v1=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
                  X-Rh-Signature: v1=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
                  x-timestamp: replace_with_delivery_timestamp
      responses:
        "200":
          description: "成功接收并受理通知后，返回 HTTP 200，使用 `Content-Type: text/plain`，并在响应体中原样返回收到的
            `transactionId`。未收到成功响应时，Onerway 每 30 分钟重试，最多 3
            次。自动重试时，通知体和签名值保持不变，仅刷新未参与签名的 `x-timestamp` 请求头。不要将该请求头作为通知未被重放的证明。"
          content:
            text/plain:
              schema:
                type: string
              examples:
                return_transaction_id:
                  summary: 返回 transactionId
                  value: demo_transactionId
      x-onerway-verification:
        scheme: header-sign
        header: x-signature
        version: v1
        algorithm: sha256
        rule: acquiring-sorted-concat-secret
        reference: /zh/payments/versions/v2/get-started/webhook-signatures
      x-onerway-header-fields:
        - name: x-signature
          schema:
            type: string
            description: 用于验证本通知的签名，包含逗号分隔的一项或多项 `v1=<签名>`。
        - name: x-timestamp
          schema:
            type: string
            description: 通知发送时间，使用 Unix 秒级时间戳，不参与签名。
      x-onerway-destination:
        description: 通知发送至原交易请求中的 `notifyUrl`。
        guide: /zh/payments/versions/v2/get-started/webhooks
```
