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

* [Indonesia Payment API](/docs/en/api/version2/Indonesia)
* [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/idr/idr.openapi.json POST /idr/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:
  /idr/collect/apply:
    post:
      tags: []
      summary: IDR Collection Application
      description: >-
        Use the appId corresponding to IDR. After successful user payment, the
        IDR balance will be increased.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                appId:
                  type: integer
                  description: >-
                    Business ID (retrieved from the backend; must pass the
                    corresponding ID for the currency in the URL)
                orderId:
                  type: string
                  description: Merchant order ID
                  maxLength: 48
                name:
                  type: string
                  description: >-
                    Payer's name (Payer's name format: 1-30 characters, English
                    or Indonesian letters (case-insensitive), follows "firstName
                    middleName lastName" structure (middleName optional), allows
                    spaces and special characters !-))
                  minLength: 1
                  maxLength: 30
                  pattern: ^[A-Za-z\u0000-\u007F\s!-]+$
                phone:
                  type: string
                  description: Valid phone number
                  pattern: ^08[0-9]{8,11}$
                email:
                  type: string
                  description: Valid email
                  format: email
                amount:
                  type: string
                  description: 'Transaction amount (unit: **IDR**)'
                  pattern: ^[0-9]+$
                payType:
                  type: string
                  description: ''
                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
                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
                currency:
                  type: string
                  description: 'Currency (default: IDR)'
                  default: IDR
                subject:
                  type: string
                  description: >-
                    Payment remark (transaction title, product name, payment
                    reason)
                body:
                  type: string
                  description: Remark details
                partnerUserId:
                  type: string
                  description: >-
                    Unique user identifier (e.g., userId). Required for risk
                    control system. Must be valid, otherwise transactions 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
                - partnerUserId
                - sign
            examples: {}
        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 ID (must be unique)
                      orderNo:
                        type: string
                        description: Platform order ID
                      payUrl:
                        type: string
                        description: >-
                          Returned payment address, or instructions/details in
                          other scenarios
                      bankNo:
                        type: string
                        description: Collection account number (VA)
                      bankCode:
                        type: string
                        description: Collection bank code
                      qrCode:
                        type: string
                        description: QR code content (can be used to generate a QR code)
                      sign:
                        type: string
                        description: Signature
                    additionalProperties: true
                    description: ''
                additionalProperties: true
      deprecated: false
      security: []

````