On this page
Batch import
Submit a batch
POST /ledger/v1/events/batch
Headers
| Header | Required |
|---|---|
X-Tenant-ID | yes |
Request body
events holds 1–10 000 items:
{
"events": [
{
"eventType": "SalesInvoice",
"date": "2026-01-31",
"documentReference": "INV-2026-0001",
"description": "January invoice",
"accountingEntries": [
{ "accountCode": "1500-receivables", "entryType": "DEBIT", "amount": 125000, "currency": "EUR" },
{ "accountCode": "3000-sales", "entryType": "CREDIT", "amount": 100000, "currency": "EUR" },
{ "accountCode": "2700-vat-out", "entryType": "CREDIT", "amount": 25000, "currency": "EUR" }
]
}
]
}
| Field | Type | Constraints |
|---|---|---|
events | array | required, 1–10 000 items |
events[].eventType | string | required |
events[].date | date | required, yyyy-MM-dd |
events[].documentReference | string | ≤ 255 chars; unique per tenant |
events[].description | string | optional |
events[].accountingEntries | array | required, non-empty; same shape as business events |
events[].metadata | object | optional |
Responses
The response always reports how many items were accepted and lists per-item errors:
{
"accepted": 9998,
"errors": [
{ "documentReference": "INV-2026-0042", "index": 41,
"messages": ["entries do not balance: debits=125000 credits=100000"] },
{ "documentReference": "INV-2026-0007", "index": -1,
"messages": ["document reference already exists"] }
]
}
| Status | Meaning |
|---|---|
202 | Batch accepted (accepted > 0); any failures listed in errors |
409 | A documentReference already exists for the tenant (index: -1 marks DB-level duplicates) |
422 | Validation failures — unbalanced items or duplicate references within the batch |
400 | Missing or invalid fields |
index is the item’s 0-based position in the submitted array.