> ## 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/paymentOrderPay
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/paymentOrderPay:
    post:
      tags:
        - 付款
      summary: 申请付款
      operationId: post-api-mapi-paymentOrderPay
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentOrderPayRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentOrderPayResponse'
              examples:
                success:
                  summary: 成功示例
                  value:
                    msg: Success.
                    code: '00000000'
                    data:
                      tradeNo: 20220429052556PO71330000270184
                      outTradeNo: ORDER123456
                      status: success
                error1:
                  summary: 异常示例
                  value:
                    msg: The payment account info format is incorrect.
                    code: PARAMS_INVALID
                error2:
                  summary: 异常示例2
                  value:
                    msg: The targetOrg is incorrect.
                    code: PARAMS_INVALID
      security:
        - signature: []
      servers:
        - url: https://mpgwpre.payallglobal.com/mp-gateway/
          description: 开发环境
        - url: https://mpgw.payallglobal.com/mp-gateway/
          description: 正式生产环境
components:
  schemas:
    PaymentOrderPayRequest:
      allOf:
        - $ref: '#/components/schemas/PayBaseRequest'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/PaymentOrderPayData'
          required:
            - data
    PaymentOrderPayResponse:
      type: object
      properties:
        code:
          type: string
          description: 返回码，00000000代表成功。只代表接口请求成功，不代表订单状态。
          example: '00000000'
        msg:
          type: string
          description: 返回描述，'Success'
          example: Success
        data:
          $ref: '#/components/schemas/PaymentOrderPayResponseData'
      required:
        - data
        - code
        - msg
    PayBaseRequest:
      type: object
      description: 支付查询基础请求对象
      properties:
        charset:
          type: string
          description: 交互数据的编码【utf-8】
          default: UTF-8
          example: utf-8
        memberId:
          type: string
          description: 机构号
          example: '2022000000008454'
        merchantId:
          type: string
          description: 商户号
          example: '2022000000008454'
        requestTime:
          type: string
          description: 请求时间（ISO 8601 格式，带时区）
          format: date-time
          example: '2025-10-24T15:00:00.500+08:00'
        signType:
          type: string
          description: 报文签名类型
          example: RSA
        transType:
          type: string
          description: 交易类型
          enum:
            - PAY
            - CREDIT_CARD
            - 3D_PREAUTH_VOIDS
            - 3D_PREAUTH_COMPLETION
            - REFUND
            - VOIDS
            - QUERY
            - TRANSFER
            - DOWNLOAD
            - REGISTRATION
            - FILEUPLOAD
            - INQUIRYREGISTRATIONSTATUS
            - AUTHORIZE
          example: PAY
        version:
          type: string
          description: 接口版本，当前版本为【2.0.0】,目前只能传2.0.0，不能不传
          example: 2.0.0
      required:
        - charset
        - outTradeNo
        - memberId
        - merchantId
        - requestTime
        - signType
        - transType
        - version
    PaymentOrderPayData:
      type: object
      properties:
        outTradeNo:
          type: string
          description: 商户订单号，唯一标识商户的一笔交易，不能重复，只能包含字母、数字、下划线
          maxLength: 63
          example: 394916B2ADFD4D6CAD6CC624C88990D0
        country:
          type: string
          description: 国家代码，大写字母，参见【支持的国家与币种】
          maxLength: 2
          example: ID
        chargeOption:
          type: string
          description: 费用承担模式，是否必传参照《付款申请模板及填写规范》
          example: ''
        clearingRail:
          type: string
          description: 枚举值为：SWIFT, SEPA, LOCAL，分别对应签约的SWIFT、SEPA、Local Banks支付方式
          example: LOCAL
        userId:
          type: string
          description: 商户内部的用户Id，需保证每个ID唯一性
          maxLength: 64
          example: abc123456789
        sourceAccount:
          type: string
          description: 扣款账户的币种代码，大写字母
          maxLength: 3
          example: PHP
        destinationCurrency:
          type: string
          description: 指定到账币种，参考【支付方式列表】
          maxLength: 3
          example: PHP
        trade:
          $ref: '#/components/schemas/TradeInfo'
        payeeInfo:
          $ref: '#/components/schemas/PayeeInfo'
        payerInfo:
          $ref: '#/components/schemas/PayerInfo'
        expiryDays:
          type: string
          description: 取款码有效天数，当前仅在FawryCash中有效，支持传入1~15整数
          example: '3'
        remark:
          type: string
          description: 出款附言或备注，允许英文，数字，中划线，空格，点
          example: this is remark
        reference:
          type: string
          description: 透传数据，在付款异步回调通知中原样返回
          maxLength: 255
          example: this is reference
        notifyUrl:
          type: string
          description: 商户接收付款结果的后台回调地址，以http/https开头
          maxLength: 255
          example: http://example.com/callback/
        notifyEmail:
          type: string
          description: 收款方通知邮箱，目前只有个别支付方式会发送取款码邮件
          maxLength: 64
          example: example@gmail.com
        notifyPhone:
          type: string
          description: 收款方通知电话
          maxLength: 64
          example: ''
        purpose:
          type: string
          description: >-
            出款目的，枚举值：ISUBIL, EPTOUR, EPTKAG, ISPAYR, ISPAYRA, ISGDDS, ISSCVE,
            ISSUPP, ISLOGS, INCEN, GAME, SAMENM, PAYCMSN, SAMENMC, AGOPEXP,
            ADEXP, RFND, SMCNTST, LGTEP, GOODPAY, SINVEST, FINVEST, TAXPAY,
            LOANPAY, OTHER
          maxLength: 32
          example: GAME
      required:
        - outTradeNo
        - trade
        - payeeInfo
        - country
        - sourceAccount
        - destinationCurrency
    PaymentOrderPayResponseData:
      type: object
      properties:
        outTradeNo:
          type: string
          description: 商户订单号
          example: ORDER123456
        tradeNo:
          type: string
          description: payallglobal交易流水号
          example: 20220429052556PO71330000270184
        status:
          type: string
          description: 交易状态
          example: success
          enum:
            - success
            - fail
            - pending
      required:
        - outTradeNo
        - tradeNo
        - status
      description: 返回数据体
    TradeInfo:
      type: object
      properties:
        amount:
          type: string
          description: 交易金额，按照各国币种支持的小数点位上送
          maxLength: 12
          example: '100'
        currency:
          type: string
          description: 交易币种，大写字母
          maxLength: 3
          example: IDR
      required:
        - amount
        - currency
      description: 交易信息
    PayeeInfo:
      type: object
      properties:
        paymentMethodType:
          type: string
          description: 支付方式，参考【支付方式列表】
          maxLength: 64
          example: WALLET
        targetOrg:
          type: string
          description: 目标机构
          maxLength: 64
          example: DANA
        payeeType:
          type: string
          description: 收款方类型（PERSONAL/CORPORATION），默认PERSONAL
          example: PERSONAL
        accountInfo:
          $ref: '#/components/schemas/AccountInfo'
        bankInfo:
          $ref: '#/components/schemas/BankInfo'
        name:
          $ref: '#/components/schemas/NameInfo'
        document:
          $ref: '#/components/schemas/DocumentInfo'
        address:
          $ref: '#/components/schemas/AddressInfo'
        payeePhone:
          type: string
          description: 收款方移动电话号码
          maxLength: 64
          example: '08123456789'
        birthDate:
          type: string
          description: 收款方出生日期，yyyy-MM-dd格式
          maxLength: 10
          example: '1996-09-01'
        email:
          type: string
          description: 收款方邮箱
          maxLength: 64
          example: example@gmail.com
      required:
        - paymentMethodType
        - accountInfo
      description: 收款方信息
    PayerInfo:
      type: object
      properties:
        subMerchantNo:
          type: string
          description: 子商户号，子商户在系统中的唯一标识
          maxLength: 64
          example: ''
        businessLegalName:
          type: string
          description: 付款公司主体注册名
          maxLength: 70
          example: ''
        registrationCountry:
          type: string
          description: 付款公司主体注册国家，2位大写国家编码
          example: ''
        merchantCategoryCode:
          type: string
          description: >-
            付款公司行业分类，枚举值：DIGITAL_GOODS_MEDIA, DIGITAL_GOODS_APPLICATION,
            TRAVEL_AGENCIES_AND_TRAVEL_RELATED_SERVICES,
            COURIER_SERVICES_AIR_AND_GROUND_AND_FREIGHT_FORWARDERS,
            ADVERTISING_SERVICES, TELECOMMUNICATION_SERVICE,
            COMPUTER_NETWORKS_AND_INFORMATION_SERVICES,
            MISCELLANEOUS_GENERAL_MERCHANDISE
          example: ''
        payerId:
          type: string
          description: 付款公司所属机构/平台商户号
          maxLength: 70
          example: ''
        name:
          $ref: '#/components/schemas/NameInfo'
      description: 付款方信息
    AccountInfo:
      type: object
      properties:
        accountNo:
          type: string
          description: 收款方账号，根据付款方式不同填入相应账号
          maxLength: 128
          example: '0812323233332'
        accountType:
          type: string
          description: 收款账户类型，在不同国家-支付方式下规范不同
          example: ''
        checkDigit:
          type: string
          description: 收款方账户验证数字
          example: ''
      required:
        - accountNo
      description: 收款账户信息
    BankInfo:
      type: object
      properties:
        bankCode:
          type: string
          description: 用于识别特定金融机构下的收款方银行代码
          maxLength: 64
          example: ''
        bankName:
          type: string
          description: 收款方银行名称
          maxLength: 255
          example: ''
        bankBranch:
          type: string
          description: 收款人银行网点号/分行号
          maxLength: 64
          example: ''
        bankCity:
          type: string
          description: 收款方银行所在城市
          maxLength: 255
          example: ''
        corAccountNo:
          type: string
          description: 收款方银行的代理账号
          maxLength: 128
          example: ''
      description: 收款方银行信息
    NameInfo:
      type: object
      properties:
        firstName:
          type: string
          description: 收款方名
          maxLength: 64
          example: James
        middleName:
          type: string
          description: 收款方中间名，多段中间名时，使用空格进行分隔
          maxLength: 64
          example: Shri Williams
        lastName:
          type: string
          description: 收款方姓
          maxLength: 64
          example: Kanta
        fullName:
          type: string
          description: 收款方全名
          maxLength: 512
          example: James Shri Williams Kanta
      description: 收款方姓名
    DocumentInfo:
      type: object
      properties:
        documentType:
          type: string
          description: 收款方个人身份证明类型
          maxLength: 16
          example: ''
        documentId:
          type: string
          description: 收款方个人识别号码
          maxLength: 64
          example: ''
        documentIssueDate:
          type: string
          description: 收款方个人识别号码生效日期，yyyy-MM-dd格式
          maxLength: 10
          example: ''
        documentExpireDate:
          type: string
          description: 收款方个人识别号码失效日期，yyyy-MM-dd格式
          maxLength: 10
          example: ''
      description: 收款方个人身份信息
    AddressInfo:
      type: object
      properties:
        address:
          type: string
          description: 收款方地址
          maxLength: 512
          example: ''
        city:
          type: string
          description: 收款方城市
          maxLength: 255
          example: ''
        state:
          type: string
          description: 州
          maxLength: 255
          example: ''
        zipCode:
          type: string
          description: 收款方邮编
          maxLength: 32
          example: ''
      description: 收款方地址信息
  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

````