# POST /api/v1/journal-entries

> Create journal entry

- **Tag:** journal-entries
- **Operation ID:** `create_journal_entry_api_v1_journal_entries_post`

## Description

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

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Request body

Schema: `JournalEntryCreateRequest`

- `description` (string) — Human-readable description of the journal entry. Should describe the transaction being recorded.
- `currency` (string) — Currency for the journal entry (USD, CAD, AUD, EUR, or GBP). Defaults to business default.
- `date` (string · date) — The date when this transaction occurred. Use ISO 8601 date format (YYYY-MM-DD).
- `line_entries` (array · object) — 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_id` (string) — Optional UUID of an invoice to link this journal entry to. Useful for tracking revenue recognition.
- `inventory_order_id` (string) — Optional UUID of an inventory order (PO) to link this journal entry to. Useful for the PO audit trail.

## Responses

### 201 — Successful Response

Schema: `JournalEntryResponse`

- `id` (string · required) — Unique identifier for this journal entry (UUID7).
- `description` (string · required) — Human-readable description of the transaction.
- `currency` (string) — Currency for the journal entry (USD, CAD, AUD, EUR, or GBP).
- `entry_date` (string · date · required) — The date this transaction occurred.
- `invoice_id` (string) — UUID of linked invoice, if this entry relates to an invoice.
- `inventory_order_id` (string) — UUID of linked inventory order (PO), if this entry relates to a PO.
- `source` (string) — Backend origin: manual, invoice, bill, credit_memo, transaction, stripe, shopify, plaid, ramp, square, system, teal
- `creation_method` (string) — User-facing creation method: ai (system-generated) or manual (user-typed)
- `business_id` (string · required) — UUID of the business this entry belongs to.
- `line_entries` (array · LineEntryResponse) — The debit and credit line entries that make up this journal entry. Will be empty list if not expanded.
- `thread` (JournalEntryThreadResponse) — Comment thread information if this journal entry has comments. Contains thread_id, comments array, and comment_count.
- `created_at` (string · date-time) — When this journal entry was created.
- `updated_at` (string · date-time) — When this journal entry was last modified.

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/journal-entries' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "description": "string",
  "currency": "string",
  "date": "2026-01-01",
  "line_entries": [],
  "invoice_id": "string",
  "inventory_order_id": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/journal-entries', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "description": "string",
  "currency": "string",
  "date": "2026-01-01",
  "line_entries": [],
  "invoice_id": "string",
  "inventory_order_id": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "description": "string",
  "currency": "string",
  "date": "2026-01-01",
  "line_entries": [],
  "invoice_id": "string",
  "inventory_order_id": "string"
}

response = httpx.post("https://api.ondayzero.com/api/v1/journal-entries", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/journal-entries/create-journal-entry
- OpenAPI slice: https://www.ondayzero.com/docs/reference/journal-entries/create-journal-entry/openapi.json
- Other endpoints in **journal-entries**: https://www.ondayzero.com/docs/reference/journal-entries
