Put a retired account back in use, so what it still carries can be finished
const url = 'https://example.com/v1/entities/example/accounts/example/restore';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"reason":"example","expected_version":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/entities/example/accounts/example/restore \ --header 'Content-Type: application/json' \ --data '{ "reason": "example", "expected_version": 1 }'Undo an archive. This is to archive_account what reopen_period is to close_period.
While an account is archived, reversing against it, correcting, booking to it and closing over it are all
refused account_archived. Restoring is how an account archived while it still held a balance, a posted
entry or an unbooked statement line gets finished.
History does not move in either direction; a leg on this account is simply accepted again. A reason is
required, as for archiving, and expected_version is the version the caller read.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The entity this path is relative to
The entity this path is relative to
Request Bodyrequired
Section titled “Request Bodyrequired”Put a retired account back in use: the inverse of archiving, with the reason it had to come back.
This takes back an archive the way reopen_period takes back close_period. History does not move
either way. What comes back is the ability to post to the account, so a balance can be corrected, a
statement line booked and the period closed after an account was retired too early.
object
Why this account is in use again
The account version this caller read
Example generated
{ "reason": "example", "expected_version": 1}Responses
Section titled “Responses”Successful Response
The reply to an account command: the account as it now stands, and its audit action.
object
object
object
The account.created / account.archived action’s event sequence
object
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
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Unauthorized
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Forbidden
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Not Found
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Conflict
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Precondition Failed
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Unprocessable Content
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Internal Server Error
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Service Unavailable
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}