Create many transactions in one call
curl --request POST \
--url https://api.kordio.io/ledger/v1/transactions/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"idempotency_key": "cap_a",
"postings": [
{
"account": "cash:usd",
"amount": "10000000",
"currency": "USDC",
"direction": "debit"
},
{
"account": "accounts_receivable:acme",
"amount": "10000000",
"currency": "USDC",
"direction": "credit"
}
]
},
{
"idempotency_key": "cap_b",
"postings": [
{
"account": "cash:usd",
"amount": "5000000",
"currency": "USDC",
"direction": "debit"
},
{
"account": "accounts_receivable:acme",
"amount": "5000000",
"currency": "USDC",
"direction": "credit"
}
]
}
]
}
'import requests
url = "https://api.kordio.io/ledger/v1/transactions/bulk"
payload = { "transactions": [
{
"idempotency_key": "cap_a",
"postings": [
{
"account": "cash:usd",
"amount": "10000000",
"currency": "USDC",
"direction": "debit"
},
{
"account": "accounts_receivable:acme",
"amount": "10000000",
"currency": "USDC",
"direction": "credit"
}
]
},
{
"idempotency_key": "cap_b",
"postings": [
{
"account": "cash:usd",
"amount": "5000000",
"currency": "USDC",
"direction": "debit"
},
{
"account": "accounts_receivable:acme",
"amount": "5000000",
"currency": "USDC",
"direction": "credit"
}
]
}
] }
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({
transactions: [
{
idempotency_key: 'cap_a',
postings: [
{account: 'cash:usd', amount: '10000000', currency: 'USDC', direction: 'debit'},
{
account: 'accounts_receivable:acme',
amount: '10000000',
currency: 'USDC',
direction: 'credit'
}
]
},
{
idempotency_key: 'cap_b',
postings: [
{account: 'cash:usd', amount: '5000000', currency: 'USDC', direction: 'debit'},
{
account: 'accounts_receivable:acme',
amount: '5000000',
currency: 'USDC',
direction: 'credit'
}
]
}
]
})
};
fetch('https://api.kordio.io/ledger/v1/transactions/bulk', 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/transactions/bulk",
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([
'transactions' => [
[
'idempotency_key' => 'cap_a',
'postings' => [
[
'account' => 'cash:usd',
'amount' => '10000000',
'currency' => 'USDC',
'direction' => 'debit'
],
[
'account' => 'accounts_receivable:acme',
'amount' => '10000000',
'currency' => 'USDC',
'direction' => 'credit'
]
]
],
[
'idempotency_key' => 'cap_b',
'postings' => [
[
'account' => 'cash:usd',
'amount' => '5000000',
'currency' => 'USDC',
'direction' => 'debit'
],
[
'account' => 'accounts_receivable:acme',
'amount' => '5000000',
'currency' => 'USDC',
'direction' => 'credit'
]
]
]
]
]),
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/transactions/bulk"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"idempotency_key\": \"cap_a\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n },\n {\n \"idempotency_key\": \"cap_b\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n }\n ]\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/transactions/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactions\": [\n {\n \"idempotency_key\": \"cap_a\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n },\n {\n \"idempotency_key\": \"cap_b\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/ledger/v1/transactions/bulk")
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 \"transactions\": [\n {\n \"idempotency_key\": \"cap_a\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n },\n {\n \"idempotency_key\": \"cap_b\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "bulk_result",
"atomic": false,
"partial_failure": false,
"results": [
{
"idempotency_key": "cap_a",
"status": "created",
"transaction": {
"object": "transaction",
"id": "...",
"...": null
}
},
{
"idempotency_key": "cap_b",
"status": "created",
"transaction": {
"object": "transaction",
"id": "...",
"...": null
}
}
]
}{
"object": "bulk_result",
"atomic": false,
"partial_failure": true,
"results": [
{
"idempotency_key": "cap_a",
"status": "created",
"transaction": {
"object": "transaction",
"id": "..."
}
},
{
"idempotency_key": "cap_b",
"status": "error",
"error": {
"code": "unbalanced",
"message": "debits and credits must net to zero per currency"
}
}
]
}Create many transactions in one call
Each item carries its own idempotency_key. The header
Idempotency-Key is ignored on this endpoint; bulk callers
must inline keys.
Returns a bulk_result with one entry per input in the same
order. Status per entry: created, replayed, or error.
On any failure the response status is 207 Multi-Status (or
201 if every item succeeded).
Atomic mode is partial today. "atomic": true flags the
intent; failures are still surfaced per-item. Full rollback of
prior successes is not implemented yet; reverse them manually
if you need rollback semantics. We do not silently drop the
request.
POST
/
ledger
/
v1
/
transactions
/
bulk
Create many transactions in one call
curl --request POST \
--url https://api.kordio.io/ledger/v1/transactions/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"idempotency_key": "cap_a",
"postings": [
{
"account": "cash:usd",
"amount": "10000000",
"currency": "USDC",
"direction": "debit"
},
{
"account": "accounts_receivable:acme",
"amount": "10000000",
"currency": "USDC",
"direction": "credit"
}
]
},
{
"idempotency_key": "cap_b",
"postings": [
{
"account": "cash:usd",
"amount": "5000000",
"currency": "USDC",
"direction": "debit"
},
{
"account": "accounts_receivable:acme",
"amount": "5000000",
"currency": "USDC",
"direction": "credit"
}
]
}
]
}
'import requests
url = "https://api.kordio.io/ledger/v1/transactions/bulk"
payload = { "transactions": [
{
"idempotency_key": "cap_a",
"postings": [
{
"account": "cash:usd",
"amount": "10000000",
"currency": "USDC",
"direction": "debit"
},
{
"account": "accounts_receivable:acme",
"amount": "10000000",
"currency": "USDC",
"direction": "credit"
}
]
},
{
"idempotency_key": "cap_b",
"postings": [
{
"account": "cash:usd",
"amount": "5000000",
"currency": "USDC",
"direction": "debit"
},
{
"account": "accounts_receivable:acme",
"amount": "5000000",
"currency": "USDC",
"direction": "credit"
}
]
}
] }
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({
transactions: [
{
idempotency_key: 'cap_a',
postings: [
{account: 'cash:usd', amount: '10000000', currency: 'USDC', direction: 'debit'},
{
account: 'accounts_receivable:acme',
amount: '10000000',
currency: 'USDC',
direction: 'credit'
}
]
},
{
idempotency_key: 'cap_b',
postings: [
{account: 'cash:usd', amount: '5000000', currency: 'USDC', direction: 'debit'},
{
account: 'accounts_receivable:acme',
amount: '5000000',
currency: 'USDC',
direction: 'credit'
}
]
}
]
})
};
fetch('https://api.kordio.io/ledger/v1/transactions/bulk', 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/transactions/bulk",
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([
'transactions' => [
[
'idempotency_key' => 'cap_a',
'postings' => [
[
'account' => 'cash:usd',
'amount' => '10000000',
'currency' => 'USDC',
'direction' => 'debit'
],
[
'account' => 'accounts_receivable:acme',
'amount' => '10000000',
'currency' => 'USDC',
'direction' => 'credit'
]
]
],
[
'idempotency_key' => 'cap_b',
'postings' => [
[
'account' => 'cash:usd',
'amount' => '5000000',
'currency' => 'USDC',
'direction' => 'debit'
],
[
'account' => 'accounts_receivable:acme',
'amount' => '5000000',
'currency' => 'USDC',
'direction' => 'credit'
]
]
]
]
]),
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/transactions/bulk"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"idempotency_key\": \"cap_a\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n },\n {\n \"idempotency_key\": \"cap_b\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n }\n ]\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/transactions/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactions\": [\n {\n \"idempotency_key\": \"cap_a\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n },\n {\n \"idempotency_key\": \"cap_b\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/ledger/v1/transactions/bulk")
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 \"transactions\": [\n {\n \"idempotency_key\": \"cap_a\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"10000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n },\n {\n \"idempotency_key\": \"cap_b\",\n \"postings\": [\n {\n \"account\": \"cash:usd\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"debit\"\n },\n {\n \"account\": \"accounts_receivable:acme\",\n \"amount\": \"5000000\",\n \"currency\": \"USDC\",\n \"direction\": \"credit\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "bulk_result",
"atomic": false,
"partial_failure": false,
"results": [
{
"idempotency_key": "cap_a",
"status": "created",
"transaction": {
"object": "transaction",
"id": "...",
"...": null
}
},
{
"idempotency_key": "cap_b",
"status": "created",
"transaction": {
"object": "transaction",
"id": "...",
"...": null
}
}
]
}{
"object": "bulk_result",
"atomic": false,
"partial_failure": true,
"results": [
{
"idempotency_key": "cap_a",
"status": "created",
"transaction": {
"object": "transaction",
"id": "..."
}
},
{
"idempotency_key": "cap_b",
"status": "error",
"error": {
"code": "unbalanced",
"message": "debits and credits must net to zero per currency"
}
}
]
}