---
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`

Create a ledger entry


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

## 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
  - `ledger_attachment_id` integer — Ledger attachment ID. > ⚠️ This attribute is deprecated and will be removed soon. Please use `file_attachment_id` instead.
  - `file_attachment_id` integer — File attachment ID (replaces deprecated `ledger_attachment_id`)
  - `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' | '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.
    - `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 file attached to the ledger entry.
    - `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

---

[API](https://skmtc.net/pennylane/apis/company-v2.md) · [All operations](https://skmtc.net/pennylane/apis/company-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pennylane/company-v2/versions/a5b7236473c6/schema)
