> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payluk.ng/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate virtual account

> Generates a virtual account for a merchant customer (`merchant_user` role only). Requires the `customer-id` header.

Virtual accounts are **Nigerian-only**; a customer whose country is not Nigeria cannot generate one (dedicated or temporary) and receives a `403`.

For Nigerian customers, the kind of account depends on whether the customer has a BVN on file (set at [customer creation](/api-reference/merchant-customers/create-merchant-customer)):

- **Customer has a BVN** → a **dedicated**, permanent account is issued via Paystack. The response sets `dedicated: true` and has no `expiresIn`.
- **Customer has no BVN** → a **temporary** 24-hour account is issued via Safe Haven. The response sets `dedicated: false` and includes `expiresIn`.



## OpenAPI

````yaml openapi.json POST /v1/payment/virtual-account
openapi: 3.0.3
info:
  title: Payluk ThirdParty API
  version: 1.0.0
  description: >-
    Merchant / Business API for the Payluk escrow and payments platform.


    All routes are mounted under `/v1` and authenticated with a secret key.
    Every response uses the standard envelope `{ status, message, data }`.
  contact:
    name: Payluk Developer Support
    email: support@payluk.ng
    url: https://payluk.ng
servers:
  - url: https://staging.api.payluk.ng
    description: 'Staging: use sk_test_ keys here for safe testing'
  - url: https://api.payluk.ng
    description: 'Production: use sk_live_ keys'
security:
  - bearerAuth: []
tags:
  - name: Escrow
    description: Create and manage standard escrow payment links.
  - name: Milestone Escrow
    description: Escrows that release funds in parts as milestones are confirmed.
  - name: Vault Escrow
    description: >-
      Merchant-only pooled-stake escrows: customers stake from their wallets and
      the merchant declares the winner.
  - name: Categories
    description: Organise escrows into merchant-defined categories.
  - name: Merchant Customers
    description: Manage the buyers and sellers that transact under your merchant account.
  - name: Disputes
    description: Confirm deliveries, raise disputes and resolve them.
  - name: Payments
    description: Fund wallets and escrows, verify references and manage payout details.
  - name: Debit Cards
    description: List and remove customers' saved debit cards.
  - name: Crypto Whitelist
    description: Manage whitelisted crypto withdrawal addresses.
  - name: Misc
    description: Supporting reference data.
paths:
  /v1/payment/virtual-account:
    post:
      tags:
        - Payments
      summary: Generate virtual account
      description: >-
        Generates a virtual account for a merchant customer (`merchant_user`
        role only). Requires the `customer-id` header.


        Virtual accounts are **Nigerian-only**; a customer whose country is not
        Nigeria cannot generate one (dedicated or temporary) and receives a
        `403`.


        For Nigerian customers, the kind of account depends on whether the
        customer has a BVN on file (set at [customer
        creation](/api-reference/merchant-customers/create-merchant-customer)):


        - **Customer has a BVN** → a **dedicated**, permanent account is issued
        via Paystack. The response sets `dedicated: true` and has no
        `expiresIn`.

        - **Customer has no BVN** → a **temporary** 24-hour account is issued
        via Safe Haven. The response sets `dedicated: false` and includes
        `expiresIn`.
      operationId: generateVirtualAccount
      parameters:
        - $ref: '#/components/parameters/CustomerIdHeader'
      responses:
        '200':
          description: >-
            Virtual account generated. Dedicated (BVN on file) or temporary (no
            BVN).
          content:
            application/json:
              examples:
                dedicated:
                  summary: Dedicated account (customer has a BVN)
                  value:
                    status: 200
                    message: Virtual account generated successfully
                    data:
                      accountNumber: '9988776655'
                      bankCode: wema-bank
                      accountName: PAYLUK / ADA EZE
                      bank: Wema Bank
                      dedicated: true
                temporary:
                  summary: Temporary account (customer has no BVN)
                  value:
                    status: 200
                    message: Virtual account generated successfully
                    data:
                      accountNumber: '9988776655'
                      bankCode: '090286'
                      amount: 50000
                      accountName: PAYLUK / ADA EZE
                      bank: SAFE HAVEN SANDBOX BANK
                      expiresIn: in 24 hours
                      dedicated: false
        '403':
          description: Customer is not Nigerian. Virtual accounts are Nigerian-only.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                status: 403
                message: Virtual accounts are only available for Nigerian customers
                data: {}
        '500':
          description: Only merchant customers can generate temporary virtual accounts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                status: 500
                message: >-
                  Only merchant customers can generate temporally virtual
                  accounts
                data: {}
components:
  parameters:
    CustomerIdHeader:
      name: customer-id
      in: header
      required: true
      description: The merchant customer this request acts on behalf of.
      schema:
        type: string
      example: 665f1b2c9a1e4d0012ab3c01
  schemas:
    ApiError:
      type: object
      description: Standard error envelope.
      properties:
        status:
          type: integer
          example: 400
        message:
          type: string
          example: Action not allowed
        data:
          type: object
          example: {}
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your secret key as a Bearer token. The key prefix selects the
        environment: `sk_test_...` (test) or `sk_live_...` (live).

````