jaz-clio 5.39.2 → 5.40.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 +2 -2
- package/assets/skills/api/SKILL.md +4 -2
- package/assets/skills/api/references/endpoints.md +20 -2
- package/assets/skills/api/references/errors.md +16 -0
- package/assets/skills/api/references/feature-glossary.md +2 -2
- package/assets/skills/api/references/field-map.md +1 -0
- package/assets/skills/cli/SKILL.md +1 -1
- package/assets/skills/conversion/SKILL.md +1 -1
- package/assets/skills/jaz-kit/SKILL.md +1 -1
- package/assets/skills/jaz-pseudo-sql/SKILL.md +1 -1
- package/assets/skills/jobs/SKILL.md +1 -1
- package/assets/skills/transaction-recipes/SKILL.md +1 -1
- package/cli.mjs +427 -427
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<p align="center"><b>Jaz accounting on the command line, and inside any AI agent.</b></p>
|
|
11
11
|
|
|
12
|
-
358 tools · 66 command groups · 7 skills · 13 calculators · 12 close playbooks ·
|
|
12
|
+
358 tools · 66 command groups · 7 skills · 13 calculators · 12 close playbooks · 159 field-tested API rules.
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
npm install -g jaz-clio
|
|
@@ -109,7 +109,7 @@ Several companies at once: comma-separate the keys, or use a personal access tok
|
|
|
109
109
|
|
|
110
110
|
## Skills
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
159 API rules from production testing: field-name maps, error-recovery patterns, response-shape quirks, plus 12 job playbooks. Installable into any agent project, no server involved.
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
clio init # auto-detect the agent, install skills + agent-rules
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jaz-api
|
|
3
|
-
version: 5.
|
|
3
|
+
version: 5.40.0
|
|
4
4
|
description: >-
|
|
5
5
|
Use this skill whenever you call, debug, or review code that touches the Jaz
|
|
6
|
-
REST API. Covers field names, response shapes,
|
|
6
|
+
REST API. Covers field names, response shapes, 159 production gotchas, error
|
|
7
7
|
recovery (422/400/404/500), search filters, pagination, and edge cases for
|
|
8
8
|
every endpoint — invoices, bills, credit notes, journals, cash entries,
|
|
9
9
|
payments, contacts, CoA, items, tax profiles, bank records, fixed assets,
|
|
@@ -547,3 +547,5 @@ When the user wants to OPEN, SEE, or SHARE something in the Jaz dashboard ("open
|
|
|
547
547
|
- **jaz-jobs** — 12 accounting job playbooks (month-end close, bank recon, GST/VAT filing, etc.)
|
|
548
548
|
- **jaz-conversion** — Data migration workflows from Xero, QuickBooks, Sage, MYOB, and Excel
|
|
549
549
|
- **jaz-cli** — CLI command reference, auth, output formats, pagination, and workflow patterns
|
|
550
|
+
|
|
551
|
+
160. **Payment `adjustment` is a CASH-LEG-only correction — it never moves the document balance.** Records an overpayment or a rounding difference on the bank side of a payment: `netCash = paymentAmount -/+ fees +/- adjustmentValue` (fees are deducted from cash received on an invoice and added to cash spent on a bill). AR/AP is untouched, so an overpaid invoice stays PAID with the excess sitting on the account you chose and NO credit note is created. Shape: `adjustment: { adjustmentValue, adjustmentAccountResourceId, adjustmentDescription? }` — signed, non-zero, max 2dp, always FLAT (never a percentage), never taxed. Accepted on `pay_invoice` / `pay_bill` / both credit-note refunds / `update_payment` / both receipt reconciliations. **NOT** on batch payments, and not for `DEBT_WRITE_OFF` / `CLEARING_SETTLEMENT` / `INTER_COMPANY` / `WITHHOLDING_TAX_CERTIFICATE` (those record a settlement, so there is no cash leg). The account must be non-controlled: not AR/AP, not the VAT or FX accounts, not bank/cash, not deposit-linked. **Write/read asymmetry:** you WRITE the nested `adjustment.adjustmentValue` but READ a flat `adjustmentAmount` on the payment record, alongside `adjustmentOrganizationAccountResourceId`. Don't confuse either with `lineItems[].taxVatAdjustment.adjustmentAmount`, which is line-item tax and unrelated. **On `update_payment`, omitting `adjustment` CLEARS it** — same as `transactionFee`, but NOT the same as `transactionFeeCollected`, which is preserved when omitted. On a reconciled payment that carries one, any update omitting it returns `PAYMENT_ADJUSTMENT_CANNOT_CHANGE_WHEN_RECONCILED` even if you only touched the reference.
|
|
@@ -2081,8 +2081,26 @@ Update an existing payment record. All fields optional — only included fields
|
|
|
2081
2081
|
"paymentMethod": "BANK_TRANSFER",
|
|
2082
2082
|
"accountResourceId": "uuid-bank",
|
|
2083
2083
|
"currency": { "sourceCurrency": "USD", "exchangeRate": 0.74 },
|
|
2084
|
-
|
|
2085
|
-
"
|
|
2084
|
+
// Both fees are OBJECTS, not a number and not a boolean. A bare value is rejected.
|
|
2085
|
+
"transactionFee": {
|
|
2086
|
+
"feeAccountResourceId": "uuid-fee-expense",
|
|
2087
|
+
"feeType": "FLAT",
|
|
2088
|
+
"feeValue": 5.00,
|
|
2089
|
+
"feeTaxVatApplicable": false
|
|
2090
|
+
},
|
|
2091
|
+
"transactionFeeCollected": {
|
|
2092
|
+
"feeAccountResourceId": "uuid-fee-income",
|
|
2093
|
+
"feeType": "FLAT",
|
|
2094
|
+
"feeValue": 2.00,
|
|
2095
|
+
"feeTaxVatApplicable": false
|
|
2096
|
+
},
|
|
2097
|
+
// Cash-leg adjustment: overpayment or rounding. Bank leg only, never AR/AP.
|
|
2098
|
+
// Omitting this on an update CLEARS an existing adjustment.
|
|
2099
|
+
"adjustment": {
|
|
2100
|
+
"adjustmentValue": -0.03,
|
|
2101
|
+
"adjustmentAccountResourceId": "uuid-rounding-account",
|
|
2102
|
+
"adjustmentDescription": "rounding difference"
|
|
2103
|
+
}
|
|
2086
2104
|
}
|
|
2087
2105
|
|
|
2088
2106
|
// Response: same shape as GET
|
|
@@ -851,6 +851,22 @@ Journals support a top-level `currency` object to create entries in a foreign cu
|
|
|
851
851
|
|
|
852
852
|
**Cashflow transaction ID ≠ payment ID** — These are different entities. Cashflow transactions are a ledger view; payment records are the actual payment objects attached to invoices/bills.
|
|
853
853
|
|
|
854
|
+
#### Payment adjustment errors (422)
|
|
855
|
+
|
|
856
|
+
The `adjustment` object on a payment is validated server-side. The API returns the code as `error_type` with a human message. Do NOT pre-validate any of these — surface the 422.
|
|
857
|
+
|
|
858
|
+
Two of the seven never reach you through this path: a zero `adjustmentValue` and a missing `adjustmentAccountResourceId` are caught by the API layer's own field validation first and come back as a `validation_error`, not as the code below. `INVALID_PAYMENT_ADJUSTMENT_AMOUNT` still reaches you via the decimal-scale rule.
|
|
859
|
+
|
|
860
|
+
| `error_type` | Cause | Fix |
|
|
861
|
+
|---|---|---|
|
|
862
|
+
| `INVALID_PAYMENT_ADJUSTMENT_AMOUNT` | `adjustmentValue` is zero, or has more than 2 decimal places | Send a non-zero value rounded to 2dp. Zero is the absence of an adjustment, not an adjustment of nothing — omit the object instead |
|
|
863
|
+
| `PAYMENT_ADJUSTMENT_ACCOUNT_REQUIRED` | No `adjustmentAccountResourceId` | Supply one |
|
|
864
|
+
| `INVALID_PAYMENT_ADJUSTMENT_ACCOUNT` | Account is a control account (AR, AP, the VAT pair, the FX accounts, Retained Earnings, withholding tax), a bank or cash account, deposit-linked, missing, or deleted | Pick an ordinary postable account. Most seeded accounts qualify — Rounding, Other Income, Bank Charges |
|
|
865
|
+
| `PAYMENT_ADJUSTMENT_MAKES_NET_CASH_INVALID` | Net cash would not remain above zero | Reduce the magnitude of a negative adjustment |
|
|
866
|
+
| `PAYMENT_ADJUSTMENT_NOT_APPLICABLE_FOR_PAYMENT_METHOD` | Method is `DEBT_WRITE_OFF`, `CLEARING_SETTLEMENT`, `INTER_COMPANY` or `WITHHOLDING_TAX_CERTIFICATE` | Those record a settlement, not a bank movement, so there is no cash leg to adjust. Drop the adjustment |
|
|
867
|
+
| `PAYMENT_ADJUSTMENT_CANNOT_CHANGE_WHEN_RECONCILED` | The payment is matched to a bank statement entry and the request would change its adjustment | Un-reconcile first, or resend the existing adjustment unchanged. **This fires even when you are only editing `reference`**, because omitting `adjustment` reads as clearing it |
|
|
868
|
+
| `PAYMENT_ADJUSTMENT_NOT_APPLICABLE_FOR_BATCH_PAYMENT` | Batch payments do not support adjustments | Record the adjustment on an individual payment |
|
|
869
|
+
|
|
854
870
|
---
|
|
855
871
|
|
|
856
872
|
### Sub-Resource Response Errors
|
|
@@ -12,7 +12,7 @@ Sales documents sent to customers for goods/services rendered. Track Accounts Re
|
|
|
12
12
|
|
|
13
13
|
Key capabilities: draft/approval workflows, multi-currency (auto-fetch ECB rates or custom org rates), scheduled/recurring invoices with dynamic scheduler strings, delivery slips, sales subscriptions with proration, bulk import (up to 1,000), Quick Fix for bulk field edits, GST/VAT adjustments.
|
|
14
14
|
|
|
15
|
-
If payment date equals invoice date, it's recorded as a cash transaction (not AR). Transaction fees are deducted from cash received. RGL = `(Invoice payment / Transaction Rate) - (Cash received / Payment Rate)`.
|
|
15
|
+
If payment date equals invoice date, it's recorded as a cash transaction (not AR). Transaction fees are deducted from cash received, and a payment `adjustment` shifts the cash leg further (net cash = paymentAmount - feesCharged + feesCollected +/- adjustmentValue) without touching AR. RGL = `(Invoice payment / Transaction Rate) - (Cash received / Payment Rate)`.
|
|
16
16
|
|
|
17
17
|
**API**: CRUD `GET/POST/PUT/DELETE /invoices`, `POST /invoices/search`, `POST /invoices/:id/payments`, `GET /invoices/:id/payments`, `POST /invoices/:id/credits`, `GET /invoices/:id/download`, `POST/GET/DELETE /invoices/:id/attachments`, `PUT /invoices/:id/approve`, `POST /scheduled/invoices` (CRUD), `POST /scheduled/subscriptions` (recurring). Generic payment ops: `GET/PUT/DELETE /payments/:id`. **Starting from a PDF/JPG attachment?** Use `POST /magic/createBusinessTransactionFromAttachment` instead — Jaz Magic handles extraction & autofill (see AI Agents section).
|
|
18
18
|
|
|
@@ -38,7 +38,7 @@ Purchase documents from suppliers for goods/services received. Track Accounts Pa
|
|
|
38
38
|
|
|
39
39
|
Key capabilities: bill receipts (short-form template creating bill + payment together), purchase order PDFs from drafts, scheduled/recurring bills, WHT certificate payments (always credited to WHT Payable account), bulk import.
|
|
40
40
|
|
|
41
|
-
Transaction fees are added to cash spent (not deducted like invoices). RGL = `(Cash spent / Payment rate) - (Bill payment / Transaction rate)`.
|
|
41
|
+
Transaction fees are added to cash spent (not deducted like invoices), and a payment `adjustment` shifts the cash leg further without touching AP. RGL = `(Cash spent / Payment rate) - (Bill payment / Transaction rate)`.
|
|
42
42
|
|
|
43
43
|
**API**: CRUD `GET/POST/PUT/DELETE /bills`, `POST /bills/search`, `POST /bills/:id/payments`, `GET /bills/:id/payments`, `POST /bills/:id/credits`, `POST/GET/DELETE /bills/:id/attachments`, `PUT /bills/:id/approve`, `POST /scheduled/bills` (CRUD). Generic payment ops: `GET/PUT/DELETE /payments/:id`. **Starting from a PDF/JPG attachment?** Use `POST /magic/createBusinessTransactionFromAttachment` instead — Jaz Magic handles extraction & autofill (see AI Agents section).
|
|
44
44
|
|
|
@@ -636,6 +636,7 @@ Battle-tested patterns from production Jaz API clients:
|
|
|
636
636
|
| `cashflowId` | ≠ `resourceId` | Cashflow transaction IDs are NOT payment IDs — different entities |
|
|
637
637
|
| `bankAccountId` | `accountResourceId` | Bank account for the payment |
|
|
638
638
|
| `fee` | `feeAmount` (response) / `transactionFee` (update) | Response field is `feeAmount`, update field is `transactionFee` |
|
|
639
|
+
| `adjustment` (cash-leg over/underpayment) | `adjustment: { adjustmentValue, adjustmentAccountResourceId, adjustmentDescription }` | Write nested; READ back flat as `adjustmentAmount` + `adjustmentOrganizationAccountResourceId`. Bank leg only |
|
|
639
640
|
| `isCrossCurrency` | `crossCurrency` | Boolean, no `is` prefix |
|
|
640
641
|
| `currency` (string) | `currencyCode` (response) / `currency` (update: `{ sourceCurrency, exchangeRate }`) | Response is flat string, update is object |
|
|
641
642
|
|