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

# Brazil — Collection Application

> Brazil — Collection Application (POST /brl/collect/apply): Use the appId corresponding to BRL. After successful user payment, the BRL 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

* [Brazil Payment Interface](https://doc.haipay.net/en/history/V20260701/payments/local/brazil.md)
* [HaiPay API Reference Overview](https://doc.haipay.net/en/history/V20260701/api-reference/overview.md)
* [HaiPay Configuration and Signature Guide](https://doc.haipay.net/en/history/V20260701/guide/config_settings_and_signature_rules_guide.md)
* [Brazil — Collection Query (POST /brl/collect/query)](https://doc.haipay.net/en/history/V20260701/api-reference/brl/api/collectQuery.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/history/V20260701/guide/error_response_appendix.md)
* [Look Up Collection Payment Types and Codes (payType)](https://doc.haipay.net/en/history/V20260701/resources/cashin-code-list.md)


## OpenAPI

````yaml docs/en/V20260701/api-reference/brl/brl.openapi.json POST /brl/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:
  /brl/collect/apply:
    post:
      tags: []
      summary: BRL Collection Application
      description: >-
        Use the appId corresponding to BRL. After successful user payment, the
        BRL balance will be increased.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                appId:
                  type: integer
                  description: >-
                    Business ID (obtained from the backend, needs to be passed
                    according 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, case-sensitive, and
                    spaces allowed, 1-30 characters, "firstName middleName
                    lastName" (middleName is optional), special characters !-
                    are supported)
                  minLength: 1
                  maxLength: 30
                  pattern: ^[A-Za-z\s!-]+$
                phone:
                  type: string
                  description: Real phone number
                email:
                  type: string
                  description: Real email address
                  format: email
                amount:
                  type: string
                  description: >-
                    Transaction amount (unit: Brazilian Real, accurate to two
                    decimal places; do not include punctuation such as commas)
                    Range: 1-99999
                  pattern: ^(?:[1-9]\d{0,4}|0)(?:\.\d{2})$
                payType:
                  type: string
                  description: ''
                inBankCode:
                  type: string
                  description: ''
                inBankNo:
                  type: string
                  description: CPF (11 digits only)
                  pattern: ^\d{11}$
                  minLength: 11
                  maxLength: 11
                callBackUrl:
                  type: string
                  description: Redirect URL after successful user payment
                  format: uri
                callBackFailUrl:
                  type: string
                  description: Redirect URL after failed user 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 remark (transaction title, product name, payment
                    reason)
                body:
                  type: string
                  description: Detailed remarks
                partnerUserId:
                  type: string
                  description: >-
                    Unique user identifier (e.g., userID), used for risk
                    control, must be valid; otherwise, it will affect the
                    transaction. Format: digits, uppercase and lowercase
                    letters, or common symbols such as -~!@#$%&*()_.
                  pattern: ^[A-Za-z0-9\-~!@#$%&*()_]+$
                sign:
                  type: string
                  description: Signature
              required:
                - appId
                - orderId
                - name
                - phone
                - email
                - amount
                - payType
                - inBankCode
                - callBackUrl
                - callBackFailUrl
                - partnerUserId
                - sign
            example:
              appId: 1054
              orderId: M233323000059
              amount: '250.00'
              phone: '11987654321'
              email: joao.silva@gmail.com
              name: João Silva Santos
              inBankCode: PIX
              payType: QR
              partnerUserId: '149597870'
              sign: >-
                af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==
        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: >-
                          The returned URL for repayment; otherwise, it returns
                          instructions or details
                      bankCode:
                        type: string
                        description: Payment method code (VA)
                      bankNo:
                        type: string
                        description: Repayment account number (VA)
                      qrCode:
                        type: string
                        description: QR code content – can generate QR code yourself (QR)
                      sign:
                        type: string
                        description: Signature
                    additionalProperties: false
                additionalProperties: false
              examples:
                success:
                  summary: Success
                  value:
                    status: '1'
                    error: '00000000'
                    msg: ''
                    data:
                      orderId: M233323000059
                      orderNo: '6023071013539074'
                      payUrl: https://pay.haipay.asia/cashier/1L9zQS2
                      bankCode: PIX
                      bankNo: PC0007I10000035
                      qrCode: >-
                        00020101021228760011ph.ppmi.p2m0111OPDVPHM1XXX0315777148000000017041652948137245442930503001520460165303608540810000.php
                        Of
                        Mandalu62310010ph.allbank05062110000803***88310012ph.ppmi.qrph0111OPDVPHM1XXX63042763
                      sign: >-
                        YEoA8Y2JzQFGVzwJSqmemm1Kfv/bfyIfCqv2dp7RNzT5B72AQvdD+nt2nR4sL1HWscvmNHyVt5ovAi7MMhy3ziih/sMph+wPx4YjH3W1h5DyBvSlWvaKfKrK5ViomZ0pPYWydwRHnnRnicxToHK9S6qtSy7Q73O0hdz4hJ9p41Th3ycBl2Q9SeqSZYSY1ohcPDhdyRf2y0prb8rHgpBKzxZ5BKX/1bsE9OmsSEHAEYT8OGgko6aNe8XPAhr4G48cpWTftvnGQuzh0O65nuZRI/PF+Axt2zJCVbFHDDSREI9NlAT82ebDqhlVdxQzKE67D1nxgjb3dPmDUYHOBpmwxQ==
                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
      deprecated: false
      security: []

````

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