jaz-clio 9.10.1 → 9.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,13 +3,13 @@
3
3
  <p align="center">
4
4
  <a href="https://www.npmjs.com/package/jaz-clio"><img src="https://img.shields.io/npm/v/jaz-clio?style=for-the-badge&logo=npm" alt="npm"></a>
5
5
  <a href="https://www.npmjs.com/package/jaz-clio"><img src="https://img.shields.io/npm/dm/jaz-clio?style=for-the-badge&label=downloads" alt="npm downloads"></a>
6
- <img src="https://img.shields.io/badge/tools-523-blue?style=for-the-badge" alt="523 tools">
6
+ <img src="https://img.shields.io/badge/tools-526-blue?style=for-the-badge" alt="526 tools">
7
7
  <a href="https://github.com/teamtinvio/jaz-ai/blob/main/LICENSE"><img src="https://img.shields.io/github/license/teamtinvio/jaz-ai?style=for-the-badge&color=green" alt="License"></a>
8
8
  </p>
9
9
 
10
10
  <p align="center"><b>Fastest ledger for agents.</b><br>Jaz accounting on the command line, and inside any AI agent.</p>
11
11
 
12
- 523 tools · 80 command groups · 8 skills · 13 calculators · 12 job playbooks · 148 field-tested API rules.
12
+ 526 tools · 80 command groups · 8 skills · 13 calculators · 12 job playbooks · 148 field-tested API rules.
13
13
 
14
14
  ```bash
15
15
  npm install -g jaz-clio
@@ -109,7 +109,7 @@ that ends up in a journal.
109
109
 
110
110
  ## MCP server
111
111
 
112
- 523 tools for any AI agent that speaks MCP. Runs locally: no cloud, no ports.
112
+ 526 tools for any AI agent that speaks MCP. Runs locally: no cloud, no ports.
113
113
 
114
114
  > **No install at all?** Claude.ai, ChatGPT, Cowork, and Microsoft Copilot Studio can use Jaz through the hosted connector. Add `https://mcp.jaz.ai/mcp` as a custom connector and sign in with OAuth, no key. The local setup below is for terminal use, scripting, and editors that run MCP servers as local processes.
115
115
 
@@ -14,7 +14,7 @@ description: >-
14
14
  license: MIT
15
15
  compatibility: Uses Jaz OAuth by default; organization API keys remain supported. Works with Claude Code, Google Antigravity, OpenAI Codex, GitHub Copilot, Cursor, and any agent that reads markdown.
16
16
  metadata:
17
- version: "9.10.1"
17
+ version: "9.12.0"
18
18
  ---
19
19
 
20
20
  # Jaz API Skill
@@ -93,7 +93,7 @@ To change a few fields on some lines without resending the document, use `quick_
93
93
  `sale_orders`: `create_sale_order`, `get_sale_order`, `search_sale_orders`, `search_sale_order_line_items`, `update_sale_order`, `accept_sale_quote`, `confirm_sale_order`, `void_sale_order`, `delete_sale_order`, `convert_sale_order_to_invoice`.
94
94
  `purchase_orders`: `create_purchase_order`, `get_purchase_order`, `search_purchase_orders`, `search_purchase_order_line_items`, `update_purchase_order`, `accept_purchase_request`, `confirm_purchase_order`, `void_purchase_order`, `delete_purchase_order`, `convert_purchase_order_to_bill`.
95
95
 
96
- PDF downloads for the documents these convert into: `download_bill_pdf` (`bills`), `download_supplier_credit_note_pdf` (`supplier_credit_notes`), alongside the existing `download_invoice_pdf` / `download_credit_note_pdf`.
96
+ PDF downloads: `download_sale_order_pdf` (`documentType` SALE_QUOTE or SALE_ORDER; a sale order also takes `variant` ORDER_CONFIRMATION or DELIVERY_SLIP) and `download_purchase_order_pdf` (`documentType` PURCHASE_REQUEST or PURCHASE_ORDER) here, and for the documents these convert into: `download_bill_pdf` (`bills`, `variant` APPROVAL_RECORD for the approval record), `download_supplier_credit_note_pdf` (`supplier_credit_notes`), `download_invoice_pdf` (`invoices`, `variant` DELIVERY_SLIP for the delivery slip) and `download_credit_note_pdf`. `download_payment_pdf` (`payments`) gives a payment receipt, payment advice or refund document. Over the API the variant is the `documentType` query parameter.
97
97
 
98
98
  ## CLI (full surface incl. long-tail)
99
99
 
@@ -102,7 +102,11 @@ clio sale-orders list|get|search|search-line-items|create|update|accept|conf
102
102
  |bulk-void|bulk-accept|bulk-confirm|bulk-delete|bulk-upsert-line-items (-t quote|order)
103
103
  clio purchase-orders list|get|search|search-line-items|create|update|accept|confirm|convert-to-bill|void|delete|fast-fix \
104
104
  |bulk-void|bulk-accept|bulk-confirm|bulk-delete|bulk-upsert-line-items (-t request|order)
105
- clio bills download <id> # bill PDF
105
+ clio sale-orders download <id> -t quote|order [--variant ORDER_CONFIRMATION|DELIVERY_SLIP] # --variant: order only
106
+ clio purchase-orders download <id> -t request|order
107
+ clio bills download <id> [--variant APPROVAL_RECORD] # bill PDF, or its approval record
108
+ clio invoices download <id> [--variant DELIVERY_SLIP]
109
+ clio payments download <id> # receipt, payment advice or refund document
106
110
  clio supplier-credit-notes download <id> # supplier CN PDF
107
111
  ```
108
112
 
@@ -4,7 +4,7 @@ Part of the jaz-api skill. [SKILL.md](../SKILL.md) holds the reading order and t
4
4
 
5
5
  ### Bulk Upserts (transactions)
6
6
 
