POST
/
api
/
external
/
v2
/
ledger_entries
Create a ledger entry
curl --request POST \
  --url https://app.pennylane.com/api/external/v2/ledger_entries \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "date": "2023-08-30",
  "label": "Payment for Services",
  "journal_id": 123,
  "ledger_attachment_id": 42,
  "currency": "EUR",
  "ledger_entry_lines": [
    {
      "debit": "100.00",
      "credit": "0.00",
      "ledger_account_id": 987,
      "label": "Transaction label"
    }
  ]
}'
{
  "id": 1,
  "label": "Payment for Services",
  "date": "2023-08-30",
  "journal_id": 123,
  "ledger_attachment_filename": "filename.pdf",
  "ledger_attachment_id": 42,
  "ledger_entry_lines": [
    {
      "id": 42,
      "debit": "100.00",
      "credit": "0.00",
      "ledger_account_id": 987,
      "label": "Transaction label"
    }
  ]
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
date
string<date>
required

<span style="color: red;">date-time</span> format is deprecated. Please use date format (ISO 8601).

Example:

"2023-08-30"

label
string
required

Label that describes the ledger entry

Example:

"Payment for Services"

journal_id
integer
required

The journal ID where you want to create the ledger entry

Example:

123

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.

ledger_attachment_id
integer

Ledger attachment ID

Example:

42

currency
enum<string>

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

Available options:
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,
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
Example:

"EUR"

Response

Returns the created ledger entry

id
integer
required

ID of the ledger entry

Example:

1

label
string
required

Label that describes the ledger entry

Example:

"Payment for Services"

date
string<date>
required

Date of the ledger entry (ISO 8601)

Example:

"2023-08-30"

journal_id
integer
required

The journal ID where the ledger entry was created

Example:

123

ledger_attachment_filename
string | null
required

Attachment's filename

Example:

"filename.pdf"

ledger_attachment_id
integer | null
required

Ledger attachment ID

Example:

42

ledger_entry_lines
object[]
required

Array of ledger entry lines