---
name: "purchasing_pay_bills"
area: "purchasing"
title: "Pay bills in a batch"
price: "$0.01 per bill paid"
method: "POST"
url: "https://api.conecto.chat/v1/tools/purchasing_pay_bills"
mcp_server: "https://api.conecto.chat/mcp/purchasing"
auth: "Authorization: Bearer <conecto_sk_ key>"
docs_url: "https://conecto.chat/tools/purchasing/purchasing_pay_bills"
---

# Pay bills in a batch (`purchasing_pay_bills`)

Pays several bills at once from one bank account, like Xero's batch payments, with the SEPA file to upload to the bank.

Pay several bills at once from one bank account, like Xero's batch payments: bills (each with an optional amount, else its balance), or every unpaid bill due on or before due_before (one supplier's with supplier). One payment per bill on date, posted to the books from bank_account (default: where bank transfers land). sepa_file: true adds the SEPA credit transfer file (pain.001) to upload to the bank, paying each supplier's IBAN with the bill's reference; the bank books the batch as one line, which books_bank_lines then suggests matching to all its payments at once. All of it is paid or none.

Price: $0.01 per bill paid. A call that fails costs nothing.

## Use it when

The business pays its suppliers in one go, say every Friday or before the month ends.

- For one bill, or money back from a supplier, use [purchasing_pay_bill](https://conecto.chat/tools/purchasing/purchasing_pay_bill.md).

## Say this to your agent

> Pay every bill due by the end of October from the business account and give me the bank file.

## Inputs

| Name | Type | Required | Description | Allowed values | Default |
|---|---|---|---|---|---|
| `bills` | array of objects | no | 1 to 200 items. |  |  |
| `bills[].bill_id` | string | yes, in each item of `bills` | The bill_id purchasing_create_bill returned. Exactly 36 characters. |  |  |
| `bills[].amount` | number or string | no | Part of it. Default: what is still owed. Up to 24 characters. |  |  |
| `due_before` | string | no | Every unpaid bill due on or before this day, instead of bills. Matches ^\\d{4}-\\d{2}-\\d{2}$. |  |  |
| `supplier` | integer or string | no | A supplier_id, or the supplier's name. 1 to 200 characters, at least 1. |  |  |
| `date` | string | no | The day it is paid. Default today. Matches ^\\d{4}-\\d{2}-\\d{2}$. |  |  |
| `bank_account` | string | no | The books' bank account it is paid from, by code. Up to 20 characters. |  |  |
| `sepa_file` | boolean | no |  |  | `false` |
| `from_iban` | string | no | The IBAN it is paid from, when not the bank account's own. Up to 42 characters. |  |  |
| `from_bic` | string | no | Up to 11 characters. |  |  |

## Example

Written for Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff.

MCP: call `purchasing_pay_bills` on the MCP server `https://api.conecto.chat/mcp/purchasing` with these arguments:

```json
{
  "due_before": "2026-10-31",
  "sepa_file": true
}
```

REST:

```bash
curl https://api.conecto.chat/v1/tools/purchasing_pay_bills \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"due_before": "2026-10-31", "sepa_file": true}'
```

## Response

```json
{
  "call_id": "5f0c8a2e-3b7d-4c1e-9a64-2d8e1f7b0c93",
  "tool": "purchasing_pay_bills",
  "status": "succeeded",
  "replayed": false,
  "cost_usd": "$0.02",
  "balance_usd": "$19.75",
  "result": {
    "batch": {
      "number": "PB-0001",
      "date": "2026-10-14",
      "currency": "EUR",
      "total": "1102.50",
      "count": 2,
      "account": "1010",
      "payments": [
        {
          "payment_id": 4101,
          "bill_id": "f1903745-74dc-412a-8d56-64333a46e3ea",
          "supplier": "Kühlmann Kältetechnik",
          "reference": "KK-40177",
          "amount": "640.00"
        },
        {
          "payment_id": 4102,
          "bill_id": "85d29c16-34b2-409f-b115-c78beebdf308",
          "supplier": "Nordstahl Küchentechnik GmbH",
          "reference": "NS-2026-1188",
          "amount": "462.50"
        }
      ],
      "file": {
        "file_id": "a069debb-b3a9-4d4c-af8a-6a6cc20e067a",
        "name": "SEPA PB-0001.xml",
        "content_type": "application/xml",
        "size": "1.3 KB",
        "size_bytes": 1327,
        "sha256": "e8df23c27f05fdbd2d95bd5265dd749fb114dcd25837bd395643ac1b861cdeca",
        "created_at": "2026-10-14T08:00:00+00:00",
        "download_url": "https://cncto.co/d/a069debb-b3a9-4d4c-af8a-6a6cc20e067a?t=eyJmIjoiYTA2OWRlYmItYjNhOS00ZDRjLWFmOGEtNmE2Y2MyMGUwNjdhIiwiZXhwIjoxNzkyOTc4NTUzfQ:1xIcI5:2m5OcvUkenNE1HhgrV138tA1DiouWmZlBn_6SaUhgdk",
        "link_expires_in_hours": 168
      }
    }
  }
}
```

`result`: batch: its number, date, currency, total, the bank account, each payment (bill, supplier, reference, amount) and with sepa_file the file with its download link.

## Errors

| Code | Status | When | Fix |
|---|---|---|---|
| `unbalanced` | 400 | The debits and credits do not add up to the same amount. | Make the lines balance. |
| `before_start` | 409 | The date is before the books start. | Use a later date. |
| `period_locked` | 409 | The books are locked for that date. | Use a later date, or unlock with books_lock. |
| `no_rate` | 409 | There is no exchange rate for the currency on that day. | Pass rate, or set a standing rate with books_setup rates. |
| `rates_loading` | 503 | The day's exchange rates are still loading. | Try again in a few minutes, or pass rate. |
| `invalid_input` | 400 | Neither bills nor due_before, or both; the date is in the future; a bill is in it twice; the bills are in different currencies; or a SEPA file for bills not in euros. | Fix what the message names. |
| `not_found` | 404 | No unpaid bill is due by due_before, or a bill_id is unknown. | List them with purchasing_list_bills. |
| `void` | 409 | A bill is void. | Leave it out. |
| `already_paid` | 409 | A bill is paid in full. | Leave it out. |
| `more_than_balance` | 409 | An amount is more than its bill's balance. | Pay at most the balance. |
| `no_iban` | 409 | For the SEPA file, a supplier or the bank account has no IBAN. | Add it with purchasing_save_supplier or books_save_accounts, or leave those bills out. |
| `in_progress` | 409 | Another batch was numbered at the same moment. | Call again. |

The refusals every tool can give (401 key, 402 balance, 429 limits) are on the errors page: https://conecto.chat/docs/errors.md

## Related

- [purchasing_save_supplier](https://conecto.chat/tools/purchasing/purchasing_save_supplier.md): Adds a supplier or changes one: contact, email for orders, address, currency, payment terms and the book account their bills go to. $0.01 a call.
- [purchasing_list_suppliers](https://conecto.chat/tools/purchasing/purchasing_list_suppliers.md): Suppliers by name, each with what is owed to them on open bills and how many orders are open. Free up to 1,000,000 reads a month.
- [purchasing_save_supplier_items](https://conecto.chat/tools/purchasing/purchasing_save_supplier_items.md): Says which Inventory items a supplier sells: their code, cost, pack size, minimum order, lead time and a fixed reorder quantity. $0.005 per item saved.
- [purchasing_list_supplier_items](https://conecto.chat/tools/purchasing/purchasing_list_supplier_items.md): What suppliers sell: codes, costs, packs, minimums, lead times and the preferred supplier, for one supplier or one SKU. Free up to 1,000,000 reads a month.
- [purchasing_draft_reorders](https://conecto.chat/tools/purchasing/purchasing_draft_reorders.md): Drafts one purchase order per supplier for every item at or below its reorder point, counting what is already on order. $0.01 per draft order.
- [purchasing_create_order](https://conecto.chat/tools/purchasing/purchasing_create_order.md): Drafts a purchase order to a supplier: lines (with Inventory SKUs if you like), currency, delivery date and stock location. $0.01 a call.
- [purchasing_update_order](https://conecto.chat/tools/purchasing/purchasing_update_order.md): Changes a draft order, or records it as sent without emailing it. $0.01 a call.
- [purchasing_send_order](https://conecto.chat/tools/purchasing/purchasing_send_order.md): Emails an order to the supplier with a link to its PDF; a draft takes the next number first. $0.10 a call.
- [purchasing_receive](https://conecto.chat/tools/purchasing/purchasing_receive.md): Records what arrived on a sent order; lines with a SKU come into Inventory at the ordered cost. $0.01 a call.
- [purchasing_close_order](https://conecto.chat/tools/purchasing/purchasing_close_order.md): Closes a sent order (stop waiting for the rest) or cancels one that received nothing. $0.01 a call.
- [purchasing_list_orders](https://conecto.chat/tools/purchasing/purchasing_list_orders.md): Purchase orders, newest first, by status, supplier or date; or one order in full. Free up to 1,000,000 reads a month.
- [purchasing_create_bill](https://conecto.chat/tools/purchasing/purchasing_create_bill.md): Records a bill a supplier sent, from its own lines or from an order, with its PDF; it is posted to the books. $0.01 a call.
- [purchasing_update_bill](https://conecto.chat/tools/purchasing/purchasing_update_bill.md): Adds a recorded bill's PDF if it has none, or changes its notes or due date; amounts and the PDF it has never change. $0.01 a call.
- [purchasing_pay_bill](https://conecto.chat/tools/purchasing/purchasing_pay_bill.md): Records money paid on a bill, or money back from the supplier; it is posted to the books. $0.01 a call.
- [purchasing_set_planned_date](https://conecto.chat/tools/purchasing/purchasing_set_planned_date.md): Plans the day the business will pay a bill, so the cash flow forecast takes the money out then rather than on the due date. Free.
- [purchasing_record_prepayment](https://conecto.chat/tools/purchasing/purchasing_record_prepayment.md): Records a deposit the business paid a supplier before their bill, like Xero's prepayments; it waits as a credit with them. $0.01 a call.
- [purchasing_use_credit](https://conecto.chat/tools/purchasing/purchasing_use_credit.md): Puts a credit with a supplier on their bill, like Xero's allocate credit, or records it coming back. $0.01 a call.
- [purchasing_list_credits](https://conecto.chat/tools/purchasing/purchasing_list_credits.md): Lists credits with suppliers, deposits and overpayments, with what is left on each. Free up to 1,000,000 reads a month.
- [purchasing_save_repeating_bill](https://conecto.chat/tools/purchasing/purchasing_save_repeating_bill.md): Records a supplier's bill again every so many weeks, months or years, with [Month] and [Year] filled in, like Xero's repeating bills. $0.01 a call.
- [purchasing_list_repeating_bills](https://conecto.chat/tools/purchasing/purchasing_list_repeating_bills.md): Lists the repeating bills: whose each is, how often, the next dates, and what each recorded. Free up to 1,000,000 reads a month.
- [purchasing_delete_repeating_bill](https://conecto.chat/tools/purchasing/purchasing_delete_repeating_bill.md): Stops a repeating bill for good; the bills it recorded stay. Free.
- [purchasing_void_bill](https://conecto.chat/tools/purchasing/purchasing_void_bill.md): Voids a bill entered by mistake; the books reverse it and its order can be billed again. $0.01 a call.
- [purchasing_list_bills](https://conecto.chat/tools/purchasing/purchasing_list_bills.md): Supplier bills by due date, filtered by status, supplier, order or dates; or one bill in full. Free up to 1,000,000 reads a month.
- [purchasing_report](https://conecto.chat/tools/purchasing/purchasing_report.md): Aged payables (what is owed to each supplier by how late) or spend (what each supplier billed and was paid). Free up to 1,000,000 reads a month.
