---
title: "Create a ledger entry"
method: POST
path: "/api/external/v2/ledger_entries"
tags: ["Ledger Entries"]
---

# Create a ledger entry

`POST /api/external/v2/ledger_entries`

## Request

- Base URL: `https://app.pennylane.com`
- URL: `https://app.pennylane.com/api/external/v2/ledger_entries`
- Auth: OAuth 2
  - Authorization code: `https://app.pennylane.com/oauth/authorize`
  - Token URL: `https://app.pennylane.com/oauth/oauth/token` scopes: `ledger_entries:all`

Create a ledger entry


> ℹ️
> This endpoint requires the following scope: `ledger_entries:all`

## Headers

- `X-Company-Id` string

## Request body

- object
  - `date` string, date, required: Date of the ledger entry (ISO 8601)
  - `due_date` string, date, nullable: Due date of the ledger entry (ISO 8601)
  - `label` string, required: Label that describes the ledger entry
  - `journal_id` integer, required: The journal ID where you want to create the ledger entry
  - `file_attachment_id` integer: File attachment ID. > ⚠️ Passing this field will soon be deprecated. We will provide an alternative using `/api/external/v2/ledger_entries/{id}/dms_files`.
  - `currency` 'EUR' | 'USD' | 'GBP' | 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BYR' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'FJD' | 'FKP' | 'GEL' | 'GGP' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'IMP' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JEP' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LTL' | 'LVL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRO' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SLE' | 'SOS' | 'SRD' | 'STD' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'UYU' | 'UZS' | 'VEF' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XDR' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMK' | 'ZMW' | 'ZWL': Currency code of the ledger entry as per ISO 4217. If not provided, EUR will be used. This currency is applicable to all ledger_entry_lines
  - `piece_number` string: A piece number you can provide to track this ledger entry. If not provided, Pennylane will generate an identifier for you.
  - `ledger_entry_lines` object[], required: Array of ledger entry lines. The entry lines must be balanced. The max number of ledger entry lines that you can create using this endpoint is 1000 per request. > ⚠️ The order of `ledger_entry_lines` in the response is not guaranteed to match the order in which they were sent. To map source lines to their returned `ledger_entry_line.id`, match by content (e.g. `debit`, `credit`, `label`) rather than by position.
    - `debit` string, required: Debit amount for the entry line
    - `credit` string, required: Credit amount for the entry line
    - `ledger_account_id` integer, required: Ledger account ID
    - `label` string: Label that describes the entry line

## Response `201`

Returns the created ledger entry

- object
  - `id` integer, required: ID of the ledger entry
  - `label` string, required: Label that describes the ledger entry
  - `piece_number` string, nullable, required
  - `date` string, date, required: Date of the ledger entry (ISO 8601)
  - `due_date` string, date, nullable, required: The date the invoice is due
  - `invoice_number` string, nullable, required: Invoice number of the document linked to the ledger entry
  - `journal_id` integer, required: This attribute is **deprecated**. Please use `journal` instead. The journal ID where the ledger entry was created
  - `journal` object, required
    - `id` integer, required
    - `url` string, required
  - `status` 'accounting_needed' | 'archived' | 'complete' | 'draft' | 'entry' | 'validation_needed' | 'waiting_details', nullable, required: The accounting state of the entry. - `archived`: The entry has been archived. - `draft`: The customer invoice is still in draft and has not been finalized. - `entry`: The invoice is incomplete, some information is missing and needs to be completed. - `waiting_details`: The entry is awaiting additional accounting details. - `validation_needed`: The entry is sent to the accountant and needs validation. - `accounting_needed`: The entry needs to be processed by the accountant. - `complete`: The entry has been validated by the accountant. - `null` : The entry is neither a transaction nor an invoice that needs to be processed on Pennylane
  - `categories` object[], required
    - `id` integer, required
    - `label` string, required
    - `weight` string, required
    - `category_group` object, required
      - `id` integer, required
    - `analytical_code` string, nullable, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `ledger_attachment_filename` string, nullable, required: This attribute is deprecated. Please use `filename` from `attachment` instead.
  - `ledger_attachment_id` integer, nullable, required: This attribute is deprecated. Ledger attachment ID
  - `attachment` object, nullable, required: The primary accounting file of this ledger entry. For invoices and most document types this is auto-generated by Pennylane. For miscellaneous entries (OD) it can be set via `file_attachment_id` on create/update, though that behavior will soon be deprecated. Files attached through the Pennylane UI are exposed separately via `GET /api/external/v2/ledger_entries/{id}/dms_files`.
    - `filename` string, required
    - `url` string, required: URL to the uploaded file.
  - `ledger_entry_lines` object[], required: Array of entry lines
    - `id` integer, required: ID of the entry line
    - `debit` string, required: Debit amount for the entry line
    - `credit` string, required: Credit amount for the entry line
    - `ledger_account_id` integer, required: This attribute is deprecated. Please use `id` from `ledger_account` instead.
    - `ledger_account` object, required
      - `id` integer, required: Ledger account ID
      - `number` string, required: Ledger account number
      - `url` string, required: The URL to the ledger account
    - `label` string, required: Label that describes the entry line

## Other responses

- `400`: Bad request
- `401`: Access token is missing or invalid
- `403`: Access to this resource forbidden
- `404`: The resource was not found
- `422`: Unprocessable content

## Changes

- **2026-11-03** `871f863307e5`: 1 warning, 2 info
  - removed the request property `ledger_attachment_id`
  - added the new optional `header` request parameter `X-Company-Id`
  - added the new `VES` enum value to the request property `currency`

[Operation history](https://skmtc.dev/pennylane/apis/company-v2/changes/api/external/v2/ledger_entries/post.md)

---

[API](https://skmtc.dev/pennylane/apis/company-v2.md) - [All operations](https://skmtc.dev/pennylane/apis/company-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/pennylane/apis/company-v2/revisions/871f863307e5?raw)
