jaz-clio 9.10.0 → 9.11.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.
@@ -9,11 +9,12 @@ description: >-
9
9
  schedulers, subscriptions, attachments, claim settings, and Jaz Magic extraction. Also use
10
10
  when building API clients, seeding test data, or adding new endpoint support.
11
11
  Request/response examples, the endpoint catalog, and the search filter, syntax
12
- and enum reference are in the jaz-api-reference skill: load it alongside.
12
+ and enum reference are in the jaz-api-reference skill: load it when the task
13
+ needs one of those.
13
14
  license: MIT
14
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.
15
16
  metadata:
16
- version: "9.10.0"
17
+ version: "9.11.0"
17
18
  ---
18
19
 
19
20
  # Jaz API Skill
@@ -30,13 +31,49 @@ Prefer the configured OAuth connection. Local CLI/MCP shares `clio auth login`;
30
31
 
31
32
  The rest of this skill (field names, gotchas, error catalog, dependency order, search filter syntax) applies regardless of invocation path. Read it for *context*, not for HTTP-call construction unless you're in the third bucket.
32
33
 
33
- ## Reading Order
34
-
35
- Numbers are rule numbers; the [Rule Index](#rule-index) below names the file that holds each one.
36
-
37
- **Core fundamentals (read first, every integration):** Identifiers & Dates 1 to 3; Names & Fields 9 to 13; Transaction Creation 14 to 16; Chart of Accounts 17 to 22; Payments / Cross-Currency 4 to 8; Journals & Cash 23 to 26; Credit Notes & Refunds 27 to 28; Reports 36 to 37; Tax Profile Scoping 100; Transaction References 104; Draft Finalization Pipeline 81 to 88; Jaz Magic / PDF-JPG 57 to 63; Currency Rates 39, 49, 105; Withholding Tax 45, 98.
38
-
39
- **Integration depth (API clients, pipelines, batch jobs, MCP/CLI):** Bulk Upsert (Items/Contacts/Rates); Background Jobs (filter `resourceId` not `jobId`); Export Records; Pagination (38); Search & Filter (50 to 56); Response Shape Gotchas (66 to 73); Cash Entry Response Shape (74 to 77); Entity Resolution (78 to 80); Bank Rules (89 to 90d); Fixed Assets (91 to 92c); Subscriptions & Scheduled (93 to 94); niche endpoints (95 to 102); Journals balance (103); Quick Fix (107, 111); TTB (108); Dynamic Strings (109 to 110); Sub-Resource Shapes (112); Nano-Classifier (113); Scheduler Asymmetry (114); Payment Record CRUD (115 to 117); Bulk Upserts transactions (118 to 122); Reconciliation write-side (123 to 127); Drafts lifecycle (128 to 135); Orders: Sale Quotes / Sale Orders / Purchase Requests / Purchase Orders (`references/orders.md`); Claims: records / lifecycle / bulk + conversion + payouts + Employees + Claim Settings (`references/claims.md`); Report templates and packs (161, `references/report-templates.md`).
34
+ ## Core contract
35
+
36
+ These facts settle most requests without opening another file. The number after each is its rule; open the rule only for its edge cases.
37
+
38
+ **Every request**
39
+ - IDs are `resourceId`, never `id`; a reference to another record is `<resource>ResourceId` (1).
40
+ - Transaction dates are `valueDate`, never `issueDate`, `invoiceDate` or `date`. Request dates are `YYYY-MM-DD` strings (2, 3); response dates come back as epoch milliseconds (52).
41
+ - Line item text is `name`, not `description`. The document number is `reference` (9, 13).
42
+
43
+ **Creating and finalizing**
44
+ - Raw REST: omitting `saveAsDraft` creates a FINALIZED record, while the MCP and CLI tools default to a draft, so send it explicitly (14). With `saveAsDraft: false`, every line item needs `accountResourceId` (15).
45
+ - A foreign-currency invoice, bill, credit note or journal takes `currency: { sourceCurrency: "USD", exchangeRate? }`. A `currencyCode` string is silently ignored and a `currency` string is a 400 (25).
46
+ - A create answers only `{ resourceId }`; GET the record for anything else (68). A cash in, cash out or cash transfer create answers its `parentEntityResourceId`, the ID that DELETE and PUT take (74).
47
+ - A draft is finalized by one PUT with `saveAsDraft: false` and `resourceId` in the body (83, 85). Finalized invoices and bills are `UNPAID`, then `PARTIALLY_PAID` and `PAID`; journals are `ACTIVE`. No resource has a `FINALIZED` or `POSTED` status, and `OVERDUE` is not a status either: find overdue documents with `status in [UNPAID, PARTIALLY_PAID]` plus `dueDate lt <today in the organization's timezone>` (67).
48
+ - Journals carry `journalEntries` with `amount` and `type: "DEBIT" | "CREDIT"` (23). Payments go in `{ payments: [...] }`, each with `paymentAmount` (bank currency), `transactionAmount` (document currency), `accountResourceId`, `paymentMethod`, `reference` and `valueDate` (4, 7, 8). Credit notes are applied through a `credits` array with `amountApplied` (27).
49
+
50
+ **Lists and search**
51
+ - A search body is `{ filter?, sort: { sortBy: ["field"], order: "ASC" | "DESC" }, limit: 1-1000, offset }`. `sortBy` is always an array, and `sort` is required whenever `offset` is sent, even `offset: 0` (43, 50).
52
+ - `offset` is a 0-indexed PAGE number, not a row skip: `offset: 1` is the second page of `limit` rows. A few report and ledger reads take a row offset instead (38).
53
+ - A filter is `{ "<field>": { "<operator>": value } }`, and each field type accepts a fixed set of operators; any other is a 400 (51). Which fields an endpoint filters and sorts on, and the values an enum field accepts, are in jaz-api-reference.
54
+ - List and search responses are `{ totalElements, totalPages, data: [...] }` (54).
55
+
56
+ ## Where to look
57
+
58
+ Open only what the task needs, and open the files it names together rather than one at a time. Read the matching section whole rather than searching for fragments: the required fields and refusals sit in the lines under each example. Load the **jaz-api-reference** skill only for an endpoint's exact request and response, the endpoint catalog, or a search field's filters and values; the files in the middle column are in its `references/`.
59
+
60
+ The rules column names each rule file with the rule numbers that apply to the task.
61
+
62
+ | Task | Request and response (jaz-api-reference) | Rules (this skill's `references/`) |
63
+ |------|------------------------------------------|------------------------------------|
64
+ | Create, update, finalize or pay an invoice, bill, credit note, journal, cash entry or cash transfer | `endpoints-transactions.md` | `rules-fundamentals.md` 1-16, 23-28, 31, 40-41, 45, 47-48; `rules-search-magic-shapes.md` 64, 67-70, 74-77, 80-88; `rules-entities-quick-fix.md` 98, 101-104, 108, 112, 115-116 |
65
+ | Search, filter, sort or page | `search-reference.md` (fields per endpoint), `search-enums.md` (values), `search-syntax.md` (a `query` string) | `rules-fundamentals.md` 38, 43; `rules-search-magic-shapes.md` 50-56, 65 |
66
+ | Contacts, items, chart of accounts, tax profiles, currencies and rates, tags, custom fields, contact groups, inventory, bookmarks, catalogs, nano classifiers | `endpoints-master-data.md` | `rules-fundamentals.md` 10-12, 16-22, 29-30, 34-35e, 39, 46-47, 49; `rules-search-magic-shapes.md` 66, 71-73, 78; `rules-entities-quick-fix.md` 96-97, 99-100, 105-106, 113; `rules-bulk-recon-drafts.md` 136-137c, 140-141 |
67
+ | Bank records, the cashflow ledger, Jaz Magic extraction, deposits, bank rules | `endpoints-banking-magic.md` | `rules-fundamentals.md` 44, 47-47a; `rules-search-magic-shapes.md` 57-63; `rules-entities-quick-fix.md` 89-90d, 110 |
68
+ | Reconciliation, drafts lifecycle, transaction bulk upserts | `full-api-surface.md` (catalog) | `rules-bulk-recon-drafts.md` 118-135, 158-160 |
69
+ | Schedulers, subscriptions, reports, exports, report templates | `endpoints-schedules-reports.md` | `rules-fundamentals.md` 32-33, 36-37a, 42; `rules-entities-quick-fix.md` 93-94, 109, 114; `rules-bulk-recon-drafts.md` 147, 161; `report-templates.md` |
70
+ | Fixed assets, deferrals, leases, loans, payroll | `endpoints-assets-payroll.md` | `rules-entities-quick-fix.md` 91-92c, 117; `rules-bulk-recon-drafts.md` 122 |
71
+ | Quick Fix, Ledger Find & Fix, contacts bulk upsert, background jobs | `endpoints-bulk-edits.md` | `rules-fundamentals.md` (bulk upsert and background jobs sections); `rules-entities-quick-fix.md` 107-107a, 111; `rules-bulk-recon-drafts.md` 119, 136-137c |
72
+ | An error code or message | | `errors.md` |
73
+ | A field name that is easy to guess wrong | | `field-map.md` |
74
+ | Sale quotes and orders, purchase requests and orders, expense claims | | `orders.md`, `claims.md` |
75
+
76
+ A rule number cited anywhere resolves through the [Rule Index](#rule-index) below.
40
77
 
41
78
  ## When to Use This Skill
42
79
 
@@ -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
 
@@ -11,7 +11,7 @@ description: >-
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.0"
14
+ version: "9.11.0"
15
15
  ---
16
16
 
17
17
  # Clio CLI Skill
@@ -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
 
@@ -20,8 +20,8 @@ Complete reference for all 80 command groups. Organized by domain.
20
20
  | `download <id>` | `--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 |
@@ -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.0"
12
+ version: "9.11.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
  {
@@ -11,11 +11,12 @@ description: >-
11
11
  for each filter field. Load it when building or debugging a request body,
12
12
  checking whether an endpoint exists, writing a search filter, or confirming
13
13
  an enum value. The numbered API rules, error catalog, and field name mapping
14
- live in the jaz-api skill: load both together.
14
+ live in the jaz-api skill: load it with this one, since its core contract
15
+ holds the rules most requests need (statuses, paging, IDs).
15
16
  license: MIT
16
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.
17
18
  metadata:
18
- version: "9.10.0"
19
+ version: "9.11.0"
19
20
  ---
20
21
 
21
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) |
@@ -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 |
@@ -75,8 +75,8 @@
75
75
  | GET | `/bills/:resourceId/attachments` | List attachments |
76
76
  | POST | `/bills/:resourceId/attachments` | Upload attachment |
77
77
  | 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 }`. |
78
+ | 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. |
79
+ | 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
80
 
81
81
  ### Orders (Sale Quotes, Sale Orders, Purchase Requests, Purchase Orders)
82
82
  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`.
@@ -111,7 +111,7 @@ Four entities sharing one shape. Replace `{entity}` with `sale-quotes`, `sale-or
111
111
  | GET | `/customer-credit-notes/:resourceId/download` | Download PDF |
112
112
  | POST | `/customer-credit-notes/:resourceId/refunds` | Record refund(s) |
113
113
  | 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`. |
114
+ | 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
115
 
116
116
  ### Supplier Credit Notes
117
117
  | Method | Path | Description |
@@ -124,7 +124,7 @@ Four entities sharing one shape. Replace `{entity}` with `sale-quotes`, `sale-or
124
124
  | DELETE | `/supplier-credit-notes/:resourceId` | Delete |
125
125
  | POST | `/supplier-credit-notes/:resourceId/refunds` | Record refund(s) |
126
126
  | 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`. |
127
+ | 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
128
 
129
129
  ### Journals
130
130
  | Method | Path | Description |
@@ -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.0"
13
+ version: "9.11.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.0"
16
+ version: "9.11.0"
17
17
  ---
18
18
 
19
19
  # Jaz Pseudo-SQL Skill
@@ -40,7 +40,7 @@ Don't write a pseudo-SQL query from memory. The catalog grows; column names chan
40
40
 
41
41
  | Use this instead | When |
42
42
  |---|---|
43
- | `download_export(exportType='analysis-anomalous-invoices')` etc. | Canonical anomaly / audit / risk reports; they're tuned, parameterized, and faster than re-deriving them in SQL. See jaz-api Rule 141. |
43
+ | `download_export(exportType='analysis-anomalous-invoices')` etc. | Canonical anomaly / audit / risk reports; they're tuned, parameterized, and faster than re-deriving them in SQL. |
44
44
  | `download_export(exportType='trial-balance')` etc. | Statements (TB, BS, P&L, GL, cashflow). The reporting engine handles period closing rules, intercompany eliminations, FX revaluation. SQL would miss these. |
45
45
  | `search_invoices(filter:...)`, `search_bills`, etc. | Listing entities with structured filters. Returns typed objects, supports pagination, faster than SQL. |
46
46
  | `get_invoice(resourceId)` etc. | Single-entity lookup by ID. |
@@ -76,7 +76,7 @@ The pre-terminal states are `PENDING` and `RUNNING`; these are normal during pol
76
76
 
77
77
  If you hit `PSEUDOSQL_VALIDATION_ERROR: unknown table` repeatedly, the underlying data isn't in the curated schema:
78
78
 
79
- - For canonical analytics reports → `download_export(exportType=...)`. See jaz-api Rule 141.
79
+ - For canonical analytics reports → `download_export(exportType=...)`.
80
80
  - For raw entity dumps (e.g., every invoice as a row) → `export_records`.
81
81
  - For one-off entity lookups → `get_invoice` / `get_bill` / etc.
82
82
  - For filtered listings with structured criteria → `search_invoices` / `search_bills` / etc.
@@ -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.0"
13
+ version: "9.11.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.0"
16
+ version: "9.11.0"
17
17
  ---
18
18
 
19
19
  # Transaction Recipes Skill