Skip to content

Retire an account: nothing may be posted to it again, and everything posted to it stays

POST
/v1/entities/{entity_id}/accounts/{account_id}/archive
curl --request POST \
--url https://example.com/v1/entities/example/accounts/example/archive \
--header 'Content-Type: application/json' \
--data '{ "reason": "example", "expected_version": 1 }'

Archive an account. This is the only way an account leaves the chart.

Nothing is deleted and no history moves: every entry already posted to the account stays where it is and keeps appearing in every report that covers its date. From now on, a leg on the account is refused at posting time (account_archived). restore undoes this.

account_id accepts the account’s path as well as its id, like everywhere an account is named in the command surface. A reason is required, and expected_version is the version the caller read.

account_id
required
Account Id
string
entity_id
required
Entity Id

The entity this path is relative to

string

The entity this path is relative to

Media typeapplication/json
AccountArchiveSubmission

Retire an account: nothing may be posted to it again, and everything already posted to it stays.

reason is required here, though optional on creation, because this is a decision about the books rather than structure. An archived account stays visible in every later report, and “why did this stop being used?” is what a reviewer will ask.

expected_version is the account version the caller was looking at, the same concurrency check a close uses. If two callers retire an account from two readings of the chart, the second fails with stale_version rather than acting on a chart it never saw.

object
reason
required
Reason

Why nothing may be posted to this account again

string
>= 1 characters
expected_version
required
Expected Version

The account version this caller read

integer
>= 1

Example generated

{
"reason": "example",
"expected_version": 1
}

Successful Response

Media typeapplication/json
ChartChangeResponse

The reply to an account command: the account as it now stands, and its audit action.

object
entity_id
required
Entity Id
string
legal_name
required
Legal Name
string
base_currency
required
Base Currency
string
snapshot_seq
required
Snapshot Seq
integer
account
required
Account
object
id
required
Id
string
path
required
Path
string
type
required
Type
string
code
required
Any of:
string
tax_code
required
Any of:
string
is_cash
required
Is Cash
boolean
archived
required
Archived
boolean
version
required
Version
integer
commodities
required
Commodities
Array<string>
links
required
Links
object
key
additional properties
string
version
required
Version
integer
audit_seq
required
Audit Seq

The account.created / account.archived action’s event sequence

integer
links
required
Links
object
key
additional properties
string

Example generated

{
"entity_id": "example",
"legal_name": "example",
"base_currency": "example",
"snapshot_seq": 1,
"account": {
"id": "example",
"path": "example",
"type": "example",
"code": "example",
"tax_code": "example",
"is_cash": true,
"archived": true,
"version": 1,
"commodities": [
"example"
],
"links": {
"additionalProperty": "example"
}
},
"version": 1,
"audit_seq": 1,
"links": {
"additionalProperty": "example"
}
}

Bad Request

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Unauthorized

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Forbidden

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Not Found

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Conflict

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Precondition Failed

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Unprocessable Content

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Internal Server Error

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Service Unavailable

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}