Close a period
curl --request POST \
--url https://api.kordio.io/ledger/v1/period_closes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period_start": "2026-03-01T00:00:00Z",
"period_end": "2026-03-31T23:59:59Z",
"closed_by_label": "controller@acme",
"note": "March 2026 monthly close"
}
'import requests
url = "https://api.kordio.io/ledger/v1/period_closes"
payload = {
"period_start": "2026-03-01T00:00:00Z",
"period_end": "2026-03-31T23:59:59Z",
"closed_by_label": "controller@acme",
"note": "March 2026 monthly close"
}
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({
period_start: '2026-03-01T00:00:00Z',
period_end: '2026-03-31T23:59:59Z',
closed_by_label: 'controller@acme',
note: 'March 2026 monthly close'
})
};
fetch('https://api.kordio.io/ledger/v1/period_closes', 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",
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([
'period_start' => '2026-03-01T00:00:00Z',
'period_end' => '2026-03-31T23:59:59Z',
'closed_by_label' => 'controller@acme',
'note' => 'March 2026 monthly close'
]),
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"
payload := strings.NewReader("{\n \"period_start\": \"2026-03-01T00:00:00Z\",\n \"period_end\": \"2026-03-31T23:59:59Z\",\n \"closed_by_label\": \"controller@acme\",\n \"note\": \"March 2026 monthly close\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period_start\": \"2026-03-01T00:00:00Z\",\n \"period_end\": \"2026-03-31T23:59:59Z\",\n \"closed_by_label\": \"controller@acme\",\n \"note\": \"March 2026 monthly close\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/ledger/v1/period_closes")
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 \"period_start\": \"2026-03-01T00:00:00Z\",\n \"period_end\": \"2026-03-31T23:59:59Z\",\n \"closed_by_label\": \"controller@acme\",\n \"note\": \"March 2026 monthly close\"\n}"
response = http.request(request)
puts response.read_body{
"object": "period_close",
"id": "b9ed8576-dab5-4790-b86c-0e7af572659e",
"period_start": "2026-03-01T00:00:00.000000Z",
"period_end": "2026-03-31T23:59:59.000000Z",
"closed_by_label": "controller@acme",
"trial_balance": {
"as_of": "2026-03-31T23:59:59Z",
"mode": "live",
"healthy": true,
"totals_by_currency": {
"USDC": {
"debit": "100000",
"credit": "100000",
"residual": "0"
}
},
"accounts": []
},
"created_at": "2026-04-02T10:00:00Z"
}{
"livemode": false,
"request_id": "req_3LhM8XKx9q4hQv",
"error": {
"code": "invalid_request",
"message": "<string>",
"hint": "<string>",
"param": "<string>",
"details": {},
"docs_url": "<string>",
"request_id": "<string>"
}
}Snapshots the trial balance at period_end and locks the
window. After close, any new transaction with value_date
inside the window is rejected with period_closed. Enforced
both in the coordinator and by a DB trigger.
Overlapping closes are rejected with already_exists.
POST
/
ledger
/
v1
/
period_closes
Close a period
curl --request POST \
--url https://api.kordio.io/ledger/v1/period_closes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period_start": "2026-03-01T00:00:00Z",
"period_end": "2026-03-31T23:59:59Z",
"closed_by_label": "controller@acme",
"note": "March 2026 monthly close"
}
'import requests
url = "https://api.kordio.io/ledger/v1/period_closes"
payload = {
"period_start": "2026-03-01T00:00:00Z",
"period_end": "2026-03-31T23:59:59Z",
"closed_by_label": "controller@acme",
"note": "March 2026 monthly close"
}
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({
period_start: '2026-03-01T00:00:00Z',
period_end: '2026-03-31T23:59:59Z',
closed_by_label: 'controller@acme',
note: 'March 2026 monthly close'
})
};
fetch('https://api.kordio.io/ledger/v1/period_closes', 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",
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([
'period_start' => '2026-03-01T00:00:00Z',
'period_end' => '2026-03-31T23:59:59Z',
'closed_by_label' => 'controller@acme',
'note' => 'March 2026 monthly close'
]),
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"
payload := strings.NewReader("{\n \"period_start\": \"2026-03-01T00:00:00Z\",\n \"period_end\": \"2026-03-31T23:59:59Z\",\n \"closed_by_label\": \"controller@acme\",\n \"note\": \"March 2026 monthly close\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period_start\": \"2026-03-01T00:00:00Z\",\n \"period_end\": \"2026-03-31T23:59:59Z\",\n \"closed_by_label\": \"controller@acme\",\n \"note\": \"March 2026 monthly close\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/ledger/v1/period_closes")
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 \"period_start\": \"2026-03-01T00:00:00Z\",\n \"period_end\": \"2026-03-31T23:59:59Z\",\n \"closed_by_label\": \"controller@acme\",\n \"note\": \"March 2026 monthly close\"\n}"
response = http.request(request)
puts response.read_body{
"object": "period_close",
"id": "b9ed8576-dab5-4790-b86c-0e7af572659e",
"period_start": "2026-03-01T00:00:00.000000Z",
"period_end": "2026-03-31T23:59:59.000000Z",
"closed_by_label": "controller@acme",
"trial_balance": {
"as_of": "2026-03-31T23:59:59Z",
"mode": "live",
"healthy": true,
"totals_by_currency": {
"USDC": {
"debit": "100000",
"credit": "100000",
"residual": "0"
}
},
"accounts": []
},
"created_at": "2026-04-02T10:00:00Z"
}{
"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.
Body
application/json
Response
Period closed; trial balance snapshotted
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