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

# Collection Application

> Use the appId corresponding to MXN. After successful user payment, the MXN balance will be increased.

<div class="flex flex-col gap-4">
  <div class="api-section-heading flex flex-col gap-y-4 w-full">
    <div class="flex items-baseline border-b pb-2.5 border-gray-100 dark:border-gray-800 w-full">
      <h4 class="api-section-heading-title flex-1 mb-0">Secret Key & Private Key (Generate Signature)</h4>
    </div>

    <div />
  </div>

  <input id="secret-key" placeholder="Secret Key" class="px-3 py-2 border rounded-md" />

  <input id="private-key" placeholder="Private Key" class="px-3 py-2 border rounded-md" />
</div>

## Related Topics

* [Mexico Payment API](/docs/en/api/version2/Mexico)
* [HaiPay API Reference Overview](/docs/en/api-reference/overview)
* [HaiPay Configuration and Signature Guide](/docs/en/guide/config_settings_and_signature_rules_guide)


## OpenAPI

````yaml docs/en/V20260701/api-reference/mxn/mxn.openapi.json POST /mxn/collect/apply
openapi: 3.0.1
info:
  title: 默认模块
  description: ''
  version: 1.0.0
servers:
  - url: https://uat-interface.haipay.asia
    description: 测试-interface
