# Payments in the ledger and open items

> How a recorded payment books bank against the invoice's receivable, settles it under a matching reference, handles part payments, overpayments, bank fees and exchange differences, and where to see what each customer still owes.

Source: /help/en/accounting/payments-and-open-items

Once the ledger is enabled, every payment you record on an invoice books its own entry in the payments journal, and every credit note application, write-off and refund books one in the general journal. You never write these entries: the posting function reads the payment and the invoice's receivable line, books the entry and matches the two. Posted entries never change: a changed or removed payment is answered with a reversal.

## What a payment books

For a payment of AED 1,050 received by bank transfer against invoice INV-0001 of AED 1,050:

| Account | Debit | Credit | Matching reference |
|---|---|---|---|
| 1100 Bank (or the bank account you picked) | 1,050.00 | | |
| 1200 Trade receivables, customer, due date | | 1,050.00 | SAL/2026/0001 |

- **Bank** is the ledger account of the bank account chosen on the payment (link one under **Bank** or in the chart of accounts); without one, the pack's default bank account. A bank account without a ledger account refuses the posting (`bank_account_unmapped`).
- **Receivable** is the same account and customer as the invoice's entry. The payment's line and the invoice's line are matched under the invoice entry's number: that is the shared **matching reference** of the group, and the matched amount grows on both sides until the invoice line is settled in full (F-LEDGER-307).
- A **part payment** settles part of the line; the open item shrinks and closes with the last payment.
- An **overpayment** settles the invoice and leaves the excess as an open credit of the customer, on the receivable account, with no reference yet. A later invoice can be settled with it ([apply credits](/help/en/invoices/apply-credits-and-refunds)) or it can be refunded.
- A **bank fee withheld** from the transfer is entered on the payment: the invoice is settled for the full amount, the bank account is debited for the amount less the fee, and the fee books to 6330 Bank charges.

The entry is dated on the payment date, numbered in the payments journal (`PAY/2026/0001`), and the payment and the entry point at each other: the Payments card shows a book icon that opens the entry, or **Not posted** with the reason.

## Exchange differences

A foreign-currency invoice was booked in AED at its own rate. The payment converts at the rate of the payment date: the Central Bank rate loaded under **Exchange Rates**, or the rate you enter on the payment. The receivable is still settled at the invoice rate; the difference between what the bank received and what was receivable books to 4500 Realised foreign exchange gain or 6900 Realised foreign exchange loss in the same entry (F-LEDGER-014, the realised side; revaluation of open balances comes in a later phase).

For a USD 1,050 invoice booked at 3.6725 (AED 3,856.13) and paid at 3.70:

| Account | Debit | Credit |
|---|---|---|
| 1100 Bank | 3,885.00 | |
| 1200 Trade receivables | | 3,856.13 |
| 4500 Realised foreign exchange gain | | 28.87 |

No rate within ten days of the payment date refuses the posting (`rate_missing`); an exchange difference with no FX gain or loss account refuses it too (`fx_accounts_missing`), never booked one-sided. Payments must be in the invoice currency (`currency_mismatch`).

## Reversals, not edits

- **Removing a payment** reverses its entry under the next number and releases the matched amount on the invoice line: the invoice is open again. The entry itself stays in the books, marked reversed.
- **Changing** a posted payment (amount, date, bank account, fee, rate) reverses the old entry and books a new one. A change that leaves the booking the same, such as the note, does nothing to the books.
- A payment whose overpayment was refunded or applied elsewhere cannot be removed first (`payment_in_use`): remove the refund or the application, then the payment.
- When an invoice is re-posted after a change, its payments re-match the new entry by themselves. An archived or test invoice has its payments' entries reversed.

## Open items

**Accounting → Open Items** lists the receivable and payable lines not yet settled in full, per contact: the entry and its document, the amount, what is matched and what is still open, in AED and in the line's own currency. A **debit** is owed by the customer (an invoice); a **credit** is owed to them (a credit note not yet applied, an overpayment). Tick *Include settled lines* to see the full matching history of a customer. The same list is `GET /ledger/open-items` in the API and `list_open_items` in the MCP server.

