# Create a Virtual Account (v2)

Creates a new virtual account with the specified payment type and currency. Virtual accounts provide unique account numbers that can be used to receive payments for customers. This endpoint returns HTTP 202 indicating the request has been accepted and is being processed. You will receive a [webhook notification](https://glomo-payments--45ac07.preview.redocly.app/api-documentation/webhooks/virtual-account) when the virtual account is activated.

Endpoint: POST /v2/virtual-accounts
Version: 1.0.0
Security: JWT

## Security:

  - `JWT` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `payment_type` (string, required)
    The type of payments this virtual account will accept. 'local' for domestic payments within the same country, 'swift' for cross-border payments.
    Enum: "local", "swift"

  - `currency` (string, required)
    The currency code in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format.
    Example: USD

## Response 202:

  - `202` (unknown)
    Virtual account creation request is accepted

## Response 202 fields (application/json):

  - `message` (string)
    Example: Virtual account creation request is accepted.

  - `data` (object)

  - `data.merchant_id` (string)
    Example: merch_694bb0289P4Cz

  - `data.status` (string)
    Enum: "pending"

## Response 400:

  - `400` (unknown)
    Bad request

## Response 400 fields (application/json):

  - `error` (string)
    Enum: "Bad Request"

  - `message` (string)
    Error message indicating which parameter was invalid
    Example: Missing Required parameters

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `error` (string)
    Example: Unauthorized

  - `message` (string)
    Example: Invalid or missing authentication token

## Response 409:

  - `409` (unknown)
    Conflict - Record already exists

## Response 409 fields (application/json):

  - `error` (string)
    Enum: "Duplicate record"

  - `message` (string)
    Virtual Account already exists
    Example: Virtual Account already exists

