On this page
Errors & status codes
The error envelope
Errors are returned as JSON with a stable shape. violations and timestamp are omitted when empty:
{
"error": "VALIDATION_ERROR",
"message": "Transaction block must balance",
"violations": ["entries: sum of debits (125000) != sum of credits (100000)"],
"timestamp": "2026-07-01T09:14:03.512Z"
}
Two write-path errors use specialized shapes:
Batch size exceeded (413):
{
"error": "BATCH_SIZE_EXCEEDED",
"message": "Batch size 1500 exceeds maximum allowed size of 1000",
"maxBatchSize": 1000,
"requestedSize": 1500
}
Idempotency / conflict responses on event submission (409) include the conflicting entries per domain:
{
"error": "Conflicting derivations for account",
"accountReference": "2700-vat-out",
"conflictingEntries": {
"domain-a": [
{ "accountReference": "2700-vat-out", "amountMinorUnits": 25000, "entryType": "CREDIT" }
]
}
}
HTTP status codes
| Status | Meaning in Ledger17 |
|---|---|
200 OK | Read succeeded |
201 Created | Transaction or correction recorded; Location header points to the resource |
202 Accepted | Business event accepted for asynchronous processing |
204 No Content | Deletion succeeded (dead-letter queue) |
400 Bad Request | Validation failure — unbalanced block, missing field, bad enum value, missing idempotency key |
403 Forbidden | Token lacks the required tenant permission |
404 Not Found | Unknown transaction or resource |
409 Conflict | Idempotency-key replay, duplicate documentReference, or conflicting rule-set derivations |
413 Payload Too Large | Transaction batch exceeds the size limit |
422 Unprocessable Entity | Batch import failed validation (per-item errors in the body) |
500 Internal Server Error | Unexpected failure |
Error-code catalog
Values of the error field you can program against:
| Code | Where |
|---|---|
VALIDATION_ERROR | Any request that fails bean validation |
BAD_REQUEST | Malformed JSON |
INVALID_ARGUMENT | Invalid parameter values |
UNBALANCED_TRANSACTION | Σ debits ≠ Σ credits |
IDEMPOTENCY_CONFLICT | X-Idempotency-Key already used; violations contains existingTransactionId=<uuid> |
DUPLICATE_DOCUMENT_REFERENCE | Batch import: documentReference already exists for tenant |
CONFLICT_DETECTED | Rule sets derived contradictory entries |
ONTOLOGY_VALIDATION_ERROR | Business event violates the rule set’s ontology |
FORBIDDEN, TENANT_ACCESS_DENIED | Permission failures |
TRANSACTION_NOT_FOUND, NOT_FOUND | Unknown resources |
BATCH_SIZE_EXCEEDED | Transaction batch too large |
EVENT_PROCESSING_ERROR, SERIALIZATION_ERROR, INTERNAL_ERROR | Server-side failures |