# Pay Supplier Bills

> Solarium docs, Transactions. All requests are `POST https://api.trysolarium.com/graphql/` with `Authorization: Bearer <api key>` and a JSON body `{"query": ..., "variables": ...}`. Every query and mutation takes an `organizationId` (find it with `myOrganizations`). Index of all pages: https://trysolarium.com/llms.txt

Pays open bills, all or part, from a bank account or credit card: DR Accounts Payable for each bill / CR the bank or card. The expense was booked with the bill, so this never touches profit and loss. Several bills of one vendor can be paid at once: split as you give it (allocations), else oldest bill first. With QuickBooks connected it becomes one Bill Payment with a line per bill, and each bill's balance is read back. Pass source_event_id to use the withdrawal already on the bank feed: that line becomes the payment, so it isn't counted twice. A USD bill can be paid from a USD account (valued at the bank line, else the day's Bank of Canada rate) or from an account in your books' currency (what left the bank: the bank line, amount_home, else the day's rate). Each bill's A/P comes down at the rate it was booked at, and the last payment leaves exactly 0. The difference goes to Exchange Gain or Loss. Refused for more than what's owed, a bill already paid, bills of different vendors, A/P accounts or currencies, an account in a third currency, or a date in a closed period.

### Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organizationId` | `UUID!` | Yes | Organization ID |
| `name` | `String!` | Yes | "record_bill_payment" |
| `params.bill_id` | `String` | No | The bill's Solarium event id, or its QuickBooks Bill Id |
| `params.bill_ids` | `[String]` | No | Several bills of one vendor, paid at once |
| `params.allocations` | `[Object]` | No | Each: bill_id, amount (in the bill's currency). Default: oldest bill first |
| `params.amount` | `String` | No | In the bills' currency. Default: the bank line's amount, else everything owed |
| `params.amount_home` | `String` | No | A bill in another currency paid from an account in your books' currency: what left the bank, in your books' currency |
| `params.paid_on` | `Date` | No | Default: the bank line's day, else today |
| `params.bank_account_id` | `String` | No | The bank or credit card it was paid from (not needed with source_event_id) |
| `params.source_event_id` | `String` | No | The bank-feed withdrawal for this payment, still in review |
| `params.vendor` | `String` | No | Who you mean to pay. Refused if it isn't the bill's vendor |
| `params.reference` | `String` | No | Optional, like a confirmation number |
| `apply` | `Boolean` | No | true to record it |

### Request

```graphql
mutation {
  runOp(organizationId: "a1b2c3d4-...", name: "record_bill_payment", apply: true,
        params: { bill_ids: ["2379", "2401"], source_event_id: "e5f6..." }) { success applied result }
}
```

### Response

```json
{
  "data": { "runOp": { "success": true, "applied": true, "result": {
    "summary": "CAD 400.21 Paid To Harbourview Payroll Remittance (Business Chequing, 2026-07-15) From The Bank Line. Bill SD-2379 220.21 Paid In Full. Bill SD-2401 180.00 Paid In Full.",
    "data": { "payment_id": "7d21...", "amount": "400.21", "fx_difference": "0.00" }
  } } }
}
```
