## Create account

`Account accounts().create(AccountCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/api/v1/accounts`

Create account

### Parameters

- `AccountCreateParams params`

  - `AccountType accountType`

    - `CHECKING("checking")`

    - `SAVING("saving")`

  - `String userId`

  - `Optional<String> currency`

  - `Optional<String> environment`

  - `Optional<String> organizationId`

### Returns

- `class Account:`

  - `String id`

  - `String accountNumber`

  - `AccountType accountType`

    - `CHECKING("checking")`

    - `SAVING("saving")`

  - `String balance`

  - `String currency`

  - `String environment`

  - `Status status`

    - `ACTIVE("active")`

    - `SUSPENDED("suspended")`

    - `CLOSED("closed")`

  - `String userId`

  - `Optional<String> adminUserId`

  - `Optional<LocalDateTime> createdAt`

  - `Optional<String> organizationId`

  - `Optional<LocalDateTime> updatedAt`

  - `Optional<String> userRole`

### Example

```java
package com.rails.api.example;

import com.rails.api.client.RailsClient;
import com.rails.api.client.okhttp.RailsOkHttpClient;
import com.rails.api.models.accounts.Account;
import com.rails.api.models.accounts.AccountCreateParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        RailsClient client = RailsOkHttpClient.fromEnv();

        AccountCreateParams params = AccountCreateParams.builder()
            .accountType(AccountCreateParams.AccountType.CHECKING)
            .userId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
            .build();
        Account account = client.accounts().create(params);
    }
}
```

#### Response

```json
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "account_number": "account_number",
  "account_type": "checking",
  "balance": "balance",
  "currency": "currency",
  "environment": "environment",
  "status": "active",
  "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "admin_user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "created_at": "2019-12-27T18:11:19.117Z",
  "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "user_role": "user_role"
}
```
