# 查询付款详情

> 通过付款编号或商户请求编号查询单笔付款的状态、金额及资金发起方信息。

```yaml
openapi: 3.1.0
x-onerway-docs-version: original
x-onerway-spec-key: transfer/v3-transactions/query-detail
info:
  title: 查询付款详情
  version: original
  description: 通过付款编号或商户请求编号查询单笔付款的状态、金额及资金发起方信息。
servers:
  - url: https://sandbox-transfer-api.onerway.com
    description: sandbox
  - url: https://transfer-api.onerway.com
    description: production
paths:
  /api/v3/txn/queryDetail:
    post:
      summary: 查询付款详情
      description: 通过付款编号或商户请求编号查询单笔付款的状态、金额及资金发起方信息。
      parameters:
        - name: ApiKey
          in: header
          required: true
          description: Onerway 分配的账户服务 API key 请求 Header；必须使用与请求域名相同环境的值。
          schema:
            type: string
            description: Onerway 分配的账户服务 API key 请求 Header；必须使用与请求域名相同环境的值。
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                transferId:
                  type: integer
                  description: Onerway 付款编号。
                  x-onerway-constraints:
                    - kind: rule
                      text: transferId 和 requestId 至少填写一个；同时填写时须对应同一笔付款。
                requestId:
                  type: string
                  description: 商户生成的付款业务流水号。
                onBehalfOf:
                  type: string
                  description: 请求实际对应的商户号，仅在代其他商户发起请求时填写。
            examples:
              default:
                summary: 请求结构示例（替换为当前商户数据）
                value:
                  requestId: demo_transfer_001
      responses:
        "200":
          description: 无快照的订单
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      respCode:
                        type: string
                        description: 响应码；`20000` 表示请求处理成功，其余为错误码。
                      respMsg:
                        type: string
                        description: 响应码对应的可读说明。
                      data:
                        type: object
                        properties:
                          merchantNo:
                            type: string
                            description: 请求发起方的商户号。
                          onBehalfOf:
                            type: string
                            description: 代其他商户请求时返回实际业务商户号；为自身请求时省略。
                          requestId:
                            type: string
                            description: 商户生成的付款业务流水号。
                          transferId:
                            type: string
                            description: Onerway 付款编号。
                          status:
                            type: string
                            description: 付款状态。取值见[枚举说明](/zh/transfer/api-reference/v3-enums#transactionstatus-付款状态)。
                            enum:
                              - A
                              - P
                              - S
                              - F
                              - RETURNED
                            x-enum-descriptions:
                              A: 已创建
                              P: 处理中
                              S: 成功
                              F: 付款失败
                              RETURNED: 退回
                          payoutStatusReason:
                            type: string
                            description: "付款状态的补充说明。付款失败原因沿用商户可见的原因说明；RETURNED 的原因以 Returned- fail reason:
                              开头。"
                          transactionInfo:
                            type: object
                            properties:
                              sourceCurrency:
                                type: string
                                description: 源币种，参见[币种枚举](/zh/transfer/api-reference/v3-enums#币种枚举)。
                              sourceAmount:
                                type: number
                                description: 商户总扣款金额（含平台手续费），币种为 sourceCurrency。
                              targetCurrency:
                                type: string
                                description: 目标币种，参见[币种枚举](/zh/transfer/api-reference/v3-enums#币种枚举)。
                              targetAmount:
                                type: number
                                description: 付款金额，币种为 targetCurrency；付款结果以 status 为准。
                              exchangeRate:
                                type: number
                                description: 本笔付款记录的汇率。
                              destinationCountry:
                                type: string
                                description: 收款账户所在国家或地区，参见[国家/地区枚举](/zh/transfer/api-reference/v3-enums#国家地区枚举)。
                              paymentMethod:
                                type: string
                                description: 付款方式，参见[枚举说明](/zh/transfer/api-reference/v3-enums#paymentmethod-付款方式)。
                                enum:
                                  - BANK_TRANSFER
                                  - SWIFT
                                  - E_WALLET
                                  - CASH_PICKUP
                                x-enum-descriptions:
                                  BANK_TRANSFER: 银行转账
                                  SWIFT: SWIFT 汇款
                                  E_WALLET: 电子钱包
                                  CASH_PICKUP: 现金支取
                              transactionPurpose:
                                type: string
                                description: 交易用途，参见[枚举说明](/zh/transfer/api-reference/v3-enums#transactionpurpose-交易用途)。
                                enum:
                                  - TRANSFER_TO_OWN_ACCOUNT
                                  - LOAN_OR_CREDIT_REPAYMENT
                                  - FREIGHT_CHARGES
                                  - PROFESSIONAL_OR_BUSINESS_SERVICES
                                  - OTHER
                                x-enum-descriptions:
                                  TRANSFER_TO_OWN_ACCOUNT: 转至本人账户
                                  LOAN_OR_CREDIT_REPAYMENT: 贷款或信贷偿还
                                  FREIGHT_CHARGES: 运费
                                  PROFESSIONAL_OR_BUSINESS_SERVICES: 专业服务或商业服务
                                  OTHER: 其他
                              reference:
                                type: string
                                description: 付款交易附言或备注。
                              serviceFeeAmount:
                                type: number
                                description: 平台手续费，币种为 serviceFeeCurrency。负数表示手续费扣款，保留原始负号。
                              serviceFeeCurrency:
                                type: string
                                description: 平台手续费币种，与 sourceCurrency 一致。
                              chargeBearer:
                                type: string
                                description: 平台手续费承担方，取值见[枚举说明](/zh/transfer/api-reference/v3-enums#chargebearer-平台手续费承担方)。
                                enum:
                                  - DEBT
                                  - CRED
                                x-enum-descriptions:
                                  DEBT: 付款人承担平台手续费
                                  CRED: 收款人承担平台手续费
                              swiftFeeType:
                                type: string
                                description: SWIFT
                                  费用承担方式，与平台手续费承担方分别设置，取值见[枚举说明](/zh/transfer/api-reference/v3-enums#swiftfeetype-swift-费用承担方式)。
                                enum:
                                  - OUR
                                  - SHA
                                x-enum-descriptions:
                                  OUR: 付款人承担 SWIFT 费用
                                  SHA: 双方分担 SWIFT 费用
                            description: 交易创建时记录的付款信息。交易快照不可用时省略。
                          beneficiary:
                            type: object
                            properties:
                              beneficiaryId:
                                type: string
                                description: 本笔付款使用的 Onerway 收款人 ID；未取得时省略。
                              entityType:
                                type: string
                                description: 收款人的主体类型，取值见[枚举说明](/zh/transfer/api-reference/v3-enums#entitytype-主体类型)。
                                enum:
                                  - INDIVIDUAL
                                  - BUSINESS
                                x-enum-descriptions:
                                  INDIVIDUAL: 个人
                                  BUSINESS: 企业
                              individual:
                                type: object
                                properties:
                                  name:
                                    type: object
                                    properties:
                                      firstName:
                                        type: string
                                        description: 收款人的名。
                                      lastName:
                                        type: string
                                        description: 收款人的姓。
                                    description: 个人姓名
                                  identity:
                                    type: object
                                    properties:
                                      idType:
                                        type: string
                                        description: 证件类型
                                      idNumber:
                                        type: string
                                        description: 证件号码
                                      issuingCountry:
                                        type: string
                                        description: 证件签发国家或地区代码，参见[国家/地区枚举](/zh/transfer/api-reference/v3-enums#国家地区枚举)。
                                      expiryDate:
                                        type: string
                                        description: 证件到期日期，格式为 yyyy-MM-dd。
                                      issueDate:
                                        type: string
                                        description: 证件签发日期，格式为 yyyy-MM-dd。
                                    description: 证件信息
                                  dateOfBirth:
                                    type: string
                                    description: 出生日期，格式为 yyyy-MM-dd。
                                description: 个人主体信息，仅适用于 entityType=INDIVIDUAL。
                              business:
                                type: object
                                properties:
                                  companyName:
                                    type: string
                                    description: 收款人的公司名称。
                                  tin:
                                    type: string
                                    description: 税务识别号
                                  registrationNumber:
                                    type: string
                                    description: 企业注册号
                                  registrationDate:
                                    type: string
                                    description: 企业注册日期，格式为 yyyy-MM-dd。
                                description: 企业主体信息，仅适用于 entityType=BUSINESS。
                              contact:
                                type: object
                                properties:
                                  email:
                                    type: string
                                    description: 收款人的邮箱。
                                  mobile:
                                    type: object
                                    properties:
                                      areaCode:
                                        type: string
                                        description: 国际电话区号，包含 +
                                      number:
                                        type: string
                                        description: 电话号码，不包含区号
                                    description: 手机联系方式
                                description: 联系方式
                              address:
                                type: object
                                properties:
                                  countryCode:
                                    type: string
                                    description: 国家或地区代码，参见[国家/地区枚举](/zh/transfer/api-reference/v3-enums#国家地区枚举)。
                                  state:
                                    type: string
                                    description: 收款人地址所在的省或州。具体规则请参考[收款人字段规则查询](/zh/transfer/api-reference/endpoints/v3-beneficiaries-schema)返回的校验规则。
                                  city:
                                    type: string
                                    description: 收款人地址所在的城市。具体规则请参考[收款人字段规则查询](/zh/transfer/api-reference/endpoints/v3-beneficiaries-schema)返回的校验规则。
                                  addressLine1:
                                    type: string
                                    description: 主要街道地址，通常包含门牌号和街道名称。
                                  addressLine2:
                                    type: string
                                    description: 楼栋、楼层、房间或单元等补充信息。
                                  addressLine3:
                                    type: string
                                    description: 其他必要的地址补充信息。
                                  postalCode:
                                    type: string
                                    description: 收款人地址的邮政编码。
                                description: 收款人的地址信息。
                              account:
                                type: object
                                properties:
                                  countryCode:
                                    type: string
                                    description: 国家或地区代码，参见[国家/地区枚举](/zh/transfer/api-reference/v3-enums#国家地区枚举)。
                                  currency:
                                    type: string
                                    description: 账户币种，参见[币种枚举](/zh/transfer/api-reference/v3-enums#币种枚举)。
                                  bankAccount:
                                    type: object
                                    properties:
                                      accountHolderName:
                                        type: string
                                        description: 银行账户持有人名称
                                      bankName:
                                        type: string
                                        description: 收款银行名称。
                                      accountType:
                                        type: string
                                        description: 银行账户类型，参见[枚举说明](/zh/transfer/api-reference/v3-enums#accounttype-银行账户类型)。
                                        enum:
                                          - CHECKING
                                          - SAVING
                                          - ORDINARY
                                        x-enum-descriptions:
                                          CHECKING: 支票账户
                                          SAVING: 储蓄账户
                                          ORDINARY: 普通账户
                                      accountIdentifier:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            description: 银行账号标识类型，取值见[枚举说明](/zh/transfer/api-reference/v3-enums#type-银行账号标识类型)。
                                            enum:
                                              - IBAN
                                              - LOCAL_ACCOUNT
                                            x-enum-descriptions:
                                              IBAN: 国际银行账户号码
                                              LOCAL_ACCOUNT: 本地银行账号
                                          value:
                                            type: string
                                            description: IBAN 或本地银行账号，与 type 一致
                                        description: 银行账号及其类型
                                      swiftCode:
                                        type: string
                                        description: 收款银行的 SWIFT 代码。
                                      routingNumber:
                                        type: string
                                        description: 银行代码或本地清算路由代码，用于识别收款银行或其在当地清算网络中的路由。具体代码类型取决于收款国家：英国使用 Sort
                                          Code，美国使用 ABA Routing Number。
                                      branchNumber:
                                        type: string
                                        description: 收款账户所属银行分支机构的代码。
                                    description: 银行账户信息
                                  walletAccount:
                                    type: object
                                    properties:
                                      walletProvider:
                                        type: string
                                        description: 钱包服务商，参见[钱包服务商](/zh/transfer/api-reference/v3-enums#walletprovider-walletformat-钱包服务商与账号格式)。
                                      walletFormat:
                                        type: string
                                        description: 所选 walletProvider
                                          对应的钱包账号格式，参见[钱包账号格式](/zh/transfer/api-reference/v3-enums#walletprovider-walletformat-钱包服务商与账号格式)。
                                      walletIdentifier:
                                        type: string
                                        description: 收款人的钱包账号，账号格式取决于 walletProvider 和 walletFormat。
                                    description: 电子钱包账户信息
                                  cashPickupAccount:
                                    type: object
                                    properties:
                                      pickupBankName:
                                        type: string
                                        description: 现金支取机构名称
                                      pickupBranchId:
                                        type: string
                                        description: 领取网点编号
                                      pickupBranchName:
                                        type: string
                                        description: 领取网点名称
                                      pickupBranchAddress:
                                        type: string
                                        description: 领取网点地址
                                    description: 现金支取网点信息
                                description: 收款账户信息
                            description: 本笔付款创建时保存的收款人信息，不限付款 API 版本或创建来源。后续修改收款人资料不改变快照。快照不可用时，本对象仅包含订单保存的
                              beneficiaryId；订单未保存编号时省略 beneficiaryId。
                          createTime:
                            type: string
                            description: 交易创建时间，格式 yyyy-MM-dd HH:mm:ss，北京时间（UTC+8）。
                          updateTime:
                            type: string
                            description: 交易最近更新时间，格式 yyyy-MM-dd HH:mm:ss，北京时间（UTC+8）。
                        description: 成功业务数据；失败不作为有效业务数据读取
                        x-onerway-constraints:
                          - kind: rule
                            text: 仅在 respCode=20000 时读取业务数据。未赋值的交易字段省略。
                          - kind: rule
                            text: 无匹配订单返回业务错误，不返回空对象表示成功。状态 A/P/S/F/RETURNED 分别表示已创建/处理中/成功/失败/退回，查看
                              payoutStatusReason。
                      error:
                        type: object
                        properties:
                          type:
                            type: string
                            description: 错误类型。
                          code:
                            type: string
                            description: 本接口错误标识。
                          declineCode:
                            type: string
                            description: 拒绝原因码，可能为空。
                          message:
                            type: string
                            description: 错误详细说明
                          param:
                            type: string
                            description: 失败字段或条件；无法定位时可能为空
                          docUrl:
                            type: string
                            description: 错误文档链接，可能为空。
                          requestId:
                            type: string
                            description: 服务端错误跟踪标识，req_ + 32 位十六进制字符；不是商户请求编号
                          errorDetails:
                            type: array
                            description: 具体错误明细；见下列分支
                            items:
                              type: object
                              properties:
                                errorCode:
                                  type: string
                                  description: 业务或校验明细码。
                                message:
                                  type: string
                                  description: 明细说明
                        description: 结构化失败信息；并非每个失败分支都有该字段
                  - type: object
                    properties:
                      respCode:
                        type: string
                      respMsg:
                        type: string
                      error:
                        type: object
                        properties:
                          type:
                            type: string
                          code:
                            type: string
                          message:
                            type: string
                          requestId:
                            type: string
                          errorDetails:
                            type: array
                            items:
                              type: object
                              properties:
                                errorCode:
                                  type: string
                                message:
                                  type: string
                              required:
                                - errorCode
                                - message
                          param:
                            type: string
                        required:
                          - type
                          - code
                          - message
                          - requestId
                          - errorDetails
                          - param
                    required:
                      - respCode
                      - respMsg
                      - error
              examples:
                "50120":
                  summary: 使用不存在的 requestId。
                  description: 使用不存在的 requestId。
                  value:
                    respCode: "50120"
                    respMsg: requestId or transferId is invalid
                    error:
                      type: business_error
                      code: "50120"
                      message: requestId or transferId is invalid
                      requestId: req_00000000000000000000000000000001
                      errorDetails:
                        - errorCode: "50120"
                          message: requestId or transferId is invalid
                      param: requestId
                without_snapshot:
                  summary: 无快照的订单
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      merchantNo: "800699"
                      requestId: demo_transfer_001
                      transferId: "1000001"
                      status: P
                      payoutStatusReason: ""
                      beneficiary:
                        beneficiaryId: "10001"
                      createTime: 2026-10-19 13:45:10
                      updateTime: 2026-10-19 13:45:11
                success:
                  summary: 成功示例
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      merchantNo: "800699"
                      requestId: demo_transfer_001
                      transferId: "1000001"
                      status: S
                      payoutStatusReason: ""
                      transactionInfo:
                        sourceCurrency: USD
                        sourceAmount: 100
                        targetCurrency: USD
                        targetAmount: 99
                        exchangeRate: 1
                        destinationCountry: US
                        paymentMethod: BANK_TRANSFER
                        transactionPurpose: TRANSFER_TO_OWN_ACCOUNT
                        reference: demo payment
                        serviceFeeAmount: -1
                        serviceFeeCurrency: USD
                        chargeBearer: DEBT
                      beneficiary:
                        beneficiaryId: "10001"
                        entityType: INDIVIDUAL
                        individual:
                          name:
                            firstName: Example
                            lastName: Recipient
                        contact:
                          email: recipient@example.com
                        address:
                          countryCode: US
                          city: Example City
                          addressLine1: 123 Example Street
                        account:
                          countryCode: US
                          currency: USD
                          bankAccount:
                            accountHolderName: Example Recipient
                            bankName: Example Bank
                            accountIdentifier:
                              type: LOCAL_ACCOUNT
                              value: demo_account_001
                      createTime: 2026-10-19 13:45:10
                      updateTime: 2026-10-19 13:45:11
                failure:
                  summary: 使用不存在的 requestId。
                  value:
                    respCode: "50120"
                    respMsg: requestId or transferId is invalid
                    error:
                      type: business_error
                      code: "50120"
                      message: requestId or transferId is invalid
                      requestId: req_00000000000000000000000000000001
                      errorDetails:
                        - errorCode: "50120"
                          message: requestId or transferId is invalid
                      param: requestId
                transfer_failed:
                  summary: 付款失败
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      merchantNo: "800699"
                      requestId: demo_transfer_001
                      transferId: "1000001"
                      status: F
                      payoutStatusReason: Beneficiary account is invalid
                      transactionInfo:
                        sourceCurrency: USD
                        sourceAmount: 100
                        targetCurrency: USD
                        targetAmount: 99
                        exchangeRate: 1
                        destinationCountry: US
                        paymentMethod: BANK_TRANSFER
                        transactionPurpose: TRANSFER_TO_OWN_ACCOUNT
                        reference: demo payment
                        serviceFeeAmount: -1
                        serviceFeeCurrency: USD
                        chargeBearer: DEBT
                      beneficiary:
                        beneficiaryId: "10001"
                        entityType: INDIVIDUAL
                        individual:
                          name:
                            firstName: Example
                            lastName: Recipient
                        contact:
                          email: recipient@example.com
                        address:
                          countryCode: US
                          city: Example City
                          addressLine1: 123 Example Street
                        account:
                          countryCode: US
                          currency: USD
                          bankAccount:
                            accountHolderName: Example Recipient
                            bankName: Example Bank
                            accountIdentifier:
                              type: LOCAL_ACCOUNT
                              value: demo_account_001
                      createTime: 2026-10-19 13:45:10
                      updateTime: 2026-10-19 13:45:11
                transfer_returned:
                  summary: 付款失败（Returned）
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      merchantNo: "800699"
                      requestId: demo_transfer_001
                      transferId: "1000001"
                      status: RETURNED
                      payoutStatusReason: Returned- fail reason:Beneficiary account closed
                      transactionInfo:
                        sourceCurrency: USD
                        sourceAmount: 100
                        targetCurrency: USD
                        targetAmount: 99
                        exchangeRate: 1
                        destinationCountry: US
                        paymentMethod: BANK_TRANSFER
                        transactionPurpose: TRANSFER_TO_OWN_ACCOUNT
                        reference: demo payment
                        serviceFeeAmount: -1
                        serviceFeeCurrency: USD
                        chargeBearer: DEBT
                      beneficiary:
                        beneficiaryId: "10001"
                        entityType: INDIVIDUAL
                        individual:
                          name:
                            firstName: Example
                            lastName: Recipient
                        contact:
                          email: recipient@example.com
                        address:
                          countryCode: US
                          city: Example City
                          addressLine1: 123 Example Street
                        account:
                          countryCode: US
                          currency: USD
                          bankAccount:
                            accountHolderName: Example Recipient
                            bankName: Example Bank
                            accountIdentifier:
                              type: LOCAL_ACCOUNT
                              value: demo_account_001
                      createTime: 2026-10-19 13:45:10
                      updateTime: 2026-10-19 13:45:11
```
