Purchasing

Record a bill payment

purchasing_pay_bill · Changes data · Markdown

Records money paid on a bill, or money back from the supplier; it is posted to the books.

$0.01 a call

From your agent’s balance. A call that fails costs nothing.

An example

We paid 400 euros of Nordstahl's bill by bank transfer this morning.

Your agent callspurchasing_pay_bill$0.01 a call

The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.

With these arguments
{
  "bill_id": "3c5e7a9b-1d2f-4a6c-8e0b-4d6f8a1c3e5b",
  "amount": "400.00",
  "method": "bank_transfer",
  "reference": "NS-2026-1188"
}
What comes back
{
  "bill": {
    "bill_id": "3c5e7a9b-1d2f-4a6c-8e0b-4d6f8a1c3e5b",
    "supplier": {
      "supplier_id": 4101,
      "name": "Nordstahl Küchentechnik GmbH"
    },
    "reference": "NS-2026-1188",
    "status": "partially_paid",
    "overdue": false,
    "days_overdue": 0,
    "currency": "EUR",
    "issue_date": "2026-10-13",
    "due_date": "2026-11-12",
    "total": "462.50",
    "amount_paid": "400.00",
    "balance": "62.50",
    "order": "PO-0001",
    "lines": [
      {
        "description": "GN 1/1 pan, steel, 65 mm",
        "sku": "GN-PAN-11",
        "account": null,
        "quantity": "25",
        "unit_cost": "18.5",
        "tax_rate": "0",
        "amount": "462.50",
        "tax": "0.00",
        "order_line": 1
      }
    ],
    "subtotal": "462.50",
    "tax": "0.00",
    "tax_treatment": null,
    "order_id": "c28af832-d83d-49d8-bd56-3dd753be6569",
    "payments": [
      {
        "payment_id": 4101,
        "amount": "400.00",
        "date": "2026-10-14",
        "method": "bank_transfer",
        "reference": "NS-2026-1188",
        "note": null,
        "batch": null
      }
    ],
    "file": {
      "file_id": "605f22af-76c5-4b1f-8222-3366c2016b74",
      "name": "NS-2026-1188.pdf",
      "content_type": "application/pdf",
      "size": "1.1 KB",
      "size_bytes": 1147,
      "sha256": "24cfafaca922f96f27862a78624077499c6933a1caf04ba986e83cc228a836c3",
      "created_at": "2026-10-14T08:00:00+00:00",
      "download_url": "https://cncto.co/d/605f22af-76c5-4b1f-8222-3366c2016b74?t=eyJmIjoiNjA1ZjIyYWYtNzZjNS00YjFmLTgyMjItMzM2NmMyMDE2Yjc0IiwiZXhwIjoxNzkyNDgxMDUzfQ:1xIhjB:FjPchhI8gZZUqY3imHyJzDWd1mB72vxd-1hxTklLetg",
      "link_expires_in_hours": 24
    },
    "notes": null,
    "books_entry": 1,
    "void_reason": null,
    "history": [
      {
        "at": "2026-10-14T08:00:00+00:00",
        "event": "recorded",
        "detail": "Pip",
        "by": "key 4101 (Pip)"
      },
      {
        "at": "2026-10-14T08:00:00+00:00",
        "event": "payment",
        "detail": "€400.00",
        "by": "key 4101 (Pip)"
      }
    ]
  },
  "payment": {
    "payment_id": 4101,
    "amount": "400.00",
    "date": "2026-10-14",
    "method": "bank_transfer"
  }
}

Use it when

The business paid a supplier, in full or in part.

What it does

Record money paid on a bill: amount (at most the balance, unless keep_excess keeps the rest as a credit with the supplier for purchasing_use_credit), date, method and reference. It becomes partially_paid, or paid when nothing is left. A negative amount records money back from the supplier. When the account keeps books, the payment is posted (accounts payable against the bank, with any exchange difference). books_match_bank_lines can do this from a bank line too.

What comes back

bill: the bill with its new status, amount paid and balance; payment: the payment as recorded. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
bill_idRequiredstringThe bill_id purchasing_create_bill returned. Exactly 36 characters.
amountRequirednumber or stringIn the bill's currency, e.g. "250.00". Negative for a refund. Up to 24 characters.
datestringWhen it was paid. Default today. Matches ^\d{4}-\d{2}-\d{2}$.
methodstringOne of: bank_transfer,card,cash,check,online,other. Default: bank_transfer.
referencestringUp to 120 characters.
notestringUp to 500 characters.
keep_excessbooleanPaid more than the balance: keep the rest as a credit with the supplier. Default: false.

The call

Over MCP, call purchasing_pay_bill on https://api.conecto.chat/mcp/purchasing. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/purchasing_pay_bill \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bill_id":"3c5e7a9b-1d2f-4a6c-8e0b-4d6f8a1c3e5b","amount":"400.00","method":"bank_transfer","reference":"NS-2026-1188"}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
not_found404No bill of the business has that bill_id.Find it with purchasing_list_bills.
unbalanced400The debits and credits do not add up to the same amount.Make the lines balance.
before_start409The date is before the books start.Use a later date.
period_locked409The books are locked for that date.Use a later date, or unlock with books_lock.
no_rate409There is no exchange rate for the currency on that day.Pass rate, or set a standing rate with books_setup rates.
rates_loading503The day's exchange rates are still loading.Try again in a few minutes, or pass rate.
void409The bill is void.Payments go on bills that are not void.
already_paid409The bill is paid in full.Nothing more can be paid, except money back.
more_than_balance409The amount is more than the balance.Pay at most the balance, or keep the rest as a credit with the supplier with keep_excess.
more_than_paid409The money back is more than what was paid.Record at most what was paid.
invalid_input400The amount is not a number, or the date is not valid.Send an amount like "400.00".

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md