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

# Generate Dynamic Virtual Account

> Generates a dynamic (one-time) NGN virtual account. If an active dynamic account already exists and hasn't expired, it will be returned instead.

Generate a dynamic (one-time) NGN virtual account for your business. If an active dynamic account already exists and hasn't expired, it will be returned instead of creating a new one.

## Example Request

```bash theme={null}
curl -X POST "https://api.rolla.xyz/api/v1/external/wallet/virtual-accounts/generate/dynamic" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 500000 }'
```

## Request Body

| Parameter | Type   | Required | Description                                                                |
| --------- | ------ | -------- | -------------------------------------------------------------------------- |
| `amount`  | number | No       | Expected deposit amount in kobo. Recommended for amount-specific accounts. |

## Example Response

```json theme={null}
{
  "status": 201,
  "success": true,
  "message": "Dynamic virtual account generated successfully",
  "data": {
    "virtualAccount": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "status": "active",
      "virtual_account_type": "dynamic",
      "currency_type": "fiat",
      "bank_name": "VFD MFB",
      "account_number": "1234567890",
      "account_name": "Rolla / Your Business Name",
      "expires_at": "2024-01-16T10:30:00.000Z"
    }
  }
}
```

<Note>
  Dynamic virtual accounts expire after a set period. Always check `expires_at` and generate a new one if the account has expired. Passing an `amount` pre-configures the account for that exact deposit.
</Note>

<Warning>
  Only NGN is currently supported for dynamic virtual account generation.
</Warning>


## OpenAPI

````yaml POST /wallet/virtual-accounts/generate/dynamic
openapi: 3.1.0
info:
  title: Rolla Developer API
  description: >-
    API for programmatic transaction management on the Rolla platform. Monetary
    `amount` fields use the smallest unit of the referenced currency unless an
    endpoint says otherwise (e.g. NGN = kobo, USD = cents, where **100 cents =
    USD 1.00**).
  version: 1.0.0
servers:
  - url: https://api.rolla.xyz/api/v1/external
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /wallet/virtual-accounts/generate/dynamic:
    post:
      summary: Generate Dynamic Virtual Account
      description: >-
        Generates a dynamic (one-time) NGN virtual account. If an active dynamic
        account already exists and hasn't expired, it will be returned instead.
      operationId: generateDynamicVirtualAccount
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  example: 500000
                  description: >-
                    Expected deposit amount in kobo. Recommended for
                    amount-specific accounts.
      responses:
        '201':
          description: Dynamic virtual account generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 201
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Dynamic virtual account generated successfully
                  virtualAccount:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      status:
                        type: string
                        example: active
                      virtual_account_type:
                        type: string
                        example: dynamic
                      currency_type:
                        type: string
                        example: fiat
                      bank_name:
                        type: string
                        example: VFD MFB
                      account_number:
                        type: string
                        example: '1234567890'
                      account_name:
                        type: string
                        example: Rolla / Your Business Name
                      expires_at:
                        type: string
                        format: date-time
                        nullable: true
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Rolla API key

````