> For the complete documentation index, see [llms.txt](https://docs.paystation.ng/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.paystation.ng/api-reference/create-virtual-account.md).

# Create virtual account

Create a persistent NGN virtual account for a new or existing merchant customer.

```http
POST /virtual-accounts
```

Required scope: `payments:write`

## Headers

```http
Accept: application/json
Content-Type: application/json
Authorization: Bearer PSN_sk_your_secret_key
Idempotency-Key: unique-operation-key
```

## Request using customer details

| Field                | Type   | Required | Description                                             |
| -------------------- | ------ | -------- | ------------------------------------------------------- |
| `customer_reference` | string | No       | Your unique customer identifier; maximum 190 characters |
| `first_name`         | string | Yes      | Customer first name; maximum 100 characters             |
| `last_name`          | string | Yes      | Customer last name; maximum 100 characters              |
| `email`              | email  | Yes      | Customer email address                                  |
| `phone`              | string | Yes      | Customer phone number; maximum 30 characters            |

```json
{
  "customer_reference": "CUS-1001",
  "first_name": "Ibrahim",
  "last_name": "Musa",
  "email": "ibrahim@example.com",
  "phone": "08012345678"
}
```

## Request using an existing customer

Send the customer's Pay Station UUID as `customer_id`. The customer must belong to the authenticated merchant and be active.

```json
{
  "customer_id": "af76ad86-cf0d-4d34-b6c6-ea683b86f110"
}
```

## Created response — `201 Created`

```json
{
  "status": true,
  "message": "Virtual account created successfully.",
  "data": {
    "reference": "PSVA6G4QJ2M7C9T1K5H8",
    "account_number": "1234567890",
    "account_name": "IBRAHIM MUSA",
    "bank_name": "Paga",
    "bank_code": "327",
    "currency": "NGN",
    "provider": "paga",
    "status": "active"
  }
}
```

## Existing account — `200 OK`

When the customer already has a pending or active account for the selected provider, the existing account is returned with:

```json
{
  "status": true,
  "message": "Existing virtual account returned.",
  "data": {}
}
```

## Important errors

| Status | Meaning                                                 |
| ------ | ------------------------------------------------------- |
| `401`  | Invalid or expired API credential                       |
| `403`  | API or collection access unavailable, or missing scope  |
| `409`  | Idempotency key conflict or request still processing    |
| `422`  | Validation or confirmed provider error                  |
| `202`  | Provider outcome is uncertain and awaits reconciliation |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.paystation.ng/api-reference/create-virtual-account.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
