askledgerDocs
REST-APITransactions
Documentatie

Book a bank entry

POST
/ledgers/{ledgerId}/bank-entries

Book a bank or credit card entry (Exact: bankboeking) in the accounting package. This is a permanent change to the books. Look up journalCode with list-reference-data (kind 'journals', journalType 'bank'), ledger accounts with search-ledger-accounts and contacts with search-contacts. The user must confirm before it is booked. If the result has created=false and a confirmation object, nothing was created yet: show confirmation.summary to the user verbatim and ask whether to create the booking. Only after the user explicitly says yes in the chat, call create-bank-entry again with exactly the same arguments plus confirmationToken. Never confirm on the user's behalf and never reuse a token for other arguments.

A write: over REST only LedgerSuite products with askledger:purchase-write can call it, after their user approved the write in the product (no confirmation is asked). Other callers get 403 confirmation_required and use the MCP tool, which asks the user to confirm. Purchase entries: 409 duplicate when the package already has the booking (same supplier and invoice number); nothing was booked then. Send an Idempotency-Key to make retries safe.

Requires the ledger:write scope (Wijzigen in Exact). Same operation as the MCP tool create-bank-entry.

Authorization

bearer
headerAuthorizationBearer <token>

A company group API key (al_live_…, created at /dashboard/api), an OAuth access token from the same authorization flow MCP clients use, or (other LedgerSuite products, /administrations routes only) a LedgerSuite client_credentials token.

Path Parameters

ledgerId*string

Ledger (administration) id, from list-ledgers

Length1 <= length

Header Parameters

Idempotency-Key?string

Unique per write (e.g. your own id for it), at most 255 characters. A retry with the same key and body gets the first response again (header Idempotent-Replayed: true) instead of a second write; the same key with another body answers 422 idempotency_key_reused, and a retry while the first request still runs 409 idempotency_in_progress. Kept for 7 days.

Lengthlength <= 255

Request Body

application/json
  1. body
journalCode*string

Bank or credit card journal code

Length1 <= length
financialYear?integer

Financial year; from the line dates when omitted

Range1900 <= value <= 9999
financialPeriod?integer

Financial period; from the line dates when omitted

Range1 <= value <= 99
currency?string

ISO 4217 currency; the journal's currency when omitted

Match^[A-Z]{3}$
lines*array<>

Entry lines

Items1 <= items <= 100

Response Body

OK

application/json
  1. response
created*boolean
message*string
confirmation*|null
entry*|null
curl -X POST "https://example.com/ledgers/string/bank-entries" \  -H "Content-Type: application/json" \  -d '{    "journalCode": "string",    "lines": [      {        "ledgerAccount": "string",        "amount": 0,        "date": "2019-08-24"      }    ]  }'
{  "created": true,  "message": "string",  "confirmation": {    "token": "string",    "summary": "string",    "expiresInSeconds": 0  },  "entry": {    "ledgerId": "string",    "remoteId": "string",    "entryNumber": 0  }}