Skip to main content
POST
/
api
/
v1
/
ledger-entries
Post an unreviewed ledger entry
curl --request POST \
  --url http://localhost:3000/api/v1/ledger-entries \
  --header 'Content-Type: application/json' \
  --data '
{
  "date": "2025-01-30",
  "description": "<string>",
  "debitAccount": 5499,
  "creditAccount": 5499,
  "amount": 12030,
  "currency": "EUR",
  "exchangeRate": 123,
  "taxCode": "UN81"
}
'
{
  "transactions": [
    {
      "id": "682338d9e9500b3ffe4baa5a",
      "date": "2025-01-30",
      "debitAccount": 1020,
      "creditAccount": 3200,
      "description": "Einnahme aus Dienstleistungsverkauf",
      "amount": 10050,
      "grossAmount": 123,
      "currency": "CHF",
      "originalAmount": 123,
      "originalCurrency": "<string>",
      "taxCode": "UN81",
      "isTaxTransaction": false
    }
  ]
}

Creating a new ledger entry

For example, the following payload will create a new ledger entry for the amount of CHF 120.50 (consisting of two ledger transactions – a net transaction and a VAT debt transaction due to the UN81 tax code):
{
    "date": "2025-01-01",
    "description": "Einnahme von 120.50 CHF",
    "debitAccount": 1020,
    "creditAccount": 3200,
    "amount": 12050,
    "currency": "CHF",
    "taxCode": "UN81"
}

Body

application/json

Provide a single ledger entry to create.

date
string<date>
required

The date of the ledger entry in YYYY-MM-DD format.

The transaction date must be within an editable period (e.g. adding transactions in a closed VAT period or outside of an open fiscal year is not allowed).

Example:

"2025-01-30"

description
string
required

The single-line text line for the ledger entry.

Required string length: 1 - 128
debitAccount
integer
required

The account number of the debit account of this ledger entry. An account with this account number must exist to post the transaction.

Required range: 1000 <= x <= 9999
creditAccount
integer
required

The account number of the credit account of this ledger entry. An account with this account number must exist to post the transaction.

Required range: 1000 <= x <= 9999
amount
integer
required

The gross transaction amount in cents (e.g. 12030 = 120.30).

Required range: x >= 1
Example:

12030

currency
string
default:CHF

The 3-character alphanumeric currency code (ISO 4217) for the amount of this transaction. Defaults to the primary accounting currency of Infinity, which currently is always CHF.

Required string length: 3
Example:

"EUR"

exchangeRate
number

A decimal number representing the conversion rate as the rate of the foreign basis unit = X CHF. For example, the exchange rate is 0.98 for Euro if 1 EUR = 0.98 CHF. Not allowed to be zero or negative.

If not provided, defaults to the applicable exchange rate set for the currency in Infinity.

taxCode
enum<string>

The VAT tax code applicable for this ledger entry. Based on the provided tax code, the ledger entry will be appropriately split into a net amount transaction and a VAT debt transaction.

If unset, null, or "", no VAT will be applied to this transaction.

Available options:
UN81,
UN77,
UR26,
UR25,
US38,
US37,
UO81,
UO77,
BZB81,
BZB77,
BZM81,
BZM77,
VM81,
VM38,
VM26,
VB81,
VB38,
VB26,
VM77,
VM37,
VM25,
VB77,
VB37,
VB25,
ES81,
ES26,
ES77,
ES25,
UNO,
UEX,
ULA
Example:

"UN81"

Response

Transactions for this ledger entry were posted successfully.

transactions
Transaction · object[]
required

The transactions that were created for this ledger entry. For transactions with VAT, this may include more than one booking.