# createCustomerAccount

## Overview

Creates an ACTIVE account for an existing ACTIVE BP and company. Requires a company-specific code and a nonblank account name; preferred currency is optional.

Optional `addressUsages` and `bankAccountUsages` assign existing active resources owned by the BP in the same transaction. Each usage contains `addressId` or `bankAccountId`, `purpose`, and optional `isDefault` (defaults to false). Invalid assignments roll back account creation.

## Modules Commands Used

- [business-partner] CreateCustomerAccount

## Exception Handling

| Error Code | Description |
| --- | --- |
| UNAUTHENTICATED | Authentication is required |
| INSUFFICIENT_PERMISSION | The user lacks the required module permission |
| Domain validation errors | The module's validation message is returned; failed transactions roll back |