security: []
tags: []
paths:
  /mxn/collect/apply:
    post:
      tags: []
      summary: MXN Collection Application
      description: >-
        Use the appId corresponding to MXN. After successful user payment, the
        MXN balance will be increased.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                appId:
                  type: integer
                  description: >-
                    Business ID (obtained from the backend, must correspond to
                    the currency in the URL)
                orderId:
                  type: string
                  description: Merchant Order Number
                  maxLength: 48
                name:
                  type: string
                  description: >-
                    Payer's Name (format: English letters, spaces allowed, 1–30
                    characters, "firstName middleName lastName"; middleName
                    optional; special characters allowed: '.-)
                  minLength: 1
                  maxLength: 30
                  pattern: ^[A-Za-z\s'.\-]+$
                phone:
                  type: string
                  description: Valid phone number
                email:
                  type: string
                  description: Valid email address
                  format: email
                amount:
                  type: string
                  description: >-
                    Transaction Amount (unit: Mex$, precise to two decimal
                    places; do not use punctuation such as ",")
                  pattern: ^\d+\.\d{2}$
                payType:
                  type: string
                  description: 'Payment Method: QR (Barcode Payment) or VA (Virtual Account)'
                  enum:
                    - QR
                    - VA
                inBankCode:
                  type: string
                  description: >-
                    Collection Code. When payType is QR, inBankCode supports:
                    OXXO, CASH payment methods; when payType is VA, inBankCode
                    is CLABE
                callBackUrl:
                  type: string
                  description: Redirect URL after successful payment
                  format: uri
                callBackFailUrl:
                  type: string
                  description: Redirect URL after failed payment
                  format: uri
                cancelUrl:
                  type: string
                  description: >-
                    Cancel payment redirect URL. If provided, users can click
                    back on the payment page and be redirected to this URL
                  format: uri
                notifyUrl:
                  type: string
                  description: Callback URL
                  format: uri
                subject:
                  type: string
                  description: >-
                    Payment Note (transaction title, product name, payment
                    reason)
                body:
                  type: string
                  description: Additional Details
                partnerUserId:
                  type: string
                  description: >-
                    Unique User Identifier (e.g., userId), used for risk
                    control. Must be valid; otherwise, the transaction may be
                    affected. Allowed format: numbers, letters, or common
                    symbols -~!@#$%&*()_.
                  pattern: ^[A-Za-z0-9\-~!@#$%&*()_]+$
                sign:
                  type: string
                  description: Signature
              required:
                - appId
                - orderId
                - name
                - phone
                - email
                - amount
                - payType
                - inBankCode
                - callBackUrl
                - callBackFailUrl
                - partnerUserId
                - sign
            examples:
              '1':
                value:
                  amount: '20.00'
                  callBackFailUrl: https://www.example.com/failed
                  payType: QR
                  callBackUrl: https://www.example.com/success
                  inBankCode: CASH
                  orderId: SINGLE_1763358741905
                  phone: '1234567890'
                  appId: '4755'
                  name: TEST NAME
                  partnerUserId: dfff@fg43123
                  sign: >-
                    Si8+iTS7zZ4oX1bMCZ9PPFoJwgw9mGEwMc1UIADOrbs7xlCL+f5e+OYcvhKa4HXCxybqu6MTft6t6Smy9gvu8bPw/erwHdKbP/QzRDU5qHfMj9+1IZzZvJQJR/i5/TW9Y+L4xkOOsaTXfEYuDsZTjyNqy/si5EbUgl1CzVMuH3BORpB7H2f0P34RHqt8t5SZet7YfZLs+dcriczmqHAKhILHgIc7VHSfiAna00J2KjM93qO6kXa8LIjw7FVbX5f6ZMOUjrl13M3DDx01qSW0JVCSxRqEN9yTYTPMV8eFCSk+Picr78/vyMEKnRjnccUx4OZy1cK/9rIfi538xTEAbQ==
                  email: test.single@example.com
                summary: QR支付
              '2':
                value:
                  appId: '4755'
                  orderId: VA_1763358741905
                  payType: VA
                  inBankCode: CLABE
                  amount: '43.43'
                  name: Sofía López Martínez
                  email: test@example.com
                  callBackUrl: https://www.example.com/success
                  callBackFailUrl: https://www.example.com/failed
                  partnerUserId: dfff@fg43123
                  sign: >-
                    hYNVZTSCTWeR8X0HfhQ2zxoCTeM5ilX8tElAaNbfGDNzjpklR6r/LQZQ/IEO6SQvAc7EdKnAObcBhOxoUvQbeUNy1o8xcp4TV8ZX32McBPbAB/fu+lPF2SbtahoFs3W5w4Gg3ZMa9nLsStP6m1qER7rfaBOBDmGjUIbwDXUaXYwhLKVepB4N9dmE/r9/kch3SKXkFD/2NlT7HgN4CSWKTr04dd7awgYZm6PFlL9U3F0ZvgCEJouNBezNu2fuVz1ylgPtsXTKn2xLgCekrvwG+9WmQPnQzUC5kVlyLGpKvyVK9EMgHHTfg/12Lu1fyxcqLY8Zm/RAU55lAs/kxLQvpQ==
                summary: VA支付示例
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: '1: Normal, 0: Exception'
                  error:
                    type: string
                    description: Error code
                  msg:
                    type: string
                    description: Error description
                  data:
                    type: object
                    properties:
                      orderId:
                        type: string
                        description: Merchant Order Number (must be unique)
                      orderNo:
                        type: string
                        description: Platform Order Number
                      payUrl:
                        type: string
                        description: >-
                          Payment URL (QR returns barcode payment URL, VA
                          returns CLABE virtual account payment URL)
                      bankCode:
                        type: string
                        description: Channel Code (QR returns barcode, VA returns CLABE)
                      qrCode:
                        type: string
                        description: >-
                          Barcode, returns the barcode number (only returned for
                          QR payment)
                      bankNo:
                        type: string
                        description: >-
                          CLABE Virtual Account Number (only returned for VA
                          payment)
                      bankUserName:
                        type: string
                        description: Account Name (only returned for VA payment)
                      sign:
                        type: string
                        description: Signature
              examples:
                '1':
                  summary: QR支付
                  value:
                    status: '1'
                    error: '00000000'
                    msg: ''
                    data:
                      orderId: SINGLE_1763358111905
                      orderNo: '2025111713522220822'
                      payUrl: >-
                        https://www.paycashglobal.com/formato.php?referencia=MTQ3MTMyNDEwMjQzNQ==&interno=1
                      bankCode: CASH
                      qrCode: '1471324102431'
                      sign: >-
                        mpcB0wfbvGpCSNbT8Gs+D4Tt1eMDqTgnuY6yVUAdemccC07nnWrxSPk4srHFXeoXpdWm+CKFh89rghU16kZq2pm9dw0jSlns0dj5c7sDO8Te0KMNGfleuQ+N/16sGZr/LE7MAWj6Z902ymiff6q+N1ljTfIDypHTztbGDpJvemZ9OkB2BCemsoAX6ukkXyZJPI+gkyJEDCPfOcWfXeNmdWOKxyXLOJEjIBno2oyZoDs3yJqkMtCyQW1cjgTTOQbnxgCjHV9YQ+OcLVdkFroC/HrP8p9c8qRICDX/NMEt4Z0Zo1eBV07rkebuY60+A1kSuD7axO0UxSq6BbXKjgNqyQ==
                '2':
                  summary: VA支付
                  value:
                    status: '1'
                    error: '00000000'
                    msg: ''
                    data:
                      orderId: VA_1763358741905
                      orderNo: '2025111713522220823'
                      payUrl: >-
                        https://checkout-mx.fusionpay.net?checkout=MjAyNTExMTQxMTAyNTIzNjM0OSZHVjE5ODkxNjY5MzI0MzEwNzczNzYmNjg0MTgwMjkyMDE5ODQ0MDAw
                      bankCode: CLABE
                      bankNo: '684180292019844000'
                      bankUserName: Sofía López Martínez
                      sign: >-
                        QwXUII9P895b0008Avsep0OqxuxuQai56vAP1ks1saVJnT/hIWiE9rM4i5uI1CQ0yGNGVkVV25evO+7MssalgWqQNr0tTE0RHCJ6nK0baNz680CHp4IFxLp5TV4OLlNpLfyTNxiYLu4TzsFQuOAsDyTzOH6LnBBLC+syn1S8r4OkkcxrjDnonPc6E4wPZyJouiXe7+cxvSWxl+QSn8dXudxBVddhhTbiwJb2+ATZTDDMmeD7BlU9e8x8IKlR9j7l9Xa4hGU/GRvBqNAIhHXiQVldIlOP1I5L9Ez78kty8dyB2+YIgm5q2gRyl+XotAlOjq8cWti4dau1B7gi3bfqtw==
          headers: {}
      deprecated: false
      security: []

````