Accounts
Create an account
Open a new account for a user or business entity.
The Create Account endpoint registers a new account in the system. Depending on your setup, this can represent either an individual account or a business account.
Endpoint
Headers
Key | Value | Required |
---|---|---|
Content-Type | application/json | Yes |
Authorization | Bearer <access_token> | Required for admin-created accounts |
Request Body
Field | Type | Required | Description |
---|---|---|---|
string | Yes | The primary email for the account. Must be unique. | |
name | string | Yes | The account name (business or individual). |
type | string | Yes | Either individual or business. |
password | string | Yes | A strong password for login authentication. |
settings | object | No | Account preferences like currency, timezone, and language. |
Response
Successful Response (201 Created)
Field | Type | Description |
---|---|---|
id | string | Unique identifier of the created account. |
string | Account email. | |
name | string | Account name. |
type | string | individual or business. |
status | string | Account status, usually active upon creation. |
created_at | string | ISO 8601 timestamp of creation. |
updated_at | string | ISO 8601 timestamp of last update. |
settings | object | Saved preferences. |
Error Response (400 / 409)
Error Code | Meaning |
---|---|
invalid_request | Missing or malformed fields. |
email_exists | Another account already uses this email. |
unauthorized | Attempt to create an account without required permissions. |
Example Usage
cURL
JavaScript (Fetch)
To avoid duplicate accounts, always validate email uniqueness on the client side before creating. Passwords must follow your security policy (length, complexity, etc.).