# Create Virtual Account

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v0/merchant-virtual-account:
    post:
      summary: Create Virtual Account
      deprecated: false
      description: >-
        Use this API to create a new virtual account for a merchant. Provide
        customer details, expected collection amount, and an expiry time. Enkash
        will provision a virtual bank account that can receive payments up to
        the specified amount before the close-by time.
      tags:
        - Payment Gateway/APIs - Payment Gateway /E-Collect
      parameters:
        - name: Authorization
          in: header
          description: Token generated with your Access key and secret key
          required: true
          example: Bearer dhhbdwe8344r673rg
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantDetailId:
                  type: string
                  description: |
                    Merchant detail identifier
                customerId:
                  type: string
                  description: |
                    Customer identifier
                customerName:
                  type: string
                  description: |
                    Name of the customer
                customerEmail:
                  type: string
                  description: |
                    Email (regex validated)
                customerPhone:
                  type: string
                  description: |
                    Phone number
                tpvAccountNumber:
                  type: string
                  description: |
                    TPV bank account number
                tpvUpiHandle:
                  type: string
                  description: |
                    TPV UPI handle
                tpvIfscCode:
                  type: string
                  description: |
                    TPV IFSC code
                description:
                  type: string
                  description: |
                    Description/purpose
                notes:
                  type: object
                  properties:
                    additionalProp1:
                      type: string
                    additionalProp2:
                      type: string
                    additionalProp3:
                      type: string
                  x-apidog-orders:
                    - additionalProp1
                    - additionalProp2
                    - additionalProp3
                  required:
                    - additionalProp1
                    - additionalProp2
                    - additionalProp3
                  description: |
                    Key-value metadata
                  nullable: true
                expectedAmount:
                  type: integer
                  description: |
                    Expected collection amount
                closeBy:
                  type: string
                  description: |-
                    Expiry date-time 
                    Format: yyyy-MM-dd HH:mm:ss
                customerReferenceId:
                  type: string
                  description: Exact match on merchant reference
              required:
                - merchantDetailId
                - customerId
                - customerName
                - customerEmail
                - customerPhone
                - description
                - expectedAmount
                - closeBy
                - customerReferenceId
              x-apidog-orders:
                - merchantDetailId
                - customerReferenceId
                - customerId
                - customerName
                - customerEmail
                - customerPhone
                - tpvAccountNumber
                - tpvUpiHandle
                - tpvIfscCode
                - description
                - notes
                - expectedAmount
                - closeBy
            examples:
              '1':
                value:
                  merchantDetailId: MD345EFDHFHSB
                  customerReferenceId: CUST7625367
                  customerId: cust_001
                  customerName: Emmett Sawayn
                  customerEmail: Claire20@gmail.com
                  customerPhone: '9876543210'
                  description: Monthly rent
                  notes:
                    key1: value1
                  expectedAmount: 5000
                  closeBy: '2026-06-01 23:59:59'
                summary: Example (Normal UseCase)
              '2':
                value:
                  merchantDetailId: MD345EFDHFHSB
                  customerReferenceId: CUST7625367
                  customerId: cust_001
                  customerName: Emmett Sawayn
                  customerEmail: Claire20@gmail.com
                  customerPhone: '9876543210'
                  tpvAccountNumber: '1234567890123'
                  tpvUpiHandle: john@upi
                  tpvIfscCode: SBIN0001234
                  description: Monthly rent
                  notes:
                    key1: value1
                  expectedAmount: 5000
                  closeBy: '2026-06-01 23:59:59'
                summary: Example (TPV UseCase)
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  response_code:
                    type: integer
                    description: Application-level status code
                  response_message:
                    type: string
                    description: High-level status description.
                  payload:
                    type: object
                    properties:
                      virtualAccountId:
                        type: string
                      merchantDetailId:
                        type: string
                      customerId:
                        type: string
                      customerName:
                        type: string
                      customerEmail:
                        type: string
                      customerPhone:
                        type: string
                      virtualAccountNumber:
                        type: string
                      virtualAccountIfscCode:
                        type: string
                      bankName:
                        type: string
                      customerAccountNumber:
                        type: string
                      customerUpiHandle:
                        type: string
                      customerIfscCode:
                        type: string
                      status:
                        type: string
                        enum:
                          - ACTIVE
                          - CLOSED
                        x-apidog-enum:
                          - value: ACTIVE
                            name: ''
                            description: ''
                          - value: CLOSED
                            name: ''
                            description: ''
                      closedOn:
                        type: string
                      description:
                        type: string
                      amountPaid:
                        type: integer
                      notes:
                        type: object
                        properties:
                          key1:
                            type: string
                          key2:
                            type: string
                        required:
                          - key1
                          - key2
                        x-apidog-orders:
                          - key1
                          - key2
                      expectedAmount:
                        type: integer
                    required:
                      - virtualAccountId
                      - merchantDetailId
                      - customerId
                      - customerName
                      - customerEmail
                      - customerPhone
                      - virtualAccountNumber
                      - virtualAccountIfscCode
                      - bankName
                      - customerAccountNumber
                      - customerUpiHandle
                      - customerIfscCode
                      - status
                      - closedOn
                      - description
                      - amountPaid
                      - notes
                      - expectedAmount
                    x-apidog-orders:
                      - virtualAccountId
                      - merchantDetailId
                      - customerId
                      - customerName
                      - customerEmail
                      - customerPhone
                      - virtualAccountNumber
                      - virtualAccountIfscCode
                      - bankName
                      - customerAccountNumber
                      - customerUpiHandle
                      - customerIfscCode
                      - status
                      - closedOn
                      - description
                      - amountPaid
                      - notes
                      - expectedAmount
                    description: Contains Virtual Account related response data.
                required:
                  - response_code
                  - response_message
                  - payload
                x-apidog-orders:
                  - response_code
                  - response_message
                  - payload
              example:
                response_code: 0
                response_message: SUCCESS
                payload:
                  virtualAccountId: va_abc123
                  merchantDetailId: mdt_abc123
                  customerId: cust_001
                  customerName: John Doe
                  customerEmail: john@example.com
                  customerPhone: '9876543210'
                  virtualAccountNumber: VA00001234
                  virtualAccountIfscCode: RATN0VAAPIS
                  bankName: RBL Bank
                  customerAccountNumber: '9876543210123'
                  customerUpiHandle: john@upi
                  customerIfscCode: SBIN0001234
                  status: ACTIVE
                  closedOn: '2026-06-01 23:59:59'
                  description: Monthly rent
                  amountPaid: 3000
                  notes:
                    key1: value1
                    key2: value2
                  expectedAmount: 5000
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: Payment Gateway/APIs - Payment Gateway /E-Collect
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/616243/apis/api-36240387-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://ekpayout-uat.enkash.in
    description: Testing Env
security: []

```