7
- 118. **8 bulk-upsert endpoints for transactions**: `POST /api/v1/{invoices,bills,customer-credit-notes,supplier-credit-notes,journals,fixed-assets}/bulk-upsert` plus line-item variants for invoices and bills (`/invoices/line-items/bulk-upsert`, `/bills/line-items/bulk-upsert`). Max **500 rows per call**. All async: return `{data: {jobId, subscriptionFBPath, status, totalRecords}}`. Poll `search_background_jobs` with `filter: {resourceId: {eq: jobId}}` until terminal status. **Natural keys**: invoices = `invoiceReference`, bills = `billReference`, credit notes = `creditNoteReference`, **journals = `journalReference` (NOT `reference`, asymmetric vs other entities)**, fixed assets = `reference`. **`currencyCode` is REQUIRED** on every transaction row (invoices, bills, CCN, SCN); missing it returns errorCode `IMPORT_CURRENCY_REQUIRED`. **Journals are the exception**: the bulk journal row has no currency field and any `currencyCode` sent is discarded, and the public request model exposes no per-leg currency field either. **Journals legs use `journalEntries[]`** (NOT `entries[]`; different from `journals create` which uses entries), and **a journal leg is `organizationAccountResourceId` + exactly one of `debitAmount`/`creditAmount`**, NOT the `accountResourceId`+`amount`+`type` shape `journals create` takes, and omit the unused side rather than sending 0. **On the six TRANSACTION bulk tools the natural key is the only upsert key; `resourceId` does not override it.** Probed live 2026-09-02 on invoices, bills, customer credit notes and invoice line items: sending an existing record's `resourceId` together with a DIFFERENT natural key left the original untouched and created a second record. (Supplier credit notes and bill line items were not probed; they were changed on their twin's evidence plus spec absence.) `resourceId` has been removed from all six. It remains valid, and spec-backed, on `bulk_upsert_contacts`, `bulk_upsert_items` and `bulk_upsert_chart_of_accounts`; see rule 137. Journals upsert by `journalReference` only. **Currency and due date split by shape, so pick the tool by what you need:** the FLAT pair (`bulk_upsert_invoices` / `bulk_upsert_bills`) IGNORES both: a row sent `currencyCode: EUR` against a USD-base org stored USD, omitting `currencyCode` entirely still succeeds, and `dueDate` comes back equal to `valueDate` with `terms: 0`. The NESTED pair (`bulk_upsert_invoice_line_items` / `bulk_upsert_bill_line_items`) honours `dueDate` (it is in fact REQUIRED there; omitting it fails the row with `DUE_DATE_REQUIRED`) and requires `currencyCode`. **So a bulk import that needs a real due date or a non-base currency must use the NESTED tools.** `tags` is on no transaction bulk wire definition and has been removed from these tools. `rowIndex` is optional caller-supplied for error reporting; on journals it sits on the leg, not the row.
7
+ 118. **8 bulk-upsert endpoints for transactions**: `POST /api/v1/{invoices,bills,customer-credit-notes,supplier-credit-notes,journals,fixed-assets}/bulk-upsert` plus line-item variants for invoices and bills (`/invoices/line-items/bulk-upsert`, `/bills/line-items/bulk-upsert`). Max **500 rows per call**. All async: return `{data: {jobId, subscriptionFBPath, status, totalRecords}}`. Poll `search_background_jobs` with `filter: {resourceId: {eq: jobId}}` until terminal status. **Natural keys**: invoices = `invoiceReference`, bills = `billReference`, credit notes = `creditNoteReference`, **journals = `journalReference` (NOT `reference`, asymmetric vs other entities)**, fixed assets = `reference`. **`currencyCode` is REQUIRED** on every transaction row (invoices, bills, CCN, SCN); missing it returns errorCode `IMPORT_CURRENCY_REQUIRED`. **Journals are the exception**: the bulk journal row has no currency field and any `currencyCode` sent is discarded, and the public request model exposes no per-leg currency field either. **Journals legs use `journalEntries[]`** (NOT `entries[]`; different from `journals create` which uses entries), and **a journal leg is `organizationAccountResourceId` + exactly one of `debitAmount`/`creditAmount`**, NOT the `accountResourceId`+`amount`+`type` shape `journals create` takes, and omit the unused side rather than sending 0. **On the six TRANSACTION bulk tools the natural key is the only upsert key; `resourceId` does not override it.** Probed live 2026-09-02 on invoices, bills, customer credit notes and invoice line items: sending an existing record's `resourceId` together with a DIFFERENT natural key left the original untouched and created a second record. (Supplier credit notes and bill line items were not probed; they were changed on their twin's evidence plus spec absence.) `resourceId` has been removed from all six. It remains valid, and spec-backed, on `bulk_upsert_contacts`, `bulk_upsert_items` and `bulk_upsert_chart_of_accounts`; see rule 137. Journals upsert by `journalReference` only. **Currency and due date split by shape, so pick the tool by what you need:** the FLAT pair (`bulk_upsert_invoices` / `bulk_upsert_bills`) IGNORES both: a row sent `currencyCode: EUR` against a USD-base org stored USD, omitting `currencyCode` entirely still succeeds, and `dueDate` comes back equal to `valueDate` with `terms: 0`. The NESTED pair (`bulk_upsert_invoice_line_items` / `bulk_upsert_bill_line_items`) honours `dueDate` (it is in fact REQUIRED there; omitting it fails the row with `DUE_DATE_REQUIRED`) and requires `currencyCode`. **So a bulk import that needs a real due date or a non-base currency must use the NESTED tools.** The FLAT pair is DEPRECATED upstream (still working, unchanged); the NESTED pair and the two credit note tools also take a per-row `payment` (rule 134a). `tags` is on no transaction bulk wire definition and has been removed from these tools. `rowIndex` is optional caller-supplied for error reporting; on journals it sits on the leg, not the row.
8
8
 
9
9
  118b. **Credit-note rows carry two extra requirements** (customer and supplier alike, and nothing here applies to journals). The tools speak `currencyCode`, but these two contracts (like the two line-item ones) name the wire field `transactionCurrency`; the client renames it for you via `toWireCurrencyRow`. They also require **`transactionRateType`** (`ORGANIZATION_RATE` | `TRANSACTION_RATE`): omit it and the row fails `IMPORT_TRANSACTION_RATE_TYPE_INVALID` even when the currency is right. `TRANSACTION_RATE` reads `rateFunctionToSource` (1 base unit = N transaction currency); `ORGANIZATION_RATE` uses the org rate. Neither endpoint carries `tags` on its wire definition, so do not report tags "applied" through this route. (The two line-item endpoints were probed the same way on 2026-09-02 and do NOT need `transactionRateType`.)
