Reopen a closed period
curl --request POST \
--url https://api.kordio.io/ledger/v1/period_closes/{id}/reopen \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reopened_by_label": "controller@acme"
}
'import requests
url = "https://api.kordio.io/ledger/v1/period_closes/{id}/reopen"
payload = { "reopened_by_label": "controller@acme" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reopened_by_label: 'controller@acme'})
};
fetch('https://api.kordio.io/ledger/v1/period_closes/{id}/reopen', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kordio.io/ledger/v1/period_closes/{id}/reopen",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reopened_by_label' => 'controller@acme'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kordio.io/ledger/v1/period_closes/{id}/reopen"
payload := strings.NewReader("{\n \"reopened_by_label\": \"controller@acme\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kordio.io/ledger/v1/period_closes/{id}/reopen")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reopened_by_label\": \"controller@acme\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/ledger/v1/period_closes/{id}/reopen")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reopened_by_label\": \"controller@acme\"\n}"
response = http.request(request)
puts response.read_body{
"object": "period_close",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"closed_by_label": "controller@acme",
"created_at": "2023-11-07T05:31:56Z",
"note": "<string>",
"reopened_at": "2023-11-07T05:31:56Z",
"reopened_by_label": "<string>",
"trial_balance": {
"object": "trial_balance",
"ledger_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"as_of": "2023-11-07T05:31:56Z",
"healthy": true,
"accounts": [
{
"account": "<string>",
"name": "<string>",
"type": "asset",
"currency": "<string>",
"posted": "<string>",
"pending": "<string>",
"debit_total": "<string>",
"credit_total": "<string>"
}
],
"totals_by_currency": {}
}
}{
"error": {
"code": "not_found",
"message": "account not found",
"param": "id",
"docs_url": "https://docs.kordio.io/errors#not_found"
}
}{
"livemode": false,
"request_id": "req_3LhM8XKx9q4hQv",
"error": {
"code": "invalid_request",
"message": "<string>",
"hint": "<string>",
"param": "<string>",
"details": {},
"docs_url": "<string>",
"request_id": "<string>"
}
}Records who reopened and when. Use sparingly; every reopen
invalidates a previously-signed period report. The original
close row is preserved with reopened_at + reopened_by_label
for audit.
POST
/
ledger
/
v1
/
period_closes
/
{id}
/
reopen
Reopen a closed period
curl --request POST \
--url https://api.kordio.io/ledger/v1/period_closes/{id}/reopen \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reopened_by_label": "controller@acme"
}
'import requests
url = "https://api.kordio.io/ledger/v1/period_closes/{id}/reopen"
payload = { "reopened_by_label": "controller@acme" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reopened_by_label: 'controller@acme'})
};
fetch('https://api.kordio.io/ledger/v1/period_closes/{id}/reopen', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kordio.io/ledger/v1/period_closes/{id}/reopen",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reopened_by_label' => 'controller@acme'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kordio.io/ledger/v1/period_closes/{id}/reopen"
payload := strings.NewReader("{\n \"reopened_by_label\": \"controller@acme\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kordio.io/ledger/v1/period_closes/{id}/reopen")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reopened_by_label\": \"controller@acme\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/ledger/v1/period_closes/{id}/reopen")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reopened_by_label\": \"controller@acme\"\n}"
response = http.request(request)
puts response.read_body{
"object": "period_close",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"period_start": "2023-11-07T05:31:56Z",
"period_end": "2023-11-07T05:31:56Z",
"closed_by_label": "controller@acme",
"created_at": "2023-11-07T05:31:56Z",
"note": "<string>",
"reopened_at": "2023-11-07T05:31:56Z",
"reopened_by_label": "<string>",
"trial_balance": {
"object": "trial_balance",
"ledger_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"as_of": "2023-11-07T05:31:56Z",
"healthy": true,
"accounts": [
{
"account": "<string>",
"name": "<string>",
"type": "asset",
"currency": "<string>",
"posted": "<string>",
"pending": "<string>",
"debit_total": "<string>",
"credit_total": "<string>"
}
],
"totals_by_currency": {}
}
}{
"error": {
"code": "not_found",
"message": "account not found",
"param": "id",
"docs_url": "https://docs.kordio.io/errors#not_found"
}
}{
"livemode": false,
"request_id": "req_3LhM8XKx9q4hQv",
"error": {
"code": "invalid_request",
"message": "<string>",
"hint": "<string>",
"param": "<string>",
"details": {},
"docs_url": "<string>",
"request_id": "<string>"
}
}Authorizations
Same flow; ledger:write is required for any mutation.
Path Parameters
Body
application/json
Example:
"controller@acme"
Response
Reopened
Available options:
period_close Who closed it, as you labelled them. Not a Kordio identity.
Example:
"controller@acme"
The trial balance as it stood at the moment of closing.
Show child attributes
Show child attributes