## When a payment is not posted

The card shows **Not posted** with the reason, and the payment itself is recorded as before: a refusal never blocks a payment.

| Reason | What to do |
|---|---|
| `document_not_posted` | The invoice has no ledger entry yet. Post it (or fix its refusal); the payment then books by itself. |
| `rate_missing` | Load the Central Bank rates under Exchange Rates, or enter the rate on the payment. |
| `bank_account_unmapped` | Link a ledger account to the bank account. |
| `fx_accounts_missing` | Set the FX gain and loss accounts under Settings → Company → Accounting. |
| `currency_mismatch` | Record the payment in the invoice currency. |
| `period_locked` | The payment date is in a locked period. |

After fixing the cause, click **Post** on the row, or call `POST /invoices/{id}/payments/{paymentId}/ledger/post` (`post_payment_to_ledger` in MCP). `GET …/ledger/preview` shows the entry a payment would book without writing it. Automatic posting of payments can be switched off under **Settings → Company → Accounting → Posting of documents**.

## Undeposited funds (F-BANK-014)

Cash, cheques and card receipts reach the bank days after the customer paid, and the statement shows one deposit for a batch of them. Switch on **Settle cash, cheque and card receipts to undeposited funds** under **Settings → Company → Accounting → Posting of documents**: a payment by cash, cheque or card then books Dr **1160 Undeposited funds** / Cr receivable instead of the bank, and the open item is settled all the same. Take the batch to the bank and record the **Deposit** on the Bank page: one entry moves the total from 1160 to the bank account, and the statement line matches the deposit as one line. A bank-transfer receipt still books to the bank at once. See [Transfers, FX and deposits](/help/en/bank/transfers-fx-and-deposits).

## Short payments (F-AR-004)

A receipt a little short of its invoice (the payer's bank kept a fee) can settle the invoice in full with the shortfall written off. Settings → Accounting → **Short payments** sets the tolerance (an amount and/or a percent of the open amount; zero keeps the agent off), the write-off account (default: the bank charges account) and the mode: **Ask** puts a proposal in the bank triage naming the invoice and the shortfall, **Auto** books it when the receipt is matched. The payment is a normal payment with a fee leg: the receivable is credited the invoice amount, the bank debited what arrived, the write-off account the difference (`fee_kind = short_payment`), and the entry is labelled *Payment for … with the shortfall written off*. Every write-off is a change batch (tool `short_payment_agent`): undo it from Compliance → Batches and the invoice reopens. A receipt short by more than the tolerance is left for a partial payment; `match_bank_transaction` refuses `short_payment_over_tolerance` when asked to settle more than the tolerance allows. Details and the walkthrough: [AI coding memory, new vendors and suggested rules](/help/en/bank/ai-coding-memory-and-suggested-rules).

## In the API and the MCP server

- `POST /invoices/{id}/payments` takes `bankAccountId`, `feeAmount` and `exchangeRate` besides the amount, date and method; the answer carries `ledgerEntryId` or `ledgerPostError`.
- `DELETE /invoices/{id}/payments/{paymentId}` removes a payment, credit application or write-off; its entry is reversed.
- `GET /ledger/open-items?contactId=…` lists open items; `includeClosed=true` adds the settled lines.
- MCP: `record_invoice_payment`, `delete_invoice_payment`, `preview_payment_posting`, `post_payment_to_ledger`, `list_open_items`.

Related:

- [Posting invoices to the ledger](/help/en/accounting/posting-invoices-to-the-ledger)
- [Apply credits and refunds](/help/en/invoices/apply-credits-and-refunds)
- [Write off an invoice](/help/en/invoices/write-offs)
- [Record payments and payment status](/help/en/invoices/payments-and-payment-status)
