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

# Assign a new Virtual account for a currency

> Assigns a virtual account to a currency the customer is allowed to assign virtual accounts for. Only one Dedicated (virtual+segregated) account per currency is allowed.




## OpenAPI

````yaml /openapi/ebury-spec.json post /account-details/virtual/{currency}
openapi: 3.0.0
info:
  description: |
    Ebury API allows customers:
      to retrieve accounts, balances, beneficiaries, and transactions;
      to get buy/sell estimates and quotes, book trades and retrieve trade history;
      to allocate payments to a trade and beneficiary, and to submit payments in bulk;
      to download documents such as trade receipt, payment instruction and payment receipt;
      to manage the authorised persons on their account.
    The Metadata API allows applications to clarify some parts of the Ebury API
      that are impractical to express schematically.
  termsOfService: https://docs.ebury.io/#terms-of-use
  title: Ebury API
  version: '0.1'
servers:
  - url: https://{environment}.ebury.io
    variables:
      environment:
        default: api
        enum:
          - api
          - sandbox
security:
  - api_key: []
paths:
  /account-details/virtual/{currency}:
    post:
      tags:
        - Account details
      summary: Assign a new Virtual account for a currency
      description: >
        Assigns a virtual account to a currency the customer is allowed to
        assign virtual accounts for. Only one Dedicated (virtual+segregated)
        account per currency is allowed.
      parameters:
        - name: Authorization
          in: header
          description: The access token
          required: true
          schema:
            type: string
        - name: currency
          in: path
          description: Currency code of the Virtual account to assign
          required: true
          schema:
            type: string
        - name: client_id
          in: query
          description: ID of the client that owns the account
          required: true
          schema:
            type: string
            minLength: 1
      responses:
        '200':
          description: Virtual account assigned
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VirtualAccountDetails'
        '400':
          description: >-
            Formatting, parameter or schema validation error. See error message
            for further details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Access denied due to authentication failure
        '403':
          description: |
            Missing client_id
            Access token not valid for the requested client_id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '409':
          description: |
            Conflict assigning account (another one might already exist).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '429':
          description: Too many requests
components:
  schemas:
    VirtualAccountDetails:
      type: object
      properties:
        account_details_id:
          type: string
        account_details_type:
          type: string
        account_holder_address:
          type: string
        account_holder_name:
          type: string
        account_id:
          type: string
        alias:
          type: string
        country:
          type: string
        created:
          type: string
          format: date-time
        currency:
          type: string
        domestic:
          $ref: '#/components/schemas/DomesticDetails'
        international:
          $ref: '#/components/schemas/InternationalDetails'
        financial_institution_address:
          type: string
        financial_institution_name:
          type: string
        modified:
          type: string
          format: date-time
        primary:
          type: boolean
        status:
          type: string
    ErrorMessage:
      description: An error message.
      properties:
        code:
          type: string
          description: The code for the error.
        details:
          description: Error details
          type: string
        message:
          type: string
          description: A short description of the cause of the error.
      required:
        - code
        - message
        - details
      type: object
    DomesticDetails:
      type: object
      properties:
        account_number:
          type: string
        account_number_type:
          type: string
        bank_identifier:
          type: string
        bank_identifier_type:
          type: string
    InternationalDetails:
      type: object
      properties:
        account_number:
          type: string
        account_number_type:
          type: string
        bank_identifier:
          type: string
        bank_identifier_type:
          type: string
  securitySchemes:
    api_key:
      description: An API Key.
      in: header
      name: x-api-key
      type: apiKey

````