---
title: "Create accounting account"
method: POST
path: "/accountingaccounts/{companyId}"
tags: ["AccountingAccounts"]
---

# Create accounting account

`POST /accountingaccounts/{companyId}`

Creates an accounting account identified by `accountingCode`. If an account with the same `accountingCode` already exists, this call updates it instead of failing; if the submitted data is identical to the existing account, the call is a no-op. `accountingName` defaults to `accountingCode` when omitted. `type` is inferred from `accountingCode` when not sent, and an `accountingCode` starting with `572` is always classified as `banks` on creation regardless of the `type` sent — see the `type` field description. Once an account exists, `type` cannot be changed through this endpoint: any `type` sent for an existing account (including the `572` override) is silently ignored and only applies when the account is first created — use the update endpoints to change it. Recreating a previously deleted (deactivated) account does not reactivate it unless `active: true` is explicitly sent. Entries in `attributes` with an empty or missing `customId` or `value` are silently discarded.

## Path parameters

- `companyId` string, required

## Request body

- PostAccountingsAccountsRequestSchema
  - `active` boolean, nullable — Whether the accounting account is active.
  - `type` 'banks' | 'analytics' | 'accountings'
  - `accountingName` string, nullable — Display name of the accounting account. Defaults to `accountingCode` when omitted.
  - `collective` boolean, nullable — Whether this is a collective (grouping) accounting account rather than an individual one.
  - `additionalInfo` object, nullable — Free-form key/value metadata to attach to the account. Sending an empty object leaves any previously stored metadata unchanged instead of clearing it.
  - `attributes` AttributeValueRequestACCOUNTSchema[], nullable — Custom attribute values to attach to the account. Entries with an empty or missing `customId` or `value` are silently discarded.
    - `customId` string, nullable — Custom ID of the attribute definition this value belongs to. Entries missing `customId` or `value` are silently discarded.
    - `value` string, nullable — Value assigned to the attribute.
    - `valueCustomId` string, nullable — Custom ID of the selected option, for list-type attributes.
  - `accountingCode` string, required — Unique code identifying the accounting account in the company's chart of accounts.

## Response `200`

Successful Response

- UpsertAccountingsAccountsResponseSchema
  - `id` string, required — Embat resource ID
  - `accountingCode` string, required — Client-provided accounting code.

## Other responses

- `401` — Unauthorized. The bearer token is missing, invalid or expired.
- `404` — Not found. The requested resource or `companyId` does not exist.
- `422` — Validation Error
- `500` — Unexpected error. Contact support if it persists.

---

[API](https://skmtc.net/embat/apis/embat-api.md) · [All operations](https://skmtc.net/embat/apis/embat-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/embat/embat-api/revisions/36ca48bf4489/schema)