10
10
 
@@ -51,7 +51,9 @@ Part of the jaz-api skill. [SKILL.md](../SKILL.md) holds the reading order and t
51
51
 
52
52
  133. **`reconcile_invoice_receipt` and `reconcile_bill_receipt` gate on `paymentDirection`, not BSE entry type**: error code `INVALID_BUSINESS_TRANSACTION_TYPE_ERROR` ("Invalid business transaction type", 422) is misleadingly named. The actual gate is the BSE's `paymentDirection`. **`invoice_receipt` requires `PAYIN`** (AR, money in, positive amount in `bank add-records`, producing `credit_amount > 0`). **`bill_receipt` requires `PAYOUT`** (AP, money out, NEGATIVE amount, producing `debit_amount > 0`). `bank add-records` produces both directions based on amount sign. Statement-imported BSEs (`bank import`) also work; direction is set from the CSV. No need for the async magic-OCR `bank import` path; sync `bank add-records` with the correct sign is sufficient.
53
53
 
54
- 134. **Bulk-upsert FLAT vs NESTED variants**: for invoices and bills, there are TWO bulk-upsert endpoints. **FLAT** (`bulk_upsert_invoices` / `bulk_upsert_bills`): one line per row, set at row level via `itemDescription` + `totalAmount` + `invoiceAccountResourceId` (or `billAccountResourceId`). **NESTED** (`bulk_upsert_invoice_line_items` / `bulk_upsert_bill_line_items`): multi-line per row via nested `lineItems[]`, each with `itemDescription` + `quantity` + `unitPrice` + `accountResourceId`. Use FLAT when one line per transaction is fine (CSV import, simple bills); use NESTED when each transaction needs multiple lines. Sending `lineItems[]` to the FLAT endpoint silently ignores them and creates a $0 invoice.
54
+ 134. **Bulk-upsert FLAT vs NESTED variants**: for invoices and bills, there are TWO bulk-upsert endpoints. **FLAT** (`bulk_upsert_invoices` / `bulk_upsert_bills`, DEPRECATED upstream but still working): one line per row, set at row level via `itemDescription` + `totalAmount` + `invoiceAccountResourceId` (or `billAccountResourceId`). **NESTED** (`bulk_upsert_invoice_line_items` / `bulk_upsert_bill_line_items`): multi-line per row via nested `lineItems[]`, each with `itemDescription` + `quantity` + `unitPrice` + `accountResourceId`. Prefer NESTED for new imports: it takes several lines, `currencyCode`, `dueDate` and a payment recorded with the document (rule 134a). The one exception is a payment that carries withholding tax: only the FLAT endpoints take `amountWithholding` and `withholdingReference`, so use FLAT for that. Otherwise FLAT stays only for callers that already use it. Sending `lineItems[]` to the FLAT endpoint silently ignores them and creates a $0 invoice.
55
+
56
+ 134a. **`payment` on the nested imports records a paid document in one call.** `bulk_upsert_invoice_line_items`, `bulk_upsert_bill_line_items` and (as a REFUND on the credit note) `bulk_upsert_customer_credit_notes` / `bulk_upsert_supplier_credit_notes` take an optional `payment` object per row (one per document, dated the document date): `paymentAmount` + `paymentMethod` + `paymentAccountResourceId` required, plus optional `paymentReference`, `feeValue`, `feeOrganizationAccountResourceId`, `feeTaxVatProfileResourceId`, `adjustmentValue`, `adjustmentOrganizationAccountResourceId`; invoices alone also take `collectedFeeValue`, `collectedFeeOrganizationAccountResourceId`, `collectedFeeTaxVatProfileResourceId` (a bill or credit note sending them is a 422). `paymentMethod` is the method DISPLAY name matched exactly (`Cash`, `Bank Transfer`, `Credit Card`, `Check`, `Deposit / Wallet`, `Payment Gateway`), NOT the `BANK_TRANSFER` enum the single-payment tools take. `paymentAmount` must be more than 0 and at most the document total; the account must be a bank or cash account IN THE DOCUMENT CURRENCY (`IMPORT_PAYMENT_ACCOUNT_CURRENCY_MISMATCH`); a fee must be less than the amount and needs its account; a non-zero adjustment needs its account. A blank `paymentReference` becomes `PAY-<document reference>`. Rows sharing a reference must give the same payment or give it on the first row only, else the WHOLE request is rejected (`IMPORT_SAME_REFERENCE_DIFFERENT_HEADER` / `IMPORT_PAYMENT_NOT_ON_FIRST_ROW`). No payment-level withholding here (only the deprecated flat imports take it). The credit note routes are `/customer-credit-notes/bulk-upsert` and `/supplier-credit-notes/bulk-upsert`, not `/line-items/`.
55
57
 
56
58
  135. **Reconciliation `lineItems[]` use a DIFFERENT field naming convention**: for `reconcile_invoice_receipt.invoiceDetails.lineItems[]` and `reconcile_bill_receipt.billDetails.lineItems[]`, each line uses `name` (NOT `itemDescription`) for the description and `organizationAccountResourceId` (NOT `accountResourceId`) for the revenue/expense account. The bulk-upsert-line-items variants use `itemDescription` + `accountResourceId`. Memorize this: bulk = `itemDescription`+`accountResourceId`; recon-create = `name`+`organizationAccountResourceId`.
57
59
 
@@ -7,18 +7,18 @@ description: >-
7
7
  precedence, output formats, entity resolution, and common workflow patterns.
8
8
  Also use when the user asks how to use clio, what commands are available, or
9
9
  how to automate accounting tasks from the command line. Covers all
10
- 80 command groups and 523 tools, including employee-expense claims.
10
+ 80 command groups and 526 tools, including employee-expense claims.
11
11
  license: MIT
12
12
  compatibility: Requires Node.js >= 18.0.0. Install via npm install -g jaz-clio.
13
13
  metadata:
14
- version: "9.10.1"
14
+ version: "9.12.0"
15
15
  ---
16
16
 
17
17
  # Clio CLI Skill
18
18
 
