v1

latestOpenAPI 3.0.12026-07-141671231.8 MB
Ledger Entries

Update a ledger entry

Update a ledger entry

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

put/api/external/v2/ledger_entries/{id}

Path parameters

idstring required

The unique identifier of the ledger entry

Request body

datestring date

Date of the ledger entry (ISO 8601)

labelstring

Label that describes the ledger entry

journal_idinteger

The journal ID where you want to create the ledger entry

ledger_attachment_idinteger

Ledger attachment ID.

⚠️ This attribute is deprecated and will be removed soon. Please use file_attachment_id instead.

file_attachment_idinteger

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. This currency is applicable to all ledger_entry_lines

piece_numberstring

The piece number that was assigned during creation either by you or Pennylane.

Example request

{
  "date": "2023-08-30",
  "label": "Payment for Services",
  "journal_id": 123,
  "ledger_attachment_id": 42,
  "file_attachment_id": 42,
  "currency": "EUR",
  "piece_number": "TENSNYLUGV",
  "ledger_entry_lines": {
    "create": [
      {
        "debit": "100.00",
        "credit": "0.00",
        "ledger_account_id": 987,
        "label": "Transaction label"
      }
    ],
    "update": [
      {
        "id": 42,
        "debit": "100.00",
        "credit": "0.00",
        "ledger_account_id": 421,
        "label": "Transaction label"
      }
    ],
    "delete": [
      {
        "id": 42
      }
    ]
  }
}

Response

Returns the updated ledger entry

idinteger required

ID of the ledger entry

labelstring required

Label that describes the ledger entry

piece_numberstring nullable required
datestring date required

Date of the ledger entry (ISO 8601)

due_datestring date nullable required

The date the invoice is due

invoice_numberstring nullable required

Invoice number of the document linked to the ledger entry

journal_idinteger required

This attribute is deprecated. Please use journal instead. The journal ID where the ledger entry was created

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
ledger_attachment_filenamestring nullable required

This attribute is deprecated. Please use filename from attachment instead.

ledger_attachment_idinteger nullable required

This attribute is deprecated. Ledger attachment ID

Example response

{
  "id": 1,
  "label": "Payment for Services",
  "piece_number": "TENSNYLUGV",
  "date": "2023-08-30",
  "due_date": "2023-08-30",
  "invoice_number": "FAC-2024-001",
  "journal_id": 123,
  "journal": {
    "id": 123,
    "url": "https://app.pennylane.com/api/external/v2/journals/123"
  },
  "categories": [
    {
      "id": 421,
      "label": "HR - Salaries",
      "weight": "0.25",
      "category_group": {
        "id": 229
      },
      "analytical_code": "CODE123",
      "created_at": "2023-08-30T10:08:08.146343Z",
      "updated_at": "2023-08-30T10:08:08.146343Z"
    }
  ],
  "ledger_attachment_filename": "filename.pdf",
  "ledger_attachment_id": 42,
  "attachment": {
    "filename": "filename.pdf",
    "url": "http://www.pennylane.com/rails/active_storage/blobs/redirect/eyJfc..==--26d6e7391dd728fae2cde59bd3fbe4dd11e20a95/filename.pdf"
  },
  "ledger_entry_lines": [
    {
      "id": 42,
      "debit": "100.00",
      "credit": "0.00",
      "ledger_account_id": 987,
      "ledger_account": {
        "id": 987,
        "number": "411000",
        "url": "https://app.pennylane.com/api/external/v2/ledger_accounts/42"
      },
      "label": "Transaction label"
    }
  ]
}