# 打款回调

> 接收打款状态变更后的异步回调，并据此更新您的业务订单状态。

```yaml
openapi: 3.1.0
info:
  title: 打款回调
  version: 1.0.0
  description: 接收打款状态变更后的异步回调，并据此更新您的业务订单状态。
webhooks:
  transfer.result:
    post:
      summary: 打款回调
      description: 接收打款状态变更后的异步回调，并据此更新您的业务订单状态。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Onerway 分配的商户号。
                  x-onerway-signature-participation: included
                requestId:
                  type: string
                  description: 商户请求流水号，用于将本次通知关联到您的业务订单。
                  x-onerway-signature-participation: included
                payoutId:
                  type: string
                  description: 本次打款对应的 Onerway 打款流水 ID。
                  x-onerway-constraints:
                    - kind: rule
                      text: 该值可能超出 JavaScript 安全整数范围；存储和比对时请按字符串处理。
                  x-onerway-signature-participation: included
                status:
                  type: string
                  description: 当前打款状态。
                  enum:
                    - A
                    - CA
                    - B
                    - U
                    - V
                    - R
                    - P
                    - S
                    - F
                  x-enum-descriptions:
                    A: 待审核。
                    CA: 合规审核中。
                    B: 待检查。
                    U: 审核不通过。
                    V: 检查不通过。
                    R: 待出款。
                    P: 出款中。
                    S: 成功。
                    F: 失败。
                  x-onerway-constraints:
                    - kind: rule
                      text: 请将该字段作为打款生命周期状态使用；`S` 表示成功，`F` 表示最终失败，其余值表示仍在处理中或等待审核。
                  x-onerway-signature-participation: included
                statusTime:
                  type: string
                  description: 该状态生成时间，格式为 `yyyy-MM-dd HH:mm:ss`。
                  x-onerway-signature-participation: included
                payoutStatusReason:
                  type:
                    - string
                    - "null"
                  description: 当前打款状态的补充原因说明。
                  x-onerway-value:
                    nullable: true
                    when:
                      en: Returned when Onerway has an additional reason for the current payout
                        status.
                      zh: 当 Onerway 对当前打款状态提供额外原因时返回。
                  x-onerway-signature-participation: included
                settleCurrency:
                  type: string
                  description: 本次打款请求使用的结算币种。
                  x-onerway-signature-participation: included
                settleSumAmount:
                  type: number
                  description: 本次打款提交的结算金额。
                  x-onerway-signature-participation: included
                payoutCurrency:
                  type: string
                  description: 收款人到账币种。
                  x-onerway-signature-participation: included
                payoutAmount:
                  type: number
                  description: 收款人以 `payoutCurrency` 收到的金额。
                  x-onerway-signature-participation: included
                serviceFee:
                  type:
                    - number
                    - "null"
                  description: 本次打款收取的手续费。
                  x-onerway-value:
                    nullable: true
                    when:
                      en: Returned when a service fee is charged for this payout.
                      zh: 当本次打款收取手续费时返回。
                  x-onerway-signature-participation: included
                convRate:
                  type:
                    - number
                    - "null"
                  description: 本次打款使用的汇率。
                  x-onerway-value:
                    nullable: true
                    when:
                      en: Returned when currency conversion is applied between settlement and payout
                        currencies.
                      zh: 当结算币种与到账币种之间发生汇兑时返回。
                  x-onerway-signature-participation: included
            examples:
              transfer_result_processing:
                summary: 打款处理中
                value:
                  merchantNo: replace_with_merchant_no
                  requestId: replace_with_request_id
                  payoutId: replace_with_payout_id
                  status: P
                  statusTime: 2025-01-15 08:32:10
                  payoutStatusReason: Submitted to downstream payout channel
                  settleCurrency: USD
                  settleSumAmount: 100
                  payoutCurrency: EUR
                  payoutAmount: 92.35
                  serviceFee: 2.5
                  convRate: 0.9235
              transfer_result_succeeded:
                summary: 打款成功
                value:
                  merchantNo: replace_with_merchant_no
                  requestId: replace_with_request_id
                  payoutId: replace_with_payout_id
                  status: S
                  statusTime: 2025-01-15 08:51:40
                  payoutStatusReason: null
                  settleCurrency: USD
                  settleSumAmount: 100
                  payoutCurrency: EUR
                  payoutAmount: 92.35
                  serviceFee: 2.5
                  convRate: 0.9235
              transfer_result_failed:
                summary: 打款失败
                value:
                  merchantNo: replace_with_merchant_no
                  requestId: replace_with_request_id
                  payoutId: replace_with_payout_id
                  status: F
                  statusTime: 2025-01-15 09:12:05
                  payoutStatusReason: Beneficiary account verification failed
                  settleCurrency: USD
                  settleSumAmount: 100
                  payoutCurrency: EUR
                  payoutAmount: 0
                  serviceFee: null
                  convRate: null
      responses:
        "200":
          description: 成功接收并处理通知后，返回 HTTP 200，并在响应体中返回纯文本 `SUCCESS`。
          content:
            text/plain:
              schema:
                type: string
              examples:
                return_success:
                  summary: 返回 SUCCESS
                  description: 返回旧版 Transfer webhook 约定的成功字符串。
                  value: SUCCESS
```
