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

# Create virtual account

> Open a virtual bank account in a customer's name. Transfers into it are credited to the workspace.



## OpenAPI

````yaml /openapi.yaml post /v1/ramp/virtual-accounts
openapi: 3.1.0
info:
  title: Onstacks Backend API
  version: 0.1.0
  summary: >-
    Public API contract for workspace wallet, transfer, provider routing, API
    key, and webhook flows.
servers:
  - url: https://api.onstacks.io
security: []
tags:
  - name: Health
  - name: Workspace
  - name: Wallets
  - name: Transfers
  - name: Corridors
  - name: Providers
  - name: Quotes
  - name: Ramp
paths:
  /v1/ramp/virtual-accounts:
    post:
      tags:
        - Ramp
      summary: Create virtual account
      description: >-
        Open a virtual bank account in a customer's name. Transfers into it are
        credited to the workspace.
      parameters:
        - $ref: '#/components/parameters/EnvironmentQuery'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RampCreateVirtualAccountRequest'
      responses:
        '201':
          description: Virtual account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RampVirtualAccountResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - apiKeyBearer: []
components:
  parameters:
    EnvironmentQuery:
      in: query
      name: environment
      description: >-
        Environment scope for environment-partitioned resources. Defaults to
        `sandbox` when omitted.
      required: false
      schema:
        $ref: '#/components/schemas/EnvironmentScope'
  schemas:
    RampCreateVirtualAccountRequest:
      type: object
      required:
        - asset
        - account_name
      properties:
        asset:
          type: string
          example: NGN
        account_name:
          type: string
        identity:
          $ref: '#/components/schemas/RampResolveIdentityRequest'
          description: >-
            Identity of the account holder, verified before the account is
            opened.
        customer_reference:
          type: string
          description: Your identifier for the customer this account belongs to.
        metadata:
          type: object
          additionalProperties: true
    RampVirtualAccountResponse:
      type: object
      required:
        - data
        - error
        - request_id
      properties:
        data:
          $ref: '#/components/schemas/RampVirtualAccount'
        error:
          type: 'null'
        request_id:
          type: string
    ErrorEnvelope:
      type: object
      required:
        - data
        - error
        - request_id
      properties:
        data:
          type: 'null'
        error:
          $ref: '#/components/schemas/ApiError'
        request_id:
          type: string
    EnvironmentScope:
      type: string
      enum:
        - sandbox
        - live
      default: sandbox
    RampResolveIdentityRequest:
      type: object
      required:
        - country_code
        - id_number
      properties:
        country_code:
          type: string
          example: NG
        id_type:
          type: string
          example: bvn
          description: Identity scheme for the country. `bvn` for Nigeria.
        id_number:
          type: string
          description: Never stored or logged.
    RampVirtualAccount:
      type: object
      properties:
        id:
          type: string
        asset:
          type: string
          example: NGN
        status:
          type: string
          enum:
            - active
            - suspended
        account_name:
          type: string
        bank_name:
          type: string
        bank_account_number:
          type: string
        bank_account_name:
          type: string
        provider:
          type: string
        metadata:
          type: object
          additionalProperties: true
        created_at:
          type: string
          format: date-time
    ApiError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
  responses:
    ValidationError:
      description: Request payload is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Caller is not authenticated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    apiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Workspace API key. Send it as `Authorization: Bearer <api_key>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.