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

# Create a virtual account

> Create a virtual account



## OpenAPI

````yaml Flutterwave_v4_Open_API.json post /virtual-accounts
openapi: 3.1.0
info:
  version: '1.0'
  title: Flutterwave APIs
  description: APIs for Enterprise Customers
  contact:
    name: Flutterwave
    email: hi@flutterwavego.com
servers:
  - url: https://developersandbox-api.flutterwave.com
    description: Dev server
security:
  - bearerAuth: []
paths:
  /virtual-accounts:
    post:
      tags:
        - Virtual-Accounts
      summary: Create a virtual account
      description: Create a virtual account
      operationId: virtual_accounts_post
      parameters:
        - $ref: '#/components/parameters/trace_id'
        - $ref: '#/components/parameters/idempotency_key'
        - $ref: '#/components/parameters/scenario_key'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/virtual_account_in'
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/status'
                  message:
                    type: string
                  data:
                    $ref: '#/components/schemas/virtual_account'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400'
        '401':
          description: Unauthorised request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/409'
components:
  parameters:
    trace_id:
      description: >-
        A unique identifier to track this operation. It must be between 12 and
        255 characters in length.
      in: header
      name: X-Trace-Id
      schema:
        type: string
        minLength: 12
        maxLength: 255
      example: acb123e4-f567-4a8b-9c0d-1e2f3a4b5c6d
    idempotency_key:
      description: >-
        A unique identifier to prevent duplicate requests. It must be between 12
        and 255 characters in length.
      in: header
      name: X-Idempotency-Key
      required: false
      schema:
        type: string
        minLength: 12
        maxLength: 255
      example: req-5c0a2e8c-f3b9-4d1a-8e2f-0c1d2e3f4a5b
    scenario_key:
      in: header
      name: X-Scenario-Key
      schema:
        type: string
        minimum: 1
        maximum: 1000
      description: >-
        An optional scenario key that can be used to simulate specific behaviors
        or test different scenarios within the API. Providing this header allows
        you to trigger predefined responses or alter data based on the key's
        value, which can be useful for testing, development, or demonstrating
        specific functionalities. The key should be a string of 1 to 1000
        characters.
      example: scenario:auth_redirect
  schemas:
    '400':
      description: Bad Request
      type: object
      properties:
        status:
          type: string
          nullable: false
          enum:
            - failed
        error:
          type: object
          properties:
            type:
              type: string
              example: REQUEST_NOT_VALID
            code:
              type: string
              example: '10400'
            message:
              type: string
              nullable: true
              example: Request is not valid
            validation_errors:
              type: array
              items:
                type: object
                properties:
                  field_name:
                    type: string
                    example: amount
                  message:
                    type: string
                    example: must not be null
          description: >-
            The request cannot be accepted and is malformed and/or missing
            required parameters.
    '401':
      description: Unauthorized
      type: object
      properties:
        status:
          type: string
          nullable: false
          enum:
            - failed
        message:
          type: string
          nullable: true
          description: Invalid API key provided
          example: UNAUTHORIZED
        error:
          type: object
          properties:
            type:
              type: string
              example: UNAUTHORIZED
            code:
              type: string
              example: '10401'
            message:
              type: string
              example: unauthorized
    '403':
      description: Forbidden
      type: object
      properties:
        status:
          type: string
          nullable: false
          enum:
            - failed
        message:
          type: string
          description: API key doesn't have permission to access this resource
        error:
          type: object
          properties:
            type:
              type: string
              example: FORBIDDEN
            code:
              type: string
              example: '10403'
            message:
              type: string
              example: Forbidden
    '409':
      description: Conflict
      type: object
      properties:
        status:
          type: string
          nullable: false
          enum:
            - failed
        message:
          type: string
          description: The request conflicts with another request
        error:
          type: object
          properties:
            type:
              type: string
              example: RESOURCE_CONFLICT
            code:
              type: string
              example: '10409'
            message:
              type: string
              example: Resource conflict
    virtual_account_in:
      type: object
      required:
        - customer_id
        - amount
        - reference
        - currency
        - account_type
      properties:
        reference:
          $ref: '#/components/schemas/reference'
        customer_id:
          type: string
          description: The customer id
          example: cus_J0PvwvJB2n
        amount:
          type: number
          description: The amount to be collected. Specify `0` for static accounts.
          example: 1000
          format: decimal
        expiry:
          type: integer
          minimum: 60
          maximum: 31536000
          description: The expiry time of the virtual account.
          example: 360
        currency:
          description: ISO 4217 currency code.
          example: NGN
          enum:
            - NGN
            - GHS
            - EGP
            - KES
        account_type:
          $ref: '#/components/schemas/pwbt_type'
        meta:
          $ref: '#/components/schemas/meta'
        narration:
          type: string
          description: This allows you specify the name shown when the account is resolved.
          example: James Burgers
        bvn:
          type: string
          description: This is the customer's Bank Verification Number.
          pattern: ^[1-9][0-9]{10}$
          x-pattern-message: >-
            bvn must be must be a positive or unsigned, non-zero number and must
            be 11 digits long
          example: '12345678912'
        nin:
          type: string
          description: This is the customer's National Identity Number.
          pattern: ^[1-9][0-9]{10}$
          x-pattern-message: >-
            nin must be a positive or unsigned, non-zero number and must be 11
            digits long
          example: '12345678912'
        customer_account_number:
          type: string
          description: >-
            This is the bank account the transfer will originate from. required
            for EGP and KES
          example: '123456789'
    status:
      type: string
      nullable: false
      enum:
        - success
        - failed
    virtual_account:
      type: object
      properties:
        id:
          type: string
          description: The virtual account ID.
          example: ''
        amount:
          type: number
          description: The amount to be collected. Specify `0` for static accounts.
          example: 1000
          format: decimal
        account_number:
          type: string
          description: The bank account number.
          example: '7824822527'
        reference:
          type: string
          description: >-
            A custom identifier to track the transaction, This must be unique
            across all your transactions.
          example: htuy68787hvhyff454
        account_bank_name:
          type: string
          description: The name of the bank.
          example: WEMA BANK
        account_type:
          $ref: '#/components/schemas/pwbt_type'
        status:
          $ref: '#/components/schemas/virtual_account_status'
        account_expiration_datetime:
          type: string,
          format: date-time
          description: The expiry date and time of the virtual account.
          example: '2025-12-03T13:54:21.546559974Z'
        note:
          type: string
          description: >-
            A message providing instructions for the bank transfer, which
            includes the narration provided in the request.
          example: Please make a bank transfer to James Burgers
        customer_id:
          type: string
          description: The ID of the customer.
          example: cus_J0PvwvJB2n
        created_datetime:
          type: string
          format: date-time
          description: The date and time when the virtual account was created..
          example: '2024-12-03T13:54:21.546559974Z'
        meta:
          $ref: '#/components/schemas/meta'
        customer_reference:
          type: string
          description: >-
            This is the reference the customer sends as narration when making
            the bank transfer
          example: AEGP2345
        currency:
          type: string
          description: ISO 4217 currency code.
          example: NGN
    reference:
      type: string
      pattern: ^[a-zA-Z0-9\-]+$
      minLength: 6
      maxLength: 42
      description: >-
        A custom identifier to track the transaction, This must be unique across
        all your transactions.
      x-pattern-message: must be an alphanumeric string
    pwbt_type:
      type: string
      description: The type of virtual account.
      example: static
      enum:
        - static
        - dynamic
    meta:
      type: object
      additionalProperties:
        type: string
    virtual_account_status:
      type: string
      description: The status of the virtual account.
      enum:
        - active
        - inactive
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````