> ## 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.

# Mexico — Collection Application

> Mexico — Collection Application (POST /mxn/collect/apply): Use the appId corresponding to MXN. After successful user payment, the MXN balance will be increased. Key request parameters include orderId, name, phone, email.

> [!NOTE]
>
> All example requests on this page are based on the **sandbox (test) environment**. Please be careful to distinguish it from the production environment.

#### Secret Key & Private Key (Generate Signature)

## Related Topics

* [Mexico Payment API](https://doc.haipay.net/en/payments/local/mexico.md)
* [HaiPay API Reference Overview](https://doc.haipay.net/en/api-reference/overview.md)
* [HaiPay Configuration and Signature Guide](https://doc.haipay.net/en/get-started/configuration-and-signatures.md)
* [Mexico — Collection Query (POST /mxn/collect/query)](https://doc.haipay.net/en/api-reference/mxn/collect-query.md)
* [Handle Asynchronous Notifications and Verify Signatures](https://doc.haipay.net/en/operations/callback.md)
* [Look Up API Response Structure and Error Codes](https://doc.haipay.net/en/resources/error-responses.md)
* [Look Up Collection Payment Types and Codes (payType)](https://doc.haipay.net/en/resources/cashin-code-list.md)


## 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:
              qr_payment:
                value:
                  amount: '20.00'
                  callBackFailUrl: https://shop.merchant.com/payment/failed
                  payType: QR
                  callBackUrl: https://shop.merchant.com/payment/success
                  inBankCode: CASH
                  orderId: ORD-20260914-00001
                  phone: '5512345678'
                  appId: '4755'
                  name: Carlos Mendoza Ruiz
                  partnerUserId: USER_830127
                  sign: >-
                    Si8+iTS7zZ4oX1bMCZ9PPFoJwgw9mGEwMc1UIADOrbs7xlCL+f5e+OYcvhKa4HXCxybqu6MTft6t6Smy9gvu8bPw/erwHdKbP/QzRDU5qHfMj9+1IZzZvJQJR/i5/TW9Y+L4xkOOsaTXfEYuDsZTjyNqy/si5EbUgl1CzVMuH3BORpB7H2f0P34RHqt8t5SZet7YfZLs+dcriczmqHAKhILHgIc7VHSfiAna00J2KjM93qO6kXa8LIjw7FVbX5f6ZMOUjrl13M3DDx01qSW0JVCSxRqEN9yTYTPMV8eFCSk+Picr78/vyMEKnRjnccUx4OZy1cK/9rIfi538xTEAbQ==
                  email: carlos.mendoza@gmail.com
                summary: QR payment
              va_payment:
                value:
                  appId: '4755'
                  orderId: ORD-20260914-00002
                  payType: VA
                  inBankCode: CLABE
                  amount: '43.43'
                  name: Sofía López Martínez
                  email: carlos.mendoza@gmail.com
                  callBackUrl: https://shop.merchant.com/payment/success
                  callBackFailUrl: https://shop.merchant.com/payment/failed
                  partnerUserId: USER_830127
                  sign: >-
                    hYNVZTSCTWeR8X0HfhQ2zxoCTeM5ilX8tElAaNbfGDNzjpklR6r/LQZQ/IEO6SQvAc7EdKnAObcBhOxoUvQbeUNy1o8xcp4TV8ZX32McBPbAB/fu+lPF2SbtahoFs3W5w4Gg3ZMa9nLsStP6m1qER7rfaBOBDmGjUIbwDXUaXYwhLKVepB4N9dmE/r9/kch3SKXkFD/2NlT7HgN4CSWKTr04dd7awgYZm6PFlL9U3F0ZvgCEJouNBezNu2fuVz1ylgPtsXTKn2xLgCekrvwG+9WmQPnQzUC5kVlyLGpKvyVK9EMgHHTfg/12Lu1fyxcqLY8Zm/RAU55lAs/kxLQvpQ==
                summary: VA payment example
        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: >-
                          Payment method 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:
                qr_payment:
                  summary: QR payment
                  value:
                    status: '1'
                    error: '00000000'
                    msg: ''
                    data:
                      orderId: ORD-20260914-00003
                      orderNo: '2025111713522220822'
                      payUrl: https://pay.haipay.asia/cashier/1L9zQS2
                      bankCode: CASH
                      qrCode: '1471324102431'
                      sign: >-
                        mpcB0wfbvGpCSNbT8Gs+D4Tt1eMDqTgnuY6yVUAdemccC07nnWrxSPk4srHFXeoXpdWm+CKFh89rghU16kZq2pm9dw0jSlns0dj5c7sDO8Te0KMNGfleuQ+N/16sGZr/LE7MAWj6Z902ymiff6q+N1ljTfIDypHTztbGDpJvemZ9OkB2BCemsoAX6ukkXyZJPI+gkyJEDCPfOcWfXeNmdWOKxyXLOJEjIBno2oyZoDs3yJqkMtCyQW1cjgTTOQbnxgCjHV9YQ+OcLVdkFroC/HrP8p9c8qRICDX/NMEt4Z0Zo1eBV07rkebuY60+A1kSuD7axO0UxSq6BbXKjgNqyQ==
                va_payment:
                  summary: VA payment
                  value:
                    status: '1'
                    error: '00000000'
                    msg: ''
                    data:
                      orderId: ORD-20260914-00002
                      orderNo: '2025111713522220823'
                      payUrl: https://pay.haipay.asia/cashier/1L9zQS2
                      bankCode: CLABE
                      bankNo: '684180292019844000'
                      bankUserName: Sofía López Martínez
                      sign: >-
                        QwXUII9P895b0008Avsep0OqxuxuQai56vAP1ks1saVJnT/hIWiE9rM4i5uI1CQ0yGNGVkVV25evO+7MssalgWqQNr0tTE0RHCJ6nK0baNz680CHp4IFxLp5TV4OLlNpLfyTNxiYLu4TzsFQuOAsDyTzOH6LnBBLC+syn1S8r4OkkcxrjDnonPc6E4wPZyJouiXe7+cxvSWxl+QSn8dXudxBVddhhTbiwJb2+ATZTDDMmeD7BlU9e8x8IKlR9j7l9Xa4hGU/GRvBqNAIhHXiQVldIlOP1I5L9Ez78kty8dyB2+YIgm5q2gRyl+XotAlOjq8cWti4dau1B7gi3bfqtw==
                param_error:
                  summary: Parameter validation failed
                  value:
                    status: '0'
                    error: '1001'
                    msg: orderId can not blank
                    data: null
                sign_error:
                  summary: Signature error
                  value:
                    status: '0'
                    error: '1002'
                    msg: Invalid request signature
                    data: null
          headers: {}
      deprecated: false
      security: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.