19
19
  > **Audience note:** for power users and CI/automation. Load this skill only when you're scripting from a terminal, building shell pipelines, or debugging from `clio --json` output. For day-to-day accounting inside Claude Desktop / Cowork, the MCP tools cover the common flows without dropping to the CLI.
20
20
 
21
- You are working with **Clio** (`jaz-clio`), the CLI for the Jaz accounting platform. 80 command groups, 13 calculators, 12 job playbooks (jaz-jobs skill), 523 tools. Also fully compatible with Juan Accounting (same API, same endpoints).
21
+ You are working with **Clio** (`jaz-clio`), the CLI for the Jaz accounting platform. 80 command groups, 13 calculators, 12 job playbooks (jaz-jobs skill), 526 tools. Also fully compatible with Juan Accounting (same API, same endpoints).
22
22
 
23
23
  ## When to Use This Skill
24
24
 
@@ -257,8 +257,8 @@ When `--input` or stdin provides a body, CLI flags are ignored.
257
257
 
258
258
  For invoices and bills, there are TWO bulk-upsert commands per entity:
259
259
 
260
- - **FLAT** (`clio invoices bulk-upsert` / `clio bills bulk-upsert`): ONE line per row. Each row carries `itemDescription` + `totalAmount` + `invoiceAccountResourceId` (or `billAccountResourceId`) at the top level. Use for CSV-like imports where each row = one transaction with a single line.
261
- - **NESTED** (`clio invoices bulk-upsert-line-items` / `clio bills bulk-upsert-line-items`): multi-line per row. Each row carries nested `lineItems[]` with per-line `itemDescription` + `quantity` + `unitPrice` + `accountResourceId`. Use when each transaction needs multiple lines.
260
+ - **FLAT** (`clio invoices bulk-upsert` / `clio bills bulk-upsert`): DEPRECATED, still works. ONE line per row. Each row carries `itemDescription` + `totalAmount` + `invoiceAccountResourceId` (or `billAccountResourceId`) at the top level.
261
+ - **NESTED** (`clio invoices bulk-upsert-line-items` / `clio bills bulk-upsert-line-items`): multi-line per row. Each row carries nested `lineItems[]` with per-line `itemDescription` + `quantity` + `unitPrice` + `accountResourceId`. Use for every new import: it also takes several lines, `currencyCode`, `dueDate` and an optional per-row `payment` object that records the payment with the document (`paymentAmount`, `paymentMethod` as the display name such as `Bank Transfer`, `paymentAccountResourceId` in the document currency). `clio customer-credit-notes bulk-upsert` and `clio supplier-credit-notes bulk-upsert` take the same `payment` as a refund.
262
262
 
263
263
  Sending `lineItems[]` to the FLAT endpoint silently ignores them and creates a $0 transaction. Sending the FLAT shape to the NESTED endpoint creates an empty `lineItems` array and 422s. Match the variant to your data shape.
264
264
 
@@ -35,7 +35,7 @@
35
35
 
36
36
  15. **`bills draft list` (also `invoices/customer-credit-notes/supplier-credit-notes draft list`) fans out one attachment lookup per draft** (5 in flight). On accounts with hundreds of drafts this hangs >30s by default. Pass `--max-rows 10` for spot checks. Long-term: a `--with-attachments` flag is on the roadmap.
37
37
 
38
- 16. **Bulk-upsert is TWO endpoints per entity for invoices/bills.** `clio invoices bulk-upsert` is FLAT (one line per row via `itemDescription` + `totalAmount` + `invoiceAccountResourceId` at row level). `clio invoices bulk-upsert-line-items` is NESTED (multi-line via `lineItems[]`). Sending `lineItems[]` to FLAT is silently ignored → $0 invoices. Match your data shape to the variant.
38
+ 16. **Bulk-upsert is TWO endpoints per entity for invoices/bills.** `clio invoices bulk-upsert` is FLAT and DEPRECATED (one line per row via `itemDescription` + `totalAmount` + `invoiceAccountResourceId` at row level). `clio invoices bulk-upsert-line-items` is NESTED (multi-line via `lineItems[]`, plus an optional per-row `payment` for a document that is already paid; `paymentMethod` is the display name, e.g. `Bank Transfer`). Sending `lineItems[]` to FLAT is silently ignored → $0 invoices. Match your data shape to the variant.
39
39
 
40
40
  17. **Reconciliation `lineItems[]` use `name` + `organizationAccountResourceId`.** The `reconciliations invoice-receipt` and `reconciliations bill-receipt` payloads use a DIFFERENT line-item field naming than `bulk-upsert-line-items`. Recon-create uses `name` (description) + `organizationAccountResourceId` (revenue/expense account). Bulk uses `itemDescription` + `accountResourceId`. Don't copy-paste line-items between the two.
41
41
 
@@ -17,11 +17,11 @@ Complete reference for all 80 command groups. Organized by domain.
17
17
  | `delete <id>` | |
18
18
  | `pay <id>` | `--amount`, `--transaction-amount`, `--account`, `--method`, `--ref`, `--date` |
19
19
  | `apply-credits <id>` | `--credit-note`, `--amount` |
20
- | `download <id>` | `--json`: returns the PDF URL; writes no file |
20
+ | `download <id>` | `--variant DELIVERY_SLIP` for the delivery slip, `--json`: returns the PDF URL; writes no file |
21
21
  | `draft list` | `--max-rows N`, `--ids`, `--json`: ⚠️ fans out 1 attachment lookup per draft (5 in flight); pass `--max-rows 10` for spot checks |
22
22
  | `draft finalize <id>` | `--account`, `--input` |
23
- | `bulk-upsert` | `--input <file>`, `--json`: **FLAT** shape (one line per row via `itemDescription`+`totalAmount`+`invoiceAccountResourceId`). Async → jobId. `currencyCode` REQUIRED |
24
- | `bulk-upsert-line-items` | `--input <file>`, `--json`: **NESTED** shape (multi-line per row via `lineItems[]`). Async → jobId. `currencyCode` REQUIRED |
23
+ | `bulk-upsert` | `--input <file>`, `--json`: **FLAT** shape, DEPRECATED (one line per row via `itemDescription`+`totalAmount`+`invoiceAccountResourceId`). Async → jobId. `currencyCode` REQUIRED |
24
+ | `bulk-upsert-line-items` | `--input <file>`, `--json`: **NESTED** shape (multi-line per row via `lineItems[]`; optional per-row `payment`). Async → jobId. `currencyCode` REQUIRED |
25
25
 
