> For the complete documentation index, see [llms.txt](https://docs.xyb.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xyb.co/accounts/configure-accounts/create-new-accounts.md).

# Create New Accounts

After you’ve planned your account structure and configured your product, you’re ready to create your first customer account using XYB.

***

### Prerequisites

Make sure you’ve completed:

* Product Configuration: Your account product must exist (with `productId` and `version`).
* Entity Creation: The customer entity (owner of the account) must be available.
* Authentication: You have access to XYB APIs via secure credentials.

***

### Create Account via API

#### Endpoint

```
POST /api/v2.0/account
```

#### Sample Request Body

```json
{
  "reference": "user-123",
  "name": "John Smith's Account",
  "productId": "f5e6a3aa-xxxx-yyyy-zzzz-abcdefghijkl",
  "productVersion": "1.0",
  "currency": "EUR",
  "owner": {
    "type": "INDIVIDUAL",
    "affiliation": "PERSONAL",
    "reference": "entity-xyz"
  },
  "tags": ["PREMIUM", "EU"],
  "attributes": {
    "risk_level": "LOW",
    "kyc_status": "VERIFIED"
  },
  "coordinates": {
    "banking": {
      "iban": "DE89370400440532013000"
    }
  }
}
```

#### Sample Response

```json
{
  "id": "2f3a...fd91",
  "reference": "user-123",
  "name": "John Smith's Account",
  "status": "OPEN",
  "productUuid": "...",
  "wallets": [...],
  "owner": {...}
}
```

#### Error Codes

* `405` - Account already exists with this reference or coordinates
* `400` - Validation failure (missing or mismatched data)

Learn more about [Account Management APIs](/accounts/account-operations-apis.md).

***

***

### Creating Accounts via UI

If you want to allow **end-users** or **internal agents** to trigger account creation via your own frontend:

1. Build a form to collect:
   * Owner reference
   * Account name
   * Currency
   * Product ID + version
   * Optional tags or attributes
2. Post the form data to your backend
3. Call the `POST /account` endpoint using backend service logic
4. Show success, redirect, or display the new account data

***

### What Happens Behind the Scenes?

When you create an account:

* XYB validates product config and entity
* Creates account + default wallet(s)
* Links ledger account if configured
* Assigns banking coordinates (if provided)
* **Publishes Kafka event `account-created.`You can subscribe to this event or query the account at any time.** [**Learn more about the Accounts Kafka topics.**](/accounts/kafka-topics-quick-reference-guide.md)

###


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xyb.co/accounts/configure-accounts/create-new-accounts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
