POST
Add an account (client account)
Client space Accounting module For: Accountant · Permission: accounting_accounts.create Conditions
  • The accounting module must be included in the plan of the organization.
  • From the client space the book is always the client account’s own book.
  • The book must be set up for accounting (it must have at least one journal).
  • parent_id is required and must be an account of this book; otherwise validation fails.
  • code is required, must be unique among all accounts of the book, and must start with the code of the parent account.
  • When auxiliary_type is sent it must be customer or vendor; a customer account needs a parent whose code starts with 41, a supplier account a parent whose code starts with 40, and the parent must not already be the auxiliary of another record.
  • A parent that can receive entries and already has journal lines cannot get a sub-account.
  • A parent that can receive entries and is mapped to a posting role without a third-party type cannot get a sub-account; the role must be remapped first.
What else happens
  • Creates a manual account: it can receive entries, is not a standard-template account, takes the normal balance (debit or credit) and organization of its parent, and has no template link.
  • When the parent could receive entries it is turned into a grouping account (is_postable becomes false) as its first sub-account is added.
  • When auxiliary_type is sent the new account is its own auxiliary: auxiliary_id is set to its own identifier.
Part of Set up the books.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, owner_type, code, name, parent_id, normal_balance, is_postable, is_standard, syscohada_template_id, auxiliary_type, auxiliary_id, created_at, updated_at.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: .

Body

application/json
parent_id
string
required

Identifier of the parent account, which must belong to the same book. If it can receive entries it must have no journal lines and no non-third-party role mapping, and it becomes a grouping account.

code
string
required

Code of the new account. It must be unique in the book and start with the parent's code.

name
string
required

Name of the new account.

auxiliary_type
enum<string> | null

Makes the new account a customer or supplier account entered by hand: customer under a parent whose code starts with 41, vendor under a parent whose code starts with 40. The parent must not already belong to a third party, a money account or a payment route. Optional; leave it out for an ordinary account.

Available options:
customer,
vendor

Response

Resource (only with response=resource).

id

Identifier of the account (27-character KSUID).

owner_type

Type of book owning the account: organization, company or client.

code

Account code in the chart of accounts, unique within the book.

name

Name of the account.

parent_id

Identifier of the parent account; null for a top-level account.

normal_balance

Side on which the account normally carries its balance: debit or credit.

is_postable
boolean

true when entries can be posted to the account; false for a grouping account that has sub-accounts.

is_standard
boolean

true when the account comes from the standard chart template; accounts added by hand are false.

syscohada_template_id

Identifier of the standard template account this account was created from; null for an account added by hand.

auxiliary_type

Kind of record this account is the third-party account of (customer, vendor, location, cash_register, money_account, payment_route, payment_method, intercompany_counterparty, cheque_transfer); null for an ordinary account.

auxiliary_id

Identifier of the record the account stands for; for a manual customer or supplier account it is the account's own identifier. Null for an ordinary account.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).