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

# Thailand — Collection Application (Legacy navigation V20260623)

> Historical version (V20260623): Thailand — Collection Application (Legacy navigation V20260623) (POST /thb/collect/apply): Use the appId corresponding to THB. After successful user payment, the THB 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

* [Thailand Payment API](https://doc.haipay.net/en/history/V20260623/api/version2/Thailand.md)
* [HaiPay API Reference Overview](https://doc.haipay.net/en/history/V20260623/api-reference/overview.md)
* [HaiPay Configuration and Signature Guide](https://doc.haipay.net/en/history/V20260623/guide/config_settings_and_signature_rules_guide.md)


## OpenAPI

````yaml docs/en/api-reference/thb/thb.openapi.json POST /thb/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:
  /thb/collect/apply:
    post:
      tags: []
      summary: THB Collection Application
      description: >-
        Use the appId corresponding to THB. After successful user payment, the
        THB balance will be increased.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                appId:
                  type: integer
                  description: >-
                    Business ID (obtained from backend, must pass the
                    corresponding business ID according to the currency in the
                    URL)
                orderId:
                  type: string
                  description: Merchant order number
                  maxLength: 48
                name:
                  type: string
                  description: >-
                    Payee name (format: English letters with spaces allowed,
                    1–30 characters, "firstName middleName lastName" (middleName
                    is optional, special characters allowed: !-))
                  minLength: 1
                  maxLength: 30
                  pattern: ^[A-Za-z\s!-]+$
                phone:
                  type: string
                  description: >-
                    Real mobile number (Format: starting with 0, 10 digits
                    total)
                email:
                  type: string
                  description: Real email
                  format: email
                amount:
                  type: string
                  description: >-
                    Transaction amount (unit: ฿, precise to two decimal places;
                    punctuation such as “,” is prohibited)
                  pattern: ^\d+\.\d{2}$
                payType:
                  type: string
                  description: Transaction type
                inBankCode:
                  type: string
                  description: ''
                callBackUrl:
                  type: string
                  description: Redirect URL after successful payment
                  format: uri
                callBackFailUrl:
                  type: string
                  description: Redirect URL after failed payment
                  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: Detailed note
                partnerUserId:
                  type: string
                  description: >-
                    User unique identifier (e.g., userId). Used for risk
                    control. Must be valid, otherwise transaction may be
                    affected. 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
                - subject
                - partnerUserId
                - sign
              additionalProperties: false
            example:
              appId: 1054
              orderId: M233323000059
              name: Somchai Jaidee
              phone: '0812345678'
              email: somchai.jaidee@gmail.com
              amount: '2500.00'
              payType: ONLINE_BANKING
              inBankCode: PROMPTPAY
              callBackUrl: https://merchant.com/payment/success
              callBackFailUrl: https://merchant.com/payment/fail
              notifyUrl: https://merchant.com/api/notify
              subject: Payment for order
              body: Premium subscription
              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: >-
                          Returns repayment URL, otherwise returns a guide or
                          details
                      bankNo:
                        type: string
                        description: Repayment account number (VA)
                      bankCode:
                        type: string
                        description: Payment method code (VA)
                      qrCode:
                        type: string
                        description: >-
                          QR code content - can be used to generate QR code
                          manually (QR)
                      sign:
                        type: string
                        description: Signature
                    additionalProperties: true
                    description: 业务数据
                additionalProperties: false
              examples:
                success:
                  summary: Success
                  value:
                    status: '1'
                    error: '00000000'
                    msg: success
                    data:
                      orderId: M233323000059
                      orderNo: '6023071013539074'
                      payUrl: https://pay.haipay.asia/cashier/1L9zQS2
                      bankNo: PC0007I10000035
                      bankCode: PIX
                      qrCode: 00020101021228760011ph.ppmi.p2m
                      sign: >-
                        af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==
                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.