# Pay bills in a batch

> Select up to 50 bills and pay them in one run from one bank account with one method and date: each bill is paid exactly once, bills that cannot be paid are skipped with the reason, re-running the batch records nothing twice, and each supplier gets one remittance advice per payment.

Source: /help/en/bills/pay-bills-in-a-batch

A batch pays several bills at once, each for its outstanding amount, with one bank account, one method and one payment date for the run. Every payment is an ordinary [supplier payment](/help/en/bills/pay-bills-and-remittance-advice): with the [ledger](/help/en/accounting/enable-the-ledger) enabled it settles the bill's payable at the bill rate and credits the bank account at the payment-date rate. What a batch adds is the guarantee that each bill is paid **once**, whatever happens: the run is one transaction, a bill can carry one payment per batch, and a batch that is run again (the same key) answers the first run and records nothing.

## Pay selected bills

On **Incoming Invoices → Bills**:

1. **Select.** Checkboxes appear on the bills that can be paid: accepted, not voided, not fully paid, and not waiting for approval or declined. Tick bills one by one or **Select all payable bills** (the first 50 are kept; a batch pays up to 50 bills).
2. **Pay selected.** The dialog shows how many bills and how much is outstanding, by currency.
3. **Paid from.** The bank or cash account the money leaves. The account marked as default for payments under **Settings → Payments & bank** is proposed. With the ledger enabled the account needs a ledger account (`bank_account_unmapped` otherwise); a deactivated account is refused (`bank_account_inactive`).
4. **Method and payment date.** One method (bank transfer, cash, cheque, card, online, other) and one date for every payment of the batch. To pay some bills by transfer and others by cheque, run two batches.
5. **Bank reference.** Optional; written on every payment and on the remittance advice.
6. **E-mail a remittance advice to each supplier.** Ticked, one advice per payment goes out after the batch is recorded, in the language chosen, from the **remittance** template under **Settings → Document dispatch**. Suppliers without an e-mail address are reported, the batch is still paid.
7. **Pay N bills.** The result lists every bill: paid for how much, with its ledger entry, or skipped and why.

Bills in another currency than the bank account are paid in the bill currency at the Central Bank rate of the payment date; without a rate on that date the bill is skipped (`currency_without_rate`): load the rates or pay it from the bill page with a rate of your own.

## What is skipped, what is paid

A batch never fails because of one bill. Each bill answers one of:

| Result | Meaning |
|---|---|
| Paid | One payment for the outstanding amount, from the batch's account, with its method, date and reference; the ledger entry (or the refusal recorded on the payment) is shown. |
| Waiting for approval | The bill's [approval](/help/en/bills/record-and-approve-a-bill) is pending (`pending_approval`); approve it and run a new batch. |
| Declined by its approvers | `approval_declined`; request approval again after the correction. |
| Already paid | Nothing outstanding (`paid`). |
| Voided | A voided bill takes no payment (`voided`). |
| Not accepted | A draft, a bill in review or an archived one (`not_accepted`). |
| No exchange rate | Another currency than the bank account and no rate for the payment date (`currency_without_rate`). |
| Held: a change to the supplier's bank details waits for approval | The supplier has a bank change waiting and the organisation holds payments meanwhile (`bank_change_pending`); see below. |

Inside a batch bills are paid oldest due date first, so with several bills of one supplier the oldest open items settle first. The payments of a batch are reversed one by one if needed, as single payments are; the batch itself is a record of what was run and never changes.

## A supplier whose bank change is waiting

A new, replaced, retired or default bank account of a supplier is a request that waits for members who hold the money movement class (see [The supplier portal](/help/en/portal/supplier-portal#bank-details-and-why-a-change-waits)). While it waits and **Settings → Workspace → Portal** → **Supplier bank details** → **Hold payments while a change waits** is on (the default):

- The batch skips every bill of that supplier with the reason **Held: a change to the supplier's bank details waits for approval** (`bank_change_pending`) and pays the other bills. Nothing is recorded for the held bills.
- **Record payment** on such a bill is refused too, with *Payments to this supplier are held while a change to its bank details waits for approval.*
- The supplier's **Bank accounts** card reads *Payments to this supplier are held*.

Approve, reject or withdraw the change on the supplier's **Change requests** card (or approve it in **Approvals**), then run a new batch for the held bills. Any waiting bank change holds, an added account included. A bank line already booked and matched to the bill is still recorded, because the money has left; vendor credits and refunds from the supplier are not held. Over the API the skipped row reads `status` `skipped` with `reason` `bank_change_pending` and a `message`.

Each payment is stamped with the supplier's default approved bank account of the day, and the remittance advice names it by its last four characters (*Paid to the account ending 3456*).

## The Payment batches tab

**Incoming Invoices → Payment batches** lists every run: date, key, account paid from, method, bills, paid, skipped, total in the base currency, how many remittance advices went out, state (**Completed**: every bill paid; **Partly paid**: some skipped; **Nothing paid**) and who ran it. Open a batch for the result of each bill, its payment, its entry and whether the advice went out. The audit log records each run (`bills.batch_paid`).

## Through the API and AI assistants

- `POST /bills/pay-batch { idempotencyKey, bankAccountId, billIds, date, method, reference, sendRemittance, language, exchangeRates }` pays up to 50 bills and answers the batch with one `results` row per bill (`status` paid or skipped, `reason`, `paymentId`, `ledgerEntryId`, `ledgerPostError`, `remittanceSentAt`). Give every run its own `idempotencyKey`: the same key twice answers the first batch with `replay: true` and records or sends nothing. `exchangeRates` names the base-currency rate per bill currency when the Central Bank rate is not loaded (`{ "USD": 3.6725 }`). With `sendRemittance: true` the response lists each advice sent in `remittance` (state `sent`, `skipped` without a provider, or `failed`).
- `GET /bills/payment-batches` lists the runs (without results); `GET /bills/payment-batches/{id}` returns one with its results.
- Refused as a whole, before anything is recorded: more than 50 bills (`batch_too_large`), no key (`invalid_batch`), no bills (`nothing_selected`), an unknown bank account (`bank_account_not_found`), an inactive or unmapped one (`bank_account_inactive`, `bank_account_unmapped`), or a role that cannot pay (`forbidden`).
- Assistants use `pay_bills_batch` (confirm the bills, the account and the date first), `list_payment_batches` and `get_payment_batch`; the single-payment tools `record_bill_payment` and `email_remittance_advice` stay for one bill at a time.

## Related

- [Pay a bill and send a remittance advice](/help/en/bills/pay-bills-and-remittance-advice)
- [Record and approve a bill](/help/en/bills/record-and-approve-a-bill)
- [Payments, open items and credits](/help/en/accounting/payments-and-open-items)
