Create an accounting book
Operation ID: createBook
Group: Accounting › Books
Open in the interactive reference
POST /accounting/books
Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.
Creates an accounting book. A full book follows its own accounting standard; an adjustment book adjusts the full book named in baseBookId and copies that book's accounting standard and consolidation. Books can only be created while multi-book is on.
A new book has no legal entities. Assign them with POST accounting/books/entity-assignments, or send allEntities: true to assign every legal entity at once: each one is assigned with the chart of accounts, fiscal calendar and currency it has in the book it is copied from (the tenant's first book for a full book, the base book for an adjustment book). allEntities: true fails while journal entries exist, or when an active legal entity has no complete assignment to copy.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1. |
Idempotency-Key |
header | string | no | An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored. |
Request body
Required, application/json: createBookInput.
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | The display name of the accounting book. Must not be empty or blank. Names are not unique. Example: "IFRS". |
type |
string | no | The kind of accounting book: 'full' or 'adjustment'. Defaults to 'full'. An adjustment book adjusts the full book named in baseBookId. One of: "full", "adjustment". Example: "full". |
accountingStandard |
string | no | The accounting standard a full book follows, for example 'IFRS' or 'US GAAP': the name of an active, non-base accounting standard. Required on a full book. Rejected on an adjustment book, which copies it from its base book. Example: "IFRS". |
consolidation |
boolean | no | Whether the book consolidates its legal entities. Full book only; defaults to false. Rejected on an adjustment book, which copies it from its base book. Example: false. |
baseBookId |
string | no | The full book an adjustment book adjusts. Required on an adjustment book, rejected on a full book. See id on GET accounting/books/:id. |
allEntities |
boolean | no | Whether every legal entity is assigned to the book. Defaults to false. When true, each legal entity is assigned with the properties it has in the book it is copied from, and the book cannot lose an entity afterwards. Non-legal reporting entities are not copied. Example: false. |
description |
string | no | A free-form description of the accounting book. Example: "Group reporting under IFRS". |
exchangeRateGroupId |
string | no | The exchange rate group the book takes its exchange rates from. Defaults to the tenant's default exchange rate group. |
{
"name": "IFRS"
}
Response
200 Success
Under data (createBookOutput):
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | The unique identifier for the created accounting book. Example: "3f2a9c14-6d0b-4b8e-9f1a-2c7d5e8b9a10". |
{
"data": {
"id": "3f2a9c14-6d0b-4b8e-9f1a-2c7d5e8b9a10"
},
"diagnostics": [
{
"code": "<code>",
"message": "<message>",
"severity": "error",
"path": [
"<path>"
],
"details": "<details>"
}
]
}
Response headers
Idempotency-Replayed— Present andtrueonly when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent asfalse.
Errors
| Code | Status |
|---|---|
MULTI_BOOK_DISABLED |
400 |
FIELD_REQUIRED |
400 |
FIELD_NOT_ALLOWED |
400 |
INVALID_FIELD_VALUE |
400 |
REFERENCE_NOT_FOUND |
400 |
INVALID_BASE_BOOK |
400 |
ALL_ENTITIES_NOT_ALLOWED |
400 |
ENTITY_HIERARCHY_INCOMPLETE |
400 |
IDEMPOTENCY_KEY_CONFLICT |
409 |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 |
Statuses
400— Invalid request or business failure. Codes: MULTI_BOOK_DISABLED, FIELD_REQUIRED, FIELD_NOT_ALLOWED, INVALID_FIELD_VALUE, REFERENCE_NOT_FOUND, INVALID_BASE_BOOK, ALL_ENTITIES_NOT_ALLOWED, ENTITY_HIERARCHY_INCOMPLETE401— The request carries no valid access token.403— Not authorized404— Not found409— The Idempotency-Key is still being processed by another request.422— The Idempotency-Key was already used with a different request payload.429— Too many requests from this client address. The response has no body and noRetry-Afterheader.500— Internal server error