Update an assignment of a legal entity to an accounting book
Operation ID: updateBookEntityAssignment
Group: Accounting › Books
Open in the interactive reference
PATCH /accounting/books/entity-assignments/{id}
Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.
Changes the chart of accounts, fiscal calendar or currency a legal entity uses in an accounting book. A property you leave out keeps its current value; null clears it, which an active entity does not allow: an active entity needs all three properties in every book it is assigned to. The book and the entity of an assignment cannot change: delete the assignment and create another.
The properties are locked once the assignment has transactions, once the entity's assignment to an adjustment book based on this book has them, and, for the chart of accounts, while an intercompany process configured for the entity uses it. A new fiscal calendar rebuilds the entity's accounting period statuses in the book. A change in a full book is copied to the entity's assignments in the adjustment books based on it; an adjustment book's assignment takes its properties from there, so none can be sent for it.
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. |
id |
path | string | yes | The unique identifier for the entity assignment to update. Example: "9b8a7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d". |
Request body
Required, application/json: updateBookEntityAssignmentInput.
| Field | Type | Required | Description |
|---|---|---|---|
chartOfAccountsId |
string | null | no | The chart of accounts the entity uses in this book. Omit to leave it unchanged; send null to clear it (not on an active entity). See id on GET accounting/chart-of-accounts/:id. |
fiscalCalendarId |
string | null | no | The fiscal calendar the entity uses in this book. Omit to leave it unchanged; send null to clear it (not on an active entity). See id on GET accounting/fiscal-calendars/:id. |
currency |
string | null | no | The currency the entity uses in this book. Format ISO 4217, for example 'USD'. Omit to leave it unchanged; send null to clear it (not on an active entity). Example: "GBP". |
{}
Response
200 Success
{
"data": {},
"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 |
|---|---|
NOT_FOUND |
400 |
REFERENCE_NOT_FOUND |
400 |
INVALID_FIELD_VALUE |
400 |
FIELD_REQUIRED |
400 |
FIELD_NOT_ALLOWED |
400 |
CHART_OF_ACCOUNTS_INCOMPATIBLE |
400 |
ASSIGNMENT_FIELD_LOCKED |
400 |
ENTITY_HIERARCHY_INCOMPLETE |
400 |
ASSIGNMENT_INCOMPLETE |
400 |
IDEMPOTENCY_KEY_CONFLICT |
409 |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 |
Statuses
400— Invalid request or business failure. Codes: NOT_FOUND, REFERENCE_NOT_FOUND, INVALID_FIELD_VALUE, FIELD_REQUIRED, FIELD_NOT_ALLOWED, CHART_OF_ACCOUNTS_INCOMPATIBLE, ASSIGNMENT_FIELD_LOCKED, ENTITY_HIERARCHY_INCOMPLETE, ASSIGNMENT_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