26
26
  ### `clio bills`: Purchase bills
27
27
  | Subcommand | Key flags |
@@ -36,8 +36,8 @@ Complete reference for all 80 command groups. Organized by domain.
36
36
  | `apply-credits <id>` | `--credit-note`, `--amount` |
37
37
  | `draft list` | `--max-rows N`, `--ids`, `--json`: same attachment fan-out warning as invoices |
38
38
  | `draft finalize <id>` | `--account`, `--input` |
39
- | `bulk-upsert` | `--input <file>`, `--json`: **FLAT** shape. Async → jobId. `currencyCode` REQUIRED |
40
- | `bulk-upsert-line-items` | `--input <file>`, `--json`: **NESTED** shape. Async → jobId. `currencyCode` REQUIRED |
39
+ | `bulk-upsert` | `--input <file>`, `--json`: **FLAT** shape, DEPRECATED. Async → jobId. `currencyCode` REQUIRED |
40
+ | `bulk-upsert-line-items` | `--input <file>`, `--json`: **NESTED** shape (optional per-row `payment`). Async → jobId. `currencyCode` REQUIRED |
41
41
 
42
42
  ### `clio customer-credit-notes`: Customer credit notes
43
43
  | Subcommand | Key flags |
@@ -52,7 +52,7 @@ Complete reference for all 80 command groups. Organized by domain.
52
52
  | `refunds <id>` | List refunds for a credit note |
53
53
  | `download <id>` | `--json`: returns the PDF URL; writes no file |
54
54
  | `draft list` | `--max-rows N`, `--ids`, `--json` |
55
- | `bulk-upsert` | `--input <file>`, `--json`: Nested `lineItems[]`. Async → jobId. `currencyCode` REQUIRED |
55
+ | `bulk-upsert` | `--input <file>`, `--json`: Nested `lineItems[]`; optional per-row `payment` records a refund. Async → jobId. `currencyCode` REQUIRED |
56
56
 
57
57
  ### `clio supplier-credit-notes`: Supplier credit notes
58
58
  | Subcommand | Key flags |
@@ -66,7 +66,7 @@ Complete reference for all 80 command groups. Organized by domain.
66
66
  | `refund <id>` | `--amount`, `--account`, `--method`, `--ref`, `--date` |
67
67
  | `refunds <id>` | List refunds for a credit note |
68
68
  | `draft list` | `--max-rows N`, `--ids`, `--json` |
69
- | `bulk-upsert` | `--input <file>`, `--json`: Nested `lineItems[]`. Async → jobId. `currencyCode` REQUIRED |
69
+ | `bulk-upsert` | `--input <file>`, `--json`: Nested `lineItems[]`; optional per-row `payment` records a refund. Async → jobId. `currencyCode` REQUIRED |
70
70
 
71
71
  ### `clio journals`: Journal entries
72
72
  | Subcommand | Key flags |
@@ -103,10 +103,13 @@ Same subcommands and flags as `cash-in`.
103
103
  | `create` | `--from-account`, `--to-account`, `--amount`, `--date`, `--ref` (generated when omitted), `--input` |
104
104
  | `delete <id>` | |
105
105
 
106
- ### `clio payments`: Payment records (search the ledger with `clio cashflow search`)
106
+ ### `clio payments`: Payment records
107
+ Every `<id>` is a payment record ID (from an invoice or bill paymentRecords, or a credit note refund). A ledger ID from `clio cashflow search` is a different entity and 404s here.
108
+
107
109
  | Subcommand | Key flags |
108
110
  |------------|-----------|
109
111
  | `get <id>` | `--json` |
112
+ | `download <id>` | `--json`: returns the PDF URL (receipt for an invoice payment, payment advice for a bill payment, refund document for a credit note refund); writes no file |
110
113
  | `update <id>` | `--date`, `--reference`, `--input` |
111
114
  | `delete <id>` | |
112
115
 
@@ -878,7 +881,7 @@ Valid entity types: INVOICE, BILL, CUSTOMER_CREDIT_NOTE, SUPPLIER_CREDIT_NOTE, S
878
881
  Universal async tracker: any operation returning a jobId (contacts bulk-upsert, items bulk-upsert, bank import, magic processing) can be polled here.
879
882
 
880
883
  ### `clio mcp`: MCP stdio server
881
- Starts an MCP server for Claude Code / AI tool integration. Exposes all 523 operations.
884
+ Starts an MCP server for Claude Code / AI tool integration. Exposes all 526 operations.
882
885
 
883
886
  ### `clio init`: Skill installer
884
887
  Installs AI agent skills into your project.
@@ -9,14 +9,14 @@ description: >-
9
9
  import, or switching accounting software, whenever a customer's prior system
10
10
  is Xero, QuickBooks, Sage, MYOB, or an Excel-based ledger.
11
11
  metadata:
12
- version: "9.10.1"
12
+ version: "9.12.0"
13
13
  ---
14
14
 
15
15
  # Jaz Conversion Skill
16
16
 
17
17
  You are performing an **accounting data conversion**: migrating a customer's financial data from their previous accounting software (Xero, QuickBooks, Sage, MYOB, or Excel-based systems) into Jaz.
18
18
 
19
- > **Jaz-native, not generic.** The clearing-account pattern, the CoA-bulk-upsert all-or-nothing semantics, the `currencyCode`-string-silently-ignored-on-invoices gotcha, the `bulk_upsert_invoices` PARTIAL_SUCCESS path: every rule in this skill is an opinion shaped by Jaz's specific API behavior, not by generic migration theory. Source-system mapping (Xero, QB, Sage) is included only as input parsing; everything downstream is Jaz-shaped.
19
+ > **Jaz-native, not generic.** The clearing-account pattern, the CoA-bulk-upsert all-or-nothing semantics, the `currencyCode`-string-silently-ignored-on-invoices gotcha, the `bulk_upsert_invoice_line_items` PARTIAL_SUCCESS path: every rule in this skill is an opinion shaped by Jaz's specific API behavior, not by generic migration theory. Source-system mapping (Xero, QB, Sage) is included only as input parsing; everything downstream is Jaz-shaped.
20
20
 
