Skip to content

Move the period lock deliberately backwards, and record why

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

Open a closed period again.

Reopening is how an incomplete month gets fixed, so it does not depend on the checks that refuse a close (issue 0005, pitfall 1). The month that most needs reopening is exactly the one that cannot pass them. Nothing is undone: the close record and its snapshot stay as they are, and this appends a second record saying the lock moved back.

entity_id
required
Entity Id

The entity this path is relative to

string

The entity this path is relative to

Media typeapplication/json
ReopenPeriodSubmission

Move the lock deliberately backwards, and say why.

Give exactly one of through or close_id. through is a boundary (“open March again”); close_id is an action (“undo that close”) and resolves to the boundary that close advanced from.

A reopen is not gated on the close checks, because the month that most needs reopening is the one that cannot pass them. Nothing is undone: the close record and its snapshot stay where they are.

object
through
Any of:
string
close_id
Any of:
string
reason
required
Reason

Why a closed period is being opened again

string
>= 1 characters
expected_version
required
Expected Version

The period lock version this reopen expects to move

integer
>= 1

Example generated

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

Successful Response

Media typeapplication/json
ReopenPeriodResponse
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
close_id
required
Close Id
string
kind
required
Kind
string
reopened_close_id
required
Any of:
string
lock
required
PeriodLock
object
through
required
Any of:
string
version
required
Version

Pass this back as expected_version on the next close or reopen

integer
close_id
required
Any of:
string
snapshot
required
CloseSnapshot

The verification snapshot the close was recorded against. Computed by the server, never supplied.

object
id
required
Id
string
snapshot_seq
required
Snapshot Seq
integer
state_hash
required
State Hash
string
through
required
Through
string
audit_seq
required
Audit Seq
integer
links
required
Links
object
key
additional properties
string

Example generated

{
"entity_id": "example",
"legal_name": "example",
"base_currency": "example",
"snapshot_seq": 1,
"close_id": "example",
"kind": "example",
"reopened_close_id": "example",
"lock": {
"through": "example",
"version": 1,
"close_id": "example"
},
"snapshot": {
"id": "example",
"snapshot_seq": 1,
"state_hash": "example",
"through": "example"
},
"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": {}
}
}