Post a ledger entry
Creates a new single ledger entry that is posted as a new transaction.
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 theUN81 tax code):
Retrying safely with idempotency keys
If a request fails or times out, you may not know whether the ledger entry was posted. To retry safely without creating duplicate bookings, provide a uniqueIdempotency-Key header (for example a UUID) with your request:
- Keys are scoped to your organisation and API key.
- Keys are retained for 24 hours. After that, a key can be used again and will post a new entry.
- Reusing a key with a different payload returns
409 Conflictwith error coderest-api/idempotency-key-payload-mismatch. - While a request is still being processed, concurrent requests with the same key return
409 Conflictwith error coderest-api/idempotency-key-request-in-progress. - If a request fails, its key is released, so the same key can be used to retry.
Authorizations
API token for authentication. Obtain from your Infinity account settings.
Headers
A unique key that makes this request idempotent, for example a UUID. If a request fails or times out, it can safely be retried with the same key without creating duplicate bookings: a retry with the same key and payload returns the status and response of the original request, including all VAT-linked transactions it created.
Keys are scoped to your organisation and API key, and are retained for 24 hours. Reusing a key with a different payload returns 409 Conflict. While a request is still being processed, other requests with the same key also return 409 Conflict.
1 - 200Body
Provide a single ledger entry to create.
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).
"2025-01-30"
The single-line text line for the ledger entry.
1 - 128The account number of the debit account of this ledger entry. An account with this account number must exist to post the transaction.
1000 <= x <= 9999The account number of the credit account of this ledger entry. An account with this account number must exist to post the transaction.
1000 <= x <= 9999The gross transaction amount in cents (e.g. 12030 = 120.30).
x >= 112030
The 3-character alphanumeric currency code (ISO 4217) for the amount of this transaction. Must be a currency code of a currency that is enabled in this organisation. Defaults to the primary accounting currency of Infinity, which currently is always CHF.
3"EUR"
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.
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.
See “Liste der MWST-Codes“ for details.
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, ZOLLM, ZOLLB "UN81"
Response
Transactions for this ledger entry were posted successfully.
The transactions that were created for this ledger entry. For transactions with VAT, this may include more than one booking.