> ## 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 BRL. After successful user payment, the BRL 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

* [Brazil Payment Interface](/docs/en/api/version2/Brazil)
* [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/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
                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: '300'
              phone: '09230219312'
              email: 23423@qq.com
              name: test
              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: Channel 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
              example:
                status: '1'
                error: '00000000'
                msg: ''
                data:
                  orderId: M233323000059
                  orderNo: '6023071013539074'
                  payUrl: https://a.api-uat.php.com/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==
      deprecated: false
      security: []

````