# Create account

**Endpoint**

&#x20;`POST/v2/account`

**Link**

{% embed url="<https://stagep.tst-apidmndelss.com/openapi/v2.html#/operations/Accounts_CreateAccount>" %}

### **Request**

#### **Headers**

| Key             | Value              | Required |
| --------------- | ------------------ | -------- |
| `Authorization` | `Bearer <JWT>`     | Yes      |
| `Content-Type`  | `application/json` | Yes      |
| `Accept`        | `application/json` | Yes      |

#### **Request Body (JSON)**

| Field             | Type     | Description & Requirements                                    | Example                            |
| ----------------- | -------- | ------------------------------------------------------------- | ---------------------------------- |
| **`customerId`**  | `string` | **ID of the customer** who owns this account.                 | <kbd>`"DqCsgSE-4e95-ViYbNI"`</kbd> |
| **`name`**        | `string` | **Account name** (e.g., `"Business USD Account"`).            | `"Savings Account"`                |
| **`currencyIso`** | `string` | **Currency code** (ISO 4217, e.g., `USD`, `EUR`). *Required*. | `"EUR"`                            |

**Example Request Body:**

json

```
{
  "customerId": "DqCsgSE-4e95-ViYbNI",
  "name": "Main Business Account",
  "currencyIso": "USD"
}
```

***

### **Response (200 OK)**

Returns the created `Account entity v2` object in JSON format.

#### **Response Fields**

| Field             | Type      | Description & Values                                                                                                                                                                                                                                                               | Example                                                           |
| ----------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **`id`**          | `string`  | Unique account identifier.                                                                                                                                                                                                                                                         | `"UhcPVBEpjmtR"`                                                  |
| **`customer`**    | `object`  | <p><strong>Customer details</strong>:<br>- <code>id</code>: Customer ID<br>- <code>name</code>: Full name<br>- <code>email</code>: Contact email<br>- <code>phone</code>: Phone number<br>- <code>status</code>: Customer status (<code>NEW</code>, <code>ACCEPT</code>, etc.)</p> | `{ "id": "`<kbd>`DqCsgSE-4e95-ViYbNI`</kbd>`", "status": "NEW" }` |
| **`isDefault`**   | `boolean` | Whether this is the user’s default account (`true`/`false`).                                                                                                                                                                                                                       | `false`                                                           |
| **`name`**        | `string`  | Account name (matches request).                                                                                                                                                                                                                                                    | `"Main Business Account"`                                         |
| **`status`**      | `string`  | <p>Initial account status:<br>- <code>NEW</code>: Newly created<br>- <code>PRE\_MODERATION</code>: Pending review<br>- <code>MODERATION</code>: Under review</p>                                                                                                                   | `"NEW"`                                                           |
| **`balance`**     | `object`  | <p><strong>Balance details</strong> (initially zero):<br>- <code>balance</code>: Available funds<br>- <code>hold</code>: Restricted funds (see <em>Money Object</em> below)</p>                                                                                                    | –                                                                 |
| **`currencyIso`** | `string`  | Account currency (matches request).                                                                                                                                                                                                                                                | `"USD"`                                                           |
| **`requisites`**  | `array`   | **Bank/payment details** (empty by default).                                                                                                                                                                                                                                       | `[]`                                                              |
| **`createdAt`**   | `string`  | Creation timestamp (ISO 8601).                                                                                                                                                                                                                                                     | "2024-05-20T10:30:00Z"                                            |
| **`updatedAt`**   | `string`  | Last update timestamp (matches `createdAt` initially).                                                                                                                                                                                                                             | "2024-05-20T10:30:00Z"                                            |

**Money Object**

Nested under `balance` and `hold`:

| Field              | Type      | Description                                             | Example |
| ------------------ | --------- | ------------------------------------------------------- | ------- |
| **`currencyCode`** | `string`  | 3-letter ISO currency code.                             | `"USD"` |
| **`units`**        | `string`  | Whole units (e.g., dollars). Initially `"0"`.           | `"0"`   |
| **`nanos`**        | `integer` | Fractional units (1 nano = 10^-9 units). Initially `0`. | `0`     |

### Error Cases

1. **Missing `currencyIso`**:

   json

   ```
   { "error": "currencyIso is required" }
   ```
2. **Invalid Currency Code**:

   json

   ```
   { "error": "currencyIso must be a valid ISO 4217 code (e.g., USD, EUR)" }
   ```
3. **Customer Not Found**:

   json

   ```
   { "error": "customerId not found" }
   ```

***

### **Notes**

* **Initial Status:** New accounts typically start with `NEW` status. If needed, the status can be changed to MODERATION status
* **Balances**: Initialized to `0` in the specified currency.
* **Requisites**: Added later via separate API calls (e.g., `/v2/account/{id}/requisites`).

### Examples

**Real request**&#x20;

```postman_json
{
  "customerId": "DqCsgSE-4e95-ViYbNI7mudVE",
  "name": "Savings Account",
  "currencyCode": "EUR"
}
```

**Real response**&#x20;

```postman_json
200 OK
{
  "item": {
    "accountId": "E4eon5o2Ehnz",
    "customer": {
      "id": "DqCsgSE-4e95-ViYbNI7mudVE",
      "name": "",
      "email": "",
      "phone": "",
      "status": "NEW"
    },
    "isDefault": false,
    "name": "Savings Account",
    "status": "MODERATION",
    "balance": {
      "balance": {
        "money": {
          "currencyCode": "EUR",
          "units": "0",
          "nanos": 0
        },
        "default": {
          "currencyCode": "USD",
          "units": "0",
          "nanos": 0
        }
      },
      "hold": {
        "money": {
          "currencyCode": "EUR",
          "units": "0",
          "nanos": 0
        },
        "default": {
          "currencyCode": "USD",
          "units": "0",
          "nanos": 0
        }
      }
    },
    "currencyCode": "EUR",
    "requisites": [],
    "createdAt": "0001-01-01T00:00:00Z",
    "updatedAt": "0001-01-01T00:00:00Z"
  }
}
```


---

# Agent Instructions: 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:

```
GET https://docs.delos.financial/accounts/create-account.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
