# Open virtual account

> Submit a request to open a virtual account for a user.

```yaml
openapi: 3.1.0
x-onerway-docs-version: original
x-onerway-spec-key: embedded-finance/virtual-accounts/open-virtual-account
info:
  title: Open virtual account
  version: original
  description: Submit a request to open a virtual account for a user.
servers:
  - url: https://sandbox-baas.onerway.com/embedded-finance
    description: sandbox
  - url: https://baas.onerway.com
    description: production
paths:
  /api/v2/virtual-account/open:
    post:
      summary: Open virtual account
      description: Submit a request to open a virtual account for a user.
      parameters:
        - name: apiKey
          in: header
          required: true
          description: API key assigned for Embedded Finance API access.
          schema:
            type: string
            description: API key assigned for Embedded Finance API access.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: integer
                  description: ID of the user for whom the virtual account is requested.
                bankCountry:
                  type: string
                  description: Country or region where the bank is located, as an ISO 3166-1
                    alpha-2 code.
                currencyCode:
                  type: string
                  description: Currency code of the virtual account to open.
              required:
                - userId
                - bankCountry
                - currencyCode
            examples:
              default:
                summary: Open virtual account
                value:
                  userId: 123456789
                  bankCountry: GB
                  currencyCode: GBP
      responses:
        "200":
          description: Virtual account opening request succeeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Response code returned by Onerway. `20000` indicates that the
                      request succeeded.
                  respMsg:
                    type: string
                    description: Human-readable response message.
                  data:
                    type: object
                    properties:
                      merchantNo:
                        type: string
                        description: Merchant number associated with the application.
                      userId:
                        type: integer
                        description: ID of the user for whom the virtual account was requested.
                      vaApplicationId:
                        type: integer
                        description: Virtual account application ID. Use this ID for virtual account
                          opening webhook notifications and account closure.
                    description: Virtual account application details returned for a successful
                      request.
              examples:
                success:
                  summary: Virtual account opening request succeeded
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      merchantNo: 800***
                      userId: 123456789
                      vaApplicationId: 987654321
      security:
        - apiKeyAuth:
            []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apiKey
```
