> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payallglobal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 转账查询



## OpenAPI

````yaml post /api/mapi/v1/payments/open/api/transfer/query
openapi: 3.1.0
info:
  version: '1.0'
  title: PayAllGlobal开放平台接口文档
  summary: ''
  termsOfService: ''
  contact:
    name: 技术支持
    email: support@payallglobal.com
    url: ''
  license:
    url: https://www.apache.org/licenses/LICENSE-2.0.html
    name: Apache 2.0
servers:
  - url: https://mpgwpre.payallglobal.com/mp-gateway/
    description: 开发环境
  - url: https://mpgw.payallglobal.com/mp-gateway/
    description: 正式生产环境
security:
  - signature: []
tags:
  - name: 收单
  - name: 其他交易类型
  - name: 商户管理
  - name: 文件下载
  - name: 付款
paths:
  /api/mapi/v1/payments/open/api/transfer/query:
    post:
      tags:
        - 收单
      summary: 转账查询
      operationId: post-api-mapi-v1-payments-open-api-transfer-query
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransferQueryRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferResponse'
      security:
        - signature: []
      servers:
        - url: https://mpgwpre.payallglobal.com/mp-gateway/
          description: 开发环境
        - url: https://mpgw.payallglobal.com/mp-gateway/
          description: 正式生产环境
components:
  schemas:
    TransferQueryRequest:
      title: TransferQueryRequest
      allOf:
        - $ref: '#/components/schemas/BaseRequest'
        - type: object
          properties:
            merchantOrderId:
              type: string
            orderId:
              type: string
    TransferResponse:
      title: TransferResponse
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                orderId:
                  type: string
                  description: 订单号
                  examples:
                    - TR1654008732742455296
                merchantOrderId:
                  type: string
                  description: 商户订单号
                  examples:
                    - '20230105586637641001'
                merchantId:
                  type: string
                  description: 商户号
                  examples:
                    - '2023010558663764'
                currency:
                  type: string
                  description: >-
                    订单币种[ISO4217](https://www.iso.org/standard/46121.html)币种的字母码
                    eg. USD, CNY, EUR
                  examples:
                    - USD
                transferAmount:
                  type: string
                  description: 交易金额
                  examples:
                    - '100.01'
                payeeBankNumber:
                  type: string
                payeeBankName:
                  type: string
                payeeAccountNo:
                  type: string
                payeeAccountName:
                  type: string
                notifyUrl:
                  type: string
              required:
                - orderId
                - merchantOrderId
                - merchantId
                - currency
                - transferAmount
    BaseRequest:
      type: object
      properties:
        charset:
          type: string
          description: 交互数据的编码【utf-8】
          default: UTF-8
          examples:
            - UTF-8
        version:
          type: string
          description: "接口版本，当前版本为【2.0.0】,目前只能传2.0.0，不能不传\t"
          examples:
            - 2.0.0
        transType:
          type: string
          enum:
            - 'PAY: 消费支付'
            - 'CREDIT_CARD: 信用卡支付'
            - '3D_PREAUTH_VOIDS: 3D 预授权撤销'
            - '3D_PREAUTH_COMPLETION: 3D 预授权完成'
            - 'REFUND: 退款'
            - 'VOIDS: 撤销'
            - 'QUERY: 查询'
            - 'TRANSFER: 转账'
            - 'DOWNLOAD: 文件下载'
            - 'REGISTRATION: 商户注册'
            - 'FILEUPLOAD: 文件上传'
            - 'INQUIRYREGISTRATIONSTATUS: 查询注册状态'
            - 'AUTHORIZE: 授权'
            - 'CASHIER_PAY: 收银台支付'
          description: 交易类型
          default: PAY
        accessType:
          type: string
          description: 接口接入类型，固定为服务端到服务端(s2s)模式
          default: s2s
          examples:
            - s2s
        signType:
          type: string
          default: RSA
          description: 报文签名类型，当前支持RSA。
          examples:
            - RSA
        memberId:
          type: string
          description: 机构号，商户侧唯一标识
          examples:
            - '2023010558663764'
        merchantId:
          type: string
          description: 商户号，商户唯一标识
          examples:
            - '2023010558663764'
      required:
        - charset
        - version
        - transType
        - accessType
        - signType
        - memberId
        - merchantId
      x-examples:
        Example 1:
          charset: UTF-8
          version: 2.0.0
          transType: string
          accessType: PAY
          signType: RSA
          memberId: stringstri
          merchantId: stringstri
    BaseResponse:
      type: object
      properties:
        isSuccess:
          type: boolean
          description: "是否成功，true表示成功，false表示失败\t"
          examples:
            - true
        errCode:
          type: string
          description: "响应状态码，errCode为00000000表示响应成功，其他状态码表示响应失败。具体系统错误码可以参考系统错误码。\t"
          examples:
            - '00000003'
        errMessage:
          type: string
          description: "错误消息\t"
          examples:
            - 处理中
        status:
          type: string
          description: "订单状态(见补充说明)\t"
          examples:
            - PENDING：处理中
            - SUCCESS：成功
            - FAIL：失败
        traceId:
          type: string
          description: "请求消息唯一标识。traceId为本次调用产生的流水号，接口调用异常，可以提供此流水号用于排查问题。\t"
          examples:
            - 33fae7b7aed1233f
      required:
        - isSuccess
        - errCode
        - errMessage
        - status
        - traceId
      x-examples:
        Example 1:
          isSuccess: true
          errCode: '00000003'
          errMessage: 处理中
          status: PENDING
          traceId: 33fae7b7aed1233f
  securitySchemes:
    signature:
      type: apiKey
      description: >-
        Example: MIIEpQIBAAKCAQEA...（Base64编码的签名字符串）

        ## 加签

        加签是开放平台和商户对于交互消息完整性的校验。加签行为主要发生两个部分：

        1. 商户服务器端针对向PayAllGlobal开放平台发送的请求报文进行加签；

        2. PayAllGlobal开放平台针对通知商户的异步消息进行加签。

        PayAllGlobal平台要求使用 RSA 私钥进行加签， 使用 RSA 公钥进行验签。 因此，在以上两部分描述的交互中，
        存在商户公私钥、PayAllGlobal 公私钥，开发者需要使用商户私钥，对第一部分报文进行加签，使用 PayAllGlobal
        公钥对第二部分消息进行验签。

        ### 加签规则如下: 

        使用商户私钥对请求体进行 SHA256withRSA 签名后，再进行 Base64 编码的结果。

        1. 使用 商户私钥对待 `request.body` 进行签名（SHA256WithRSA 计算原始数据的SHA-256哈希值。
        使用私钥对哈希值进行签名，即使用私钥对哈希值进行RSA加密。此时得到的加密结果就是数字签名。）；

        ```java

        Signature signature = Signature.getInstance("SHA256withRSA");

        signature.initSign(privateKey);

        // 计算 SHA256withRSA 签名时，需要以 utf-8 的编码转换 byte 流，否则可能导致含中文参数的签名计算不正确

        signature.update(request.body);

        byte[] signedHash = signature.sign();

        ```

        2. 将加签内容进行 Base64 编码；

        ```java

        String signature = Base64.getEncoder().encodeToString(signedHash);


        ```

        3. 将编码后的内容放在请求头部 signature 参数中。

        注意，加签是对 request.body 进行签名，当查询等 request.body 为空时，则无需加签。
      name: signature
      in: header

````