21
21
  **This skill provides Jaz-contextual conversion domain knowledge. For API details (field names, endpoints, gotchas), load the `jaz-api` skill alongside this one.**
22
22
 
@@ -78,7 +78,9 @@ Source GL entries that aren't invoices/bills/payments → create as journal entr
78
78
  ### Phase 4: Settlements
79
79
 
80
80
  #### 4.1 Invoice Payments
81
- For each payment in the source:
81
+ A payment in the invoice's own currency can be recorded with the document: send it as the row's `payment` object on `bulk_upsert_invoice_line_items` (or `bulk_upsert_bill_line_items` for a bill, `bulk_upsert_customer_credit_notes` / `bulk_upsert_supplier_credit_notes` for a credit note refund), one payment per document, dated the document date, with `paymentMethod` as the display name (`Bank Transfer`) and a bank or cash account in the document currency (jaz-api rule 134a). A payment on another date, a split payment, or a cross-currency one is recorded afterwards:
82
+
83
+ For each such payment in the source:
82
84
  ```
83
85
  POST /api/v1/invoices/<invoiceResourceId>/payments
84
86
  {
@@ -16,7 +16,7 @@ description: >-
16
16
  license: MIT
17
17
  compatibility: Uses Jaz OAuth by default; organization API keys remain supported. Works with Claude Code, Google Antigravity, OpenAI Codex, GitHub Copilot, Cursor, and any agent that reads markdown. Load the jaz-api skill alongside this one.
18
18
  metadata:
19
- version: "9.10.1"
19
+ version: "9.12.0"
20
20
  ---
21
21
 
22
22
  # Jaz API Reference Skill
@@ -1,6 +1,6 @@
1
1
  # Jaz API Endpoint Reference: Bulk Edits and Jobs
2
2
 
3
- > Request/response examples for Quick Fix, Ledger Find & Fix, contacts bulk upsert, background jobs.
3
+ > Request/response examples for Quick Fix, Ledger Find & Fix, contacts bulk upsert, invoice/bill/credit note bulk imports, background jobs.
4
4
  > Base URL, auth, date format, pagination and status codes apply to every endpoint: see [endpoints.md](./endpoints.md), which also indexes every section.
5
5
 
6
6
  ---
@@ -319,6 +319,52 @@ Poll: `POST /background-jobs/search` body: `{ "filter": { "resourceId": { "eq":
319
319
 
320
320
  ---
321
321
 
322
+ ## 22a. Invoice, Bill and Credit Note Bulk Imports (with payment)
323
+
324
+ All four are **ASYNC** (`jobId`, poll `/background-jobs/search`) and take up to 500 rows. Each row can carry an optional `payment` object: one payment per document, dated the document date. On a credit note it records a REFUND.
325
+
326
+ ### POST /api/v1/invoices/line-items/bulk-upsert
327
+
328
+ ### POST /api/v1/bills/line-items/bulk-upsert
329
+
330
+ ### POST /api/v1/customer-credit-notes/bulk-upsert
331
+
332
+ ### POST /api/v1/supplier-credit-notes/bulk-upsert
333
+
334
+ ```json
335
+ // One invoice row (REST body; the tool takes currencyCode where the wire says transactionCurrency)
336
+ {
337
+ "invoices": [{
338
+ "invoiceReference": "INV-2026-0001",
339
+ "contactResourceId": "uuid",
340
+ "valueDate": "2026-11-24",
341
+ "dueDate": "2026-12-24",
342
+ "transactionCurrency": "SGD",
343
+ "lineItems": [{ "itemDescription": "Widget", "quantity": 1, "unitPrice": 500, "accountResourceId": "uuid" }],
344
+ "payment": {
345
+ "paymentAmount": 500,
346
+ "paymentMethod": "Bank Transfer",
347
+ "paymentAccountResourceId": "uuid-bank-in-invoice-currency",
348
+ "paymentReference": "PAY-INV-2026-0001",
349
+ "feeValue": 5,
350
+ "feeOrganizationAccountResourceId": "uuid"
351
+ }
352
+ }]
353
+ }
354
+ ```
355
+
356
+ `payment` fields: `paymentAmount`, `paymentMethod`, `paymentAccountResourceId`, `paymentReference`, `feeValue`, `feeOrganizationAccountResourceId`, `feeTaxVatProfileResourceId`, `adjustmentValue`, `adjustmentOrganizationAccountResourceId`. Invoices alone also take `collectedFeeValue`, `collectedFeeOrganizationAccountResourceId`, `collectedFeeTaxVatProfileResourceId`; a bill or credit note sending them is a 422. There is no payment-level withholding on these endpoints.
357
+
358
+ - `paymentMethod` is the method DISPLAY name, matched exactly: `Cash`, `Bank Transfer`, `Credit Card`, `Check`, `Deposit / Wallet`, `Payment Gateway`. It is not the `BANK_TRANSFER` enum the single-payment endpoints take.
359
+ - `paymentAmount` is more than 0 and at most the document total. `paymentMethod` and `paymentAccountResourceId` are required with it. The account is a bank or cash account in the DOCUMENT currency (`IMPORT_PAYMENT_ACCOUNT_CURRENCY_MISMATCH`).
360
+ - A fee is less than the amount and needs its account; a fee collected needs its account; a non-zero adjustment needs its account (not a bank, cash, control or deposit account).
361
+ - A blank `paymentReference` becomes `PAY-<document reference>`.
362
+ - Rows sharing a reference give the same payment, or give it on the first row only; otherwise the whole request is rejected (`IMPORT_SAME_REFERENCE_DIFFERENT_HEADER` / `IMPORT_PAYMENT_NOT_ON_FIRST_ROW`).
363
+
364
+ The summary (one row per document) endpoints `POST /api/v1/invoices/bulk-upsert` and `POST /api/v1/bills/bulk-upsert` are **deprecated** and unchanged: they still work, and are the only imports that take payment-level withholding.
365
+
366
+ ---
367
+
322
368
  ## 23. Background Jobs Search
323
369
 
324
370
  ### POST /api/v1/background-jobs/search
@@ -151,6 +151,7 @@ Create and update endpoints accept alias field names (`issueDate` for `valueDate
151
151
  | 20. Nano-Classifier CRUD | [endpoints-master-data.md](./endpoints-master-data.md) |
152
152
  | 21. Scheduler GET/PUT/DELETE | [endpoints-schedules-reports.md](./endpoints-schedules-reports.md) |
153
153
  | 22. Contacts Bulk Upsert | [endpoints-bulk-edits.md](./endpoints-bulk-edits.md) |
154
+ | 22a. Invoice, Bill and Credit Note Bulk Imports (with payment) | [endpoints-bulk-edits.md](./endpoints-bulk-edits.md) |
154
155
  | 23. Background Jobs Search | [endpoints-bulk-edits.md](./endpoints-bulk-edits.md) |
155
156
  | 24. Export Records | [endpoints-schedules-reports.md](./endpoints-schedules-reports.md) |
156
157
  | 25. Jots (Judgment Journal) | [endpoints-transactions.md](./endpoints-transactions.md) |
@@ -3,7 +3,7 @@
3
3
  > **The endpoints clio wraps (the REST surface is larger).** This file catalogues roughly 200
4
4
  > paths, organized by resource, including undocumented endpoints, magic AI features, admin
5
5
  > APIs, and advanced search/filter syntax. The committed OpenAPI spec (`spec/openapi.yaml`)
6
- > carries 619 spec paths and 777 spec operations and is the authoritative list; check it before concluding
6
+ > carries 624 spec paths and 782 spec operations and is the authoritative list; check it before concluding
7
7
  > an endpoint does not exist. For request/response examples of core endpoints, see
8
8
  > endpoints.md.
9
9
  >
@@ -46,7 +46,7 @@
46
46
  | POST | `/invoices/search` | Advanced search with filters |
47
47
  | PUT | `/invoices/:resourceId` | Update invoice |
48
48
  | DELETE | `/invoices/:resourceId` | Delete invoice |
49
- | GET | `/invoices/:resourceId/download` | Download PDF |
49
+ | GET | `/invoices/:resourceId/download` | Download PDF; `?documentType=DELIVERY_SLIP` for the delivery slip |
50
50
  | POST | `/invoices/:resourceId/payments` | Record payment(s) |
51
51
  | GET | `/invoices/:resourceId/payments` | List recorded payments (`{data: [...]}`) |
52
52
  | POST | `/invoices/:resourceId/credits` | Apply credit note(s) |
@@ -55,8 +55,8 @@
55
55
  | GET | `/invoices/:resourceId/attachments` | List attachments |
56
56
  | POST | `/invoices/:resourceId/attachments` | Upload attachment |
57
57
  | DELETE | `/invoices/:resourceId/attachments/:attachmentResourceId` | Delete attachment |
58
- | POST | `/invoices/bulk-upsert` | Bulk create/update invoices (max 500); **async**, returns `{ jobId }`. Natural key: `invoiceReference`. ISO 8601 dates only. |
59
- | POST | `/invoices/line-items/bulk-upsert` | Bulk create/update invoices with nested line items (max 500); **async**, returns `{ jobId }`. |
58
+ | POST | `/invoices/bulk-upsert` | **Deprecated** (use `/invoices/line-items/bulk-upsert`); still works. Bulk create/update invoices, one per row (max 500); **async**, returns `{ jobId }`. Natural key: `invoiceReference`. ISO 8601 dates only. |
59
+ | POST | `/invoices/line-items/bulk-upsert` | Bulk create/update invoices with nested line items (max 500); **async**, returns `{ jobId }`. Each row takes an optional `payment` (one per invoice). |
60
60
 
61
61
  ### Bills
62
62
  | Method | Path | Description |
@@ -72,11 +72,12 @@
72
72
  | POST | `/bills/:resourceId/credits` | Apply supplier credit note(s) |
73
73
  | GET | `/bills/:resourceId/credits` | List applied credits |
74
74
  | DELETE | `/bills/:resourceId/credits/:creditsAppliedResourceId` | Reverse credit |
75
+ | GET | `/bills/:resourceId/download` | Download PDF; `?documentType=APPROVAL_RECORD` for the approval record |
75
76
  | GET | `/bills/:resourceId/attachments` | List attachments |
76
77
  | POST | `/bills/:resourceId/attachments` | Upload attachment |
77
78
  | DELETE | `/bills/:resourceId/attachments/:attachmentResourceId` | Delete attachment |
78
- | POST | `/bills/bulk-upsert` | Bulk create/update bills (max 500); **async**, returns `{ jobId }`. Natural key: `billReference`. ISO 8601 dates only. |
79
- | POST | `/bills/line-items/bulk-upsert` | Bulk create/update bills with nested line items (max 500); **async**, returns `{ jobId }`. |
79
+ | POST | `/bills/bulk-upsert` | **Deprecated** (use `/bills/line-items/bulk-upsert`); still works. Bulk create/update bills, one per row (max 500); **async**, returns `{ jobId }`. Natural key: `billReference`. ISO 8601 dates only. |
80
+ | POST | `/bills/line-items/bulk-upsert` | Bulk create/update bills with nested line items (max 500); **async**, returns `{ jobId }`. Each row takes an optional `payment` (one per bill). |
80
81
 
81
82
  ### Orders (Sale Quotes, Sale Orders, Purchase Requests, Purchase Orders)
82
83
  Four entities sharing one shape. Replace `{entity}` with `sale-quotes`, `sale-orders`, `purchase-requests`, or `purchase-orders`. Quotes/requests use `accept`; orders use `confirm`. See `references/orders.md`.
@@ -92,6 +93,7 @@ Four entities sharing one shape. Replace `{entity}` with `sale-quotes`, `sale-or
92
93
  | POST | `/{entity}/:resourceId/void` | Void (cancel) |
93
94
  | POST | `/sale-quotes\|purchase-requests/:resourceId/accept` | Accept (→ ACCEPTED) |
94
95
  | POST | `/sale-orders\|purchase-orders/:resourceId/confirm` | Confirm (→ CONFIRMED) |
96
+ | GET | `/{entity}/:resourceId/download` | Download PDF. Only `/sale-orders` takes `?documentType=ORDER_CONFIRMATION\|DELIVERY_SLIP`; the others refuse `documentType` with 422 |
95
97
  | POST | `/{entity}/:resourceId/fast-fix` | Quick-fix details (`{ attributes }`) |
96
98
  | POST | `/{entity}/bulk-void` | Bulk void (`{ resourceIds }`) |
97
99
  | POST | `/sale-quotes\|purchase-requests/bulk-accept` | Bulk accept (`{ resourceIds }`) |
@@ -111,7 +113,7 @@ Four entities sharing one shape. Replace `{entity}` with `sale-quotes`, `sale-or
111
113
  | GET | `/customer-credit-notes/:resourceId/download` | Download PDF |
112
114
  | POST | `/customer-credit-notes/:resourceId/refunds` | Record refund(s) |
113
115
  | GET | `/customer-credit-notes/:resourceId/refunds` | List refunds |
114
- | POST | `/customer-credit-notes/bulk-upsert` | Bulk create/update (max 500); **async**, returns `{ jobId }`. Natural key: `creditNoteReference`. |
116
+ | POST | `/customer-credit-notes/bulk-upsert` | Bulk create/update (max 500); **async**, returns `{ jobId }`. Natural key: `creditNoteReference`. Each row takes an optional `payment`, recorded as a refund. |
115
117
 
116
118
  ### Supplier Credit Notes
117
119
  | Method | Path | Description |
@@ -124,7 +126,7 @@ Four entities sharing one shape. Replace `{entity}` with `sale-quotes`, `sale-or
124
126
  | DELETE | `/supplier-credit-notes/:resourceId` | Delete |
125
127
  | POST | `/supplier-credit-notes/:resourceId/refunds` | Record refund(s) |
126
128
  | GET | `/supplier-credit-notes/:resourceId/refunds` | List refunds |
127
- | POST | `/supplier-credit-notes/bulk-upsert` | Bulk create/update (max 500); **async**, returns `{ jobId }`. Natural key: `creditNoteReference`. |
129
+ | POST | `/supplier-credit-notes/bulk-upsert` | Bulk create/update (max 500); **async**, returns `{ jobId }`. Natural key: `creditNoteReference`. Each row takes an optional `payment`, recorded as a refund. |
128
130
 
129
131
  ### Journals
130
132
  | Method | Path | Description |
@@ -168,6 +170,7 @@ Four entities sharing one shape. Replace `{entity}` with `sale-quotes`, `sale-or
168
170
  | GET | `/payments/:resourceId` | Get payment record; returns `{data: PaymentRecord}` |
169
171
  | PUT | `/payments/:resourceId` | Update payment; returns `{data: PaymentRecord}` |
170
172
  | DELETE | `/payments/:resourceId` | Delete/void payment |
173
+ | GET | `/payments/:resourceId/download` | Download PDF: receipt (invoice payment), payment advice (bill payment) or refund document (credit note refund) |
171
174
 
172
175
  **Note**: Payment resourceIds come from parent documents (`GET /invoices/:id` → `paymentRecords[].resourceId`). Cashflow transaction IDs from `POST /cashflow-transactions/search` are NOT the same.
173
176
 
@@ -10,7 +10,7 @@ description: >-
10
10
  license: MIT
11
11
  compatibility: Works with Claude Code, Codex CLI, Cursor, Copilot, Claude Cowork, Claude.ai, and any agent that reads markdown. Multi-organization workflows need the `clio` CLI (`npm i -g jaz-clio`); a single organization works through MCP tools alone. Load alongside jaz-jobs for close playbooks, jaz-recipes for IFRS patterns, jaz-api for payload shapes, jaz-conversion for migrations.
12
12
  metadata:
13
- version: "9.10.1"
13
+ version: "9.12.0"
14
14
  ---
15
15
 
16
16
  # Jaz Kit
@@ -13,7 +13,7 @@ description: >-
13
13
  license: MIT
14
14
  compatibility: Works with Claude Code, Claude Cowork, Claude.ai, and any agent that reads markdown. For canonical report types and the standard analytics surface, load the jaz-api skill alongside this one.
15
15
  metadata:
16
- version: "9.10.1"
16
+ version: "9.12.0"
17
17
  ---
18
18
 
19
19
  # Jaz Pseudo-SQL Skill
@@ -10,7 +10,7 @@ description: >-
10
10
  license: MIT
11
11
  compatibility: Works with Claude Code, Claude Cowork, Claude.ai, and any agent that reads markdown. For API payloads, load the jaz-api skill. For individual transaction patterns, load the jaz-recipes skill.
12
12
  metadata:
13
- version: "9.10.1"
13
+ version: "9.12.0"
14
14
  ---
15
15
 
16
16
  # Jobs Skill
@@ -13,7 +13,7 @@ description: >-
13
13
  license: MIT
14
14
  compatibility: Works with Claude Code, Claude Cowork, Claude.ai, and any agent that reads markdown. For API payloads, load the jaz-api skill alongside this one. For the operational close workflows these recipes plug into (month-end close, GST/VAT filing, year-end close), load the jaz-jobs skill.
15
15
  metadata:
16
- version: "9.10.1"
16
+ version: "9.12.0"
17
17
  ---
18
18
 
19
19
  # Transaction Recipes Skill
@@ -4,11 +4,11 @@ Jaz accounting guidance for this workspace. Load the installed Jaz skills for de
4
4
 
5
5
  ## Discovery
6
6
 
7
- Jaz exposes **523 tools across 61 namespaces**. Your tool list shows **3, 61, or 523** entries depending on packaging; **never infer capability from its length.**
7
+ Jaz exposes **526 tools across 61 namespaces**. Your tool list shows **3, 61, or 526** entries depending on packaging; **never infer capability from its length.**
8
8
 
9
9
  - **3**: `search_tools(query)` → `describe_tools(names)` → `execute_tool(name, args)`. Empty query returns the namespace map.
10
10
  - **61**: namespace routers; call one with `{ operation, arguments }`.
11
- - **523**: call operations directly by name.
11
+ - **526**: call operations directly by name.
12
12
 
13
13
  **Before telling the user Jaz cannot do something, call `describe_capabilities`** (the capability map, on all three).
14
14