jaz-clio 9.10.1 → 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.
@@ -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.11.0"
18
18
  ---
19
19
 
20
20
  # Jaz API Skill
@@ -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.1"
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.1"
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
  {
@@ -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.11.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) |
@@ -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.1"
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.1"
16
+ version: "9.11.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.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.1"
16
+ version: "9.11.0"
17
17
  ---
18
18
 
19
19
  # Transaction Recipes Skill