Create journal entry

POST/api/v1/journal-entries

Create a new double-entry journal entry with balanced line entries.

Operation ID: create_journal_entry·View as markdown·OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

descriptionstring

Human-readable description of the journal entry. Should describe the transaction being recorded.

currencystring

Currency for the journal entry (USD, CAD, AUD, EUR, or GBP). Defaults to business default.

datestring · date

The date when this transaction occurred. Use ISO 8601 date format (YYYY-MM-DD).

line_entriesarray · JournalLineEntryCreate

Array of line entries (minimum 2). Total debits must equal total credits. Each entry requires: amount (integer in cents), debit_credit ('debit' or 'credit'), ledger_id (UUID of target ledger account), description (what this line represents).

invoice_idstring

Optional UUID of an invoice to link this journal entry to. Useful for tracking revenue recognition.

inventory_order_idstring

Optional UUID of an inventory order (PO) to link this journal entry to. Useful for the PO audit trail.

combine_duplicate_linesboolean

When true, lines sharing the same ledger_id, debit_credit and counterparty_name are summed into one line (descriptions joined with '; ') before validation. When false, duplicate lines are refused with VALIDATION_206.

Responses

201Successful Response

successboolean
messagestring
codestring
dataJournalEntryResponse

400Bad Request - Invalid input

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

401Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

403Forbidden - Insufficient permissions

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

422Validation Error

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.