jaz-clio 5.46.11 → 5.46.12

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-api
3
- version: 5.46.11
3
+ version: 5.46.12
4
4
  description: >-
5
5
  Use this skill whenever you call, debug, or review code that touches the Jaz
6
6
  REST API. Covers field names, response shapes, 159 production gotchas, error
@@ -363,7 +363,7 @@ Bills, invoices, and credit notes share identical mandatory field specs. Adding
363
363
  108. **Transfer Trial Balance** (`POST /api/v1/transfer-trial-balance`) creates opening balance entries. Uses `journalEntries` (NOT `lines` — this is a journal type). Always ACTIVE (no draft mode), reference auto-generated as "Transfer Trial Balance", minimum 1 entry, entries cannot have 0 amounts, skips lock date validation. **`valueDate` must be today or in the past** — future dates are rejected with "Opening data cannot be future date". Each entry: `{ accountResourceId, type: "DEBIT"|"CREDIT", amount }`.
364
364
 
365
365
  ### Scheduler Dynamic Strings
366
- 109. **Scheduler placeholder strings** — All scheduled transactions (invoices, bills, journals, subscriptions) support dynamic strings in any free text field (`reference`, line item `name`, `notes`). Strings are replaced with values relative to the **transaction date**: `{{Day}}` → day name (Monday), `{{Date}}` → full date (09 Mar 2026), `{{Date+X}}` → date + X days, `{{DateRange:X}}` → date range spanning X days (min 1, max 999), `{{Month}}` → month name (March), `{{Month+X}}` → month + X months, `{{MonthRange:X}}` → month range spanning X months, `{{Year}}` → year (2026), `{{Year+X}}` → year + X years. Example: `reference: "INV-{{Month}}-{{Year}}"` → `"INV-March-2026"` for a March transaction.
366
+ 109. **Scheduler placeholder strings** — All scheduled transactions (invoices, bills, journals, subscriptions) support dynamic strings in any free text field (`reference`, line item `name`, `notes`). **Scheduled JOURNALS are the exception**: their line field is `description`, not `name`, and they have no notes field at all — neither `notes` nor `internalNotes` is on the create or update contract. Probed 2026-09-02: both are accepted like any unknown key and never read back, so for journals the only dynamic-string field is `reference`. Strings are replaced with values relative to the **transaction date**: `{{Day}}` → day name (Monday), `{{Date}}` → full date (09 Mar 2026), `{{Date+X}}` → date + X days, `{{DateRange:X}}` → date range spanning X days (min 1, max 999), `{{Month}}` → month name (March), `{{Month+X}}` → month + X months, `{{MonthRange:X}}` → month range spanning X months, `{{Year}}` → year (2026), `{{Year+X}}` → year + X years. Example: `reference: "INV-{{Month}}-{{Year}}"` → `"INV-March-2026"` for a March transaction.
367
367
 
368
368
  ### Bank Rule Dynamic Strings
369
369
  110. **Bank rule placeholder strings** — Bank reconciliation rules support dynamic strings in any free text field (`name`, `reference`, cash entry description). Strings are replaced with actual **bank record** values during reconciliation: `{{bankReference}}` → bank record reference (e.g., INV-03/01/2025-01), `{{bankPayee}}` → payer/payee name (e.g., Fruit Planet), `{{bankDescription}}` → transaction description (e.g., QR Payment). Example: `reference: "{{bankPayee}} - {{bankReference}}"`.
@@ -647,7 +647,7 @@ Bills and supplier credit notes support withholding tax per line item:
647
647
  "reference": "JV-001",
648
648
  "valueDate": "2026-02-08",
649
649
  "journalEntries": [
650
- { "accountResourceId": "uuid", "amount": 500, "type": "DEBIT", "contactResourceId": "uuid" },
650
+ { "accountResourceId": "uuid", "amount": 500, "type": "DEBIT", "description": "Line note" },
651
651
  { "accountResourceId": "uuid", "amount": 500, "type": "CREDIT" }
652
652
  ]
653
653
  }
@@ -661,7 +661,10 @@ Bills and supplier credit notes support withholding tax per line item:
661
661
  - Do NOT use `debit`/`credit` as separate number fields — that is WRONG
662
662
  - Do NOT include `currency` at top level — causes "Invalid request body"
663
663
  - Total DEBIT amounts MUST equal total CREDIT amounts
664
- - `contactResourceId` is optional per entry
664
+ - `contactResourceId` is a TOP-LEVEL field, NOT per entry. Probed 2026-09-02: an entry-level
665
+ `contactResourceId` is silently discarded (an int there is accepted like any unknown key, while an
666
+ int on `description` or `taxProfileResourceId` returns 400), and a real contact id on an entry does
667
+ not appear on the created journal. Put it at the top level, where it does land.
665
668
 
666
669
  ---
667
670
 
@@ -1356,8 +1359,8 @@ Same but with `"bill"` wrapper instead of `"invoice"`.
1356
1359
  "valueDate": "2026-03-01",
1357
1360
  "saveAsDraft": false,
1358
1361
  "schedulerEntries": [
1359
- { "accountResourceId": "uuid", "amount": 100, "type": "DEBIT", "name": "Monthly accrual" },
1360
- { "accountResourceId": "uuid", "amount": 100, "type": "CREDIT", "name": "Monthly accrual" }
1362
+ { "accountResourceId": "uuid", "amount": 100, "type": "DEBIT", "description": "Monthly accrual" },
1363
+ { "accountResourceId": "uuid", "amount": 100, "type": "CREDIT", "description": "Monthly accrual" }
1361
1364
  ],
1362
1365
  "repeat": "MONTHLY",
1363
1366
  "startDate": "2026-03-01",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-cli
3
- version: 5.46.11
3
+ version: 5.46.12
4
4
  description: >-
5
5
  Use this skill when running Clio CLI commands, building shell scripts with
6
6
  Clio, debugging auth issues, understanding --json output, paginating results,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-conversion
3
- version: 5.46.11
3
+ version: 5.46.12
4
4
  description: >-
5
5
  Use this skill when migrating accounting data into Jaz — importing from Xero,
6
6
  QuickBooks, Sage, MYOB, or Excel exports. Covers the full conversion pipeline:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-kit
3
- version: 5.46.11
3
+ version: 5.46.12
4
4
  description: >-
5
5
  Use this skill when an accountant, bookkeeper, or owner is running real books
6
6
  in Jaz across one or more organizations from the terminal — setting up a
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-pseudo-sql
3
- version: 5.46.11
3
+ version: 5.46.12
4
4
  description: >-
5
5
  Use this skill when answering ad-hoc data questions that aren't covered by
6
6
  download_export (canonical reports — anomaly, audit, aging, P&L, BS, GL,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-jobs
3
- version: 5.46.11
3
+ version: 5.46.12
4
4
  description: >-
5
5
  Use this skill for recurring accounting workflows — month/quarter/year-end
6
6
  close, bank reconciliation, GST/VAT filing, payment runs, credit control,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-recipes
3
- version: 5.46.11
3
+ version: 5.46.12
4
4
  description: >-
5
5
  Use this skill when modeling complex multi-step accounting transactions —
6
6
  anything that spans multiple periods, involves changing amounts, or requires
package/cli.mjs CHANGED
@@ -793,9 +793,9 @@ Supported: ${dm.join(", ")}.
793
793
 
794
794
  ALTERNATIVE \u2014 for 5 recipes (loan, lease, prepaid-expense, deferred-revenue, accrued-expense) server-side capsule-recipe engine is also available via capsuleRecipe payload on create_bill/create_invoice/create_journal/create_cash_in.
795
795
 
796
- Requires startDate. Auto-resolves accounts from CoA. Provide bankAccountName for recipes with cash-in/cash-out steps, contactName for recipes with invoice/bill steps.`,params:{recipe:{type:"string",enum:[...dm],description:"Recipe type"},amount:{type:"number"},principal:{type:"number"},startDate:{type:"string",description:"Start date YYYY-MM-DD (REQUIRED for execution)"},currency:{type:"string"},periods:{type:"number"},frequency:{type:"string",enum:["monthly","quarterly","annual"]},annualRate:{type:"number"},termMonths:{type:"number"},monthlyPayment:{type:"number"},usefulLifeMonths:{type:"number"},cost:{type:"number"},salvageValue:{type:"number"},usefulLifeYears:{type:"number"},method:{type:"string",enum:["sl","ddb","150db"]},acquisitionDate:{type:"string"},disposalDate:{type:"string"},proceeds:{type:"number"},bookRate:{type:"number",description:"Original booking rate. Declare which way it reads via rateDirection (REQUIRED for fx-reval)."},closingRate:{type:"number",description:"Period-end closing rate. Same direction as bookRate."},rateDirection:{type:"string",enum:["FUNCTIONAL_TO_SOURCE","SOURCE_TO_FUNCTIONAL"],description:"REQUIRED for fx-reval. FUNCTIONAL_TO_SOURCE = 1 base unit = N foreign, what list_currency_rates returns. SOURCE_TO_FUNCTIONAL = 1 foreign unit = N base, the everyday quote."},position:{type:"string",enum:["ASSET","LIABILITY"],description:"Balance-sheet side: ASSET (receivable/deposit, default) or LIABILITY (payable/provision). A rising base value is a gain on an asset and a loss on a liability."},baseCurrency:{type:"string"},buckets:{type:"array",items:{type:"object",properties:{name:{type:"string"},balance:{type:"number"},rate:{type:"number"}},required:["name","balance","rate"]}},existingProvision:{type:"number"},compounding:{type:"string",enum:["none","monthly","quarterly","annually"]},employees:{type:"number"},daysPerYear:{type:"number"},dailyRate:{type:"number"},declarationDate:{type:"string"},paymentDate:{type:"string"},withholdingRate:{type:"number"},bankAccountName:{type:"string",description:"Bank/cash account name (for cash-in/cash-out steps) \u2014 auto-resolved by fuzzy match"},contactName:{type:"string",description:"Contact name (for invoice/bill steps) \u2014 auto-resolved by fuzzy match"},existingTxnId:{type:"string",description:"Attach to existing transaction \u2014 skip initial step"},referencePrefix:{type:"string",description:"Reference prefix (generates prefix-1, prefix-2, ...)"},finalize:{type:"boolean",description:"Approve transactions immediately (default: drafts)"}},required:["recipe","startDate"],group:"recipes",readOnly:!1,searchHint:"execute transaction recipe capsule blueprint with dated steps. Posts depreciation, amortization, prepaid, deferred revenue, IFRS 16 lease, hire purchase, loan, fixed deposit, FX revaluation, ECL, IAS 37 provision, asset disposal, accrued expense, leave accrual, dividend entries.",maxResultSizeChars:1e5,execute:async(t,e)=>{let r=e.recipe,n=Mo(r,e),i=uB(n);if(!i)throw new Error("No blueprint generated. Ensure startDate is provided.");let o=MI(r,n),s=await _it(t.client,o.plan.requiredAccounts);if(s.failures.length>0){let u=s.failures.map(d=>`${d.name}${d.candidates.length>0?` (closest: ${d.candidates.join(", ")})`:""}`).join("; ");throw new Error(`Cannot auto-resolve ${s.failures.length} account(s): ${u}. Create them in Jaz first.`)}let a;e.contactName&&(a=(await Dit(t.client,e.contactName)).resourceId);let c;return e.bankAccountName&&(c=(await Sit(t.client,e.bankAccountName)).resourceId),lz(t.client,{blueprint:i,calcType:r,accountMap:s.mapping,bankAccountId:c,contactId:a,existingTxnId:e.existingTxnId,referencePrefix:e.referencePrefix,finalize:e.finalize})}},{name:"list_capsule_recipes",description:"Server-side recipe lifecycle (NOT the offline calculator \u2014 for offline planning use plan_recipe + execute_recipe). List all registered IFRS capsule recipes with per-version JSON Schemas. Source of truth for recipeName values used in capsuleRecipe payloads on trigger mutations (create_bill, create_journal, create_cash_in, etc.) \u2014 DON'T hard-code the 5 enum values. Each descriptor carries displayName, capsuleType, requiresBaseTransaction, allowedBaseTransactionTypes[], expectedAtomTypes[], and versions[] with inputSchema (JSON Schema Draft 7) per version.",params:{},required:[],group:"capsule_recipes",readOnly:!0,isConcurrencySafe:!0,searchHint:"list available IFRS capsule recipes amortization deferred revenue loan lease accrual",execute:async t=>Rz(t.client)},{name:"get_capsule_recipe",description:"Get one capsule recipe descriptor by enum name. inputSchema at `data.versions[0].inputSchema` (NOT top-level). Carries `allowedBaseTransactionTypes`, `x-accountClass` per *AccountResourceId slot, `x-baseTrxBinding` for auto-fills, and `versions[].templateSlots[]` \u2014 the slotKeys + supportedVariables you can pass to capsuleRecipe.templateOverrides (Customize Recipe). Use list_capsule_recipes for available names.",params:{name:{type:"string",description:"Recipe enum name (uppercase, see list_capsule_recipes for valid values)."}},required:["name"],group:"capsule_recipes",readOnly:!0,isConcurrencySafe:!0,searchHint:"recipe descriptor inputs required fields prepaid loan deferred lease accrual",execute:async(t,e)=>xz(t.client,e.name)},{name:"preview_capsule_recipe",description:"Compute the blueprint a recipe would build, WITHOUT persisting. Returns { legs[], expectedOutput[], previewMarkdown }. **Pre-flight gate** before sending capsuleRecipe payloads \u2014 trigger mutations silently null on publish failure but preview surfaces every problem as a clean 422 (ERR_RECIPE_ACCOUNT_CURRENCY_MISMATCH, RECIPE_INVALID_BASE_TRANSACTION_TYPE, ERR_RECIPE_OVERRIDE_* \u2014 Rule 143). Also the gate for templateOverrides: invalid slotKeys/variables come back as ERR_RECIPE_OVERRIDE_* here. The base-trx triplet (baseTransactionResourceId, baseTransactionType, organizationResourceId) is all-or-nothing \u2014 supply all three to auto-fill totalAmount/currency/anchor dates, OR omit all three for a pure compute preview.",params:{recipeName:{type:"string",description:"Recipe enum name. Source of truth: list_capsule_recipes."},recipeVersion:{type:"number",description:"Optional version pin (default: latest registered)."},inputs:{type:"object",description:"Recipe-specific inputs object. See descriptor.versions[].inputSchema (via get_capsule_recipe) for per-recipe shape. Must be non-null."},baseTransactionResourceId:{type:"string",description:"Optional base-trx UUIDv4. Triplet is all-or-nothing."},baseTransactionType:{type:"string",description:"Optional. Must be one of allowedBaseTransactionTypes for the recipe (SALE | PURCHASE | JOURNAL_MANUAL | JOURNAL_DIRECT_CASH_IN | JOURNAL_DIRECT_CASH_OUT | JOURNAL_CASHFLOW). Triplet is all-or-nothing."},organizationResourceId:{type:"string",description:"Optional org UUIDv4. Triplet is all-or-nothing."},templateOverrides:ist},required:["recipeName","inputs"],group:"capsule_recipes",readOnly:!0,isConcurrencySafe:!0,searchHint:"preview recipe blueprint amortization schedule without posting verify inputs",execute:async(t,e)=>{let r=e;return pa(r),Tz(t.client,r)}},{name:"resume_capsule_recipe",description:"Server-side recipe lifecycle. Resume a FAILED recipe job from the leg that failed. NOT idempotent \u2014 each call counts toward the 3-attempt limit. After 3 same-leg failures the job is terminally BLOCKED_AFTER_3_RESUME_ATTEMPTS and only rollback_capsule_recipe remains. Returns the updated CapsuleRecipeJob handle with status, resumeAttempts, terminalReason.",params:{capsuleResourceId:{type:"string",description:"UUIDv4 of the capsule whose recipe job is being resumed."}},required:["capsuleResourceId"],group:"capsule_recipes",readOnly:!1,searchHint:"retry failed recipe job leg resume after failure",execute:async(t,e)=>Bz(t.client,e.capsuleResourceId)},{name:"rollback_capsule_recipe",description:`Server-side recipe lifecycle. Delete every scheduler atom posted by this capsule's recipe. dryRun=true returns the would-delete list without deleting (idempotent, safe to call repeatedly). dryRun=false performs the delete. Status enum: SUCCESS | BLOCKED | PARTIAL_ROLLBACK | DRY_RUN. PARTIAL_ROLLBACK with blockedAtomResourceIds[] means some atoms are referenced downstream \u2014 retry idempotent; escalate if persistent. Capsules NOT created via the recipe engine return 422 RECIPE_ROLLBACK_JOB_NOT_FOUND ("nothing to roll back").`,params:{capsuleResourceId:{type:"string",description:"UUIDv4 of the capsule to roll back."},dryRun:{type:"boolean",description:"When true (recommended first), preview the would-delete list without actually deleting. Default false."}},required:["capsuleResourceId"],group:"capsule_recipes",readOnly:!1,searchHint:"rollback recipe undo delete scheduler atoms dry run preview",execute:async(t,e)=>{let r=e.dryRun??!1;return kz(t.client,e.capsuleResourceId,{dryRun:r})}},{name:"create_scheduled_journal",description:`Recurring journal. Use \`schedulerEntries\` (NOT journalEntries) \u2014 each needs accountResourceId, amount, type (DEBIT|CREDIT), name. Use \`repeat\` (NOT frequency/interval): ONE_TIME|DAILY|WEEKLY|MONTHLY|YEARLY. Debits must equal credits. Flat structure \u2014 reference, valueDate, saveAsDraft at top level.
796
+ Requires startDate. Auto-resolves accounts from CoA. Provide bankAccountName for recipes with cash-in/cash-out steps, contactName for recipes with invoice/bill steps.`,params:{recipe:{type:"string",enum:[...dm],description:"Recipe type"},amount:{type:"number"},principal:{type:"number"},startDate:{type:"string",description:"Start date YYYY-MM-DD (REQUIRED for execution)"},currency:{type:"string"},periods:{type:"number"},frequency:{type:"string",enum:["monthly","quarterly","annual"]},annualRate:{type:"number"},termMonths:{type:"number"},monthlyPayment:{type:"number"},usefulLifeMonths:{type:"number"},cost:{type:"number"},salvageValue:{type:"number"},usefulLifeYears:{type:"number"},method:{type:"string",enum:["sl","ddb","150db"]},acquisitionDate:{type:"string"},disposalDate:{type:"string"},proceeds:{type:"number"},bookRate:{type:"number",description:"Original booking rate. Declare which way it reads via rateDirection (REQUIRED for fx-reval)."},closingRate:{type:"number",description:"Period-end closing rate. Same direction as bookRate."},rateDirection:{type:"string",enum:["FUNCTIONAL_TO_SOURCE","SOURCE_TO_FUNCTIONAL"],description:"REQUIRED for fx-reval. FUNCTIONAL_TO_SOURCE = 1 base unit = N foreign, what list_currency_rates returns. SOURCE_TO_FUNCTIONAL = 1 foreign unit = N base, the everyday quote."},position:{type:"string",enum:["ASSET","LIABILITY"],description:"Balance-sheet side: ASSET (receivable/deposit, default) or LIABILITY (payable/provision). A rising base value is a gain on an asset and a loss on a liability."},baseCurrency:{type:"string"},buckets:{type:"array",items:{type:"object",properties:{name:{type:"string"},balance:{type:"number"},rate:{type:"number"}},required:["name","balance","rate"]}},existingProvision:{type:"number"},compounding:{type:"string",enum:["none","monthly","quarterly","annually"]},employees:{type:"number"},daysPerYear:{type:"number"},dailyRate:{type:"number"},declarationDate:{type:"string"},paymentDate:{type:"string"},withholdingRate:{type:"number"},bankAccountName:{type:"string",description:"Bank/cash account name (for cash-in/cash-out steps) \u2014 auto-resolved by fuzzy match"},contactName:{type:"string",description:"Contact name (for invoice/bill steps) \u2014 auto-resolved by fuzzy match"},existingTxnId:{type:"string",description:"Attach to existing transaction \u2014 skip initial step"},referencePrefix:{type:"string",description:"Reference prefix (generates prefix-1, prefix-2, ...)"},finalize:{type:"boolean",description:"Approve transactions immediately (default: drafts)"}},required:["recipe","startDate"],group:"recipes",readOnly:!1,searchHint:"execute transaction recipe capsule blueprint with dated steps. Posts depreciation, amortization, prepaid, deferred revenue, IFRS 16 lease, hire purchase, loan, fixed deposit, FX revaluation, ECL, IAS 37 provision, asset disposal, accrued expense, leave accrual, dividend entries.",maxResultSizeChars:1e5,execute:async(t,e)=>{let r=e.recipe,n=Mo(r,e),i=uB(n);if(!i)throw new Error("No blueprint generated. Ensure startDate is provided.");let o=MI(r,n),s=await _it(t.client,o.plan.requiredAccounts);if(s.failures.length>0){let u=s.failures.map(d=>`${d.name}${d.candidates.length>0?` (closest: ${d.candidates.join(", ")})`:""}`).join("; ");throw new Error(`Cannot auto-resolve ${s.failures.length} account(s): ${u}. Create them in Jaz first.`)}let a;e.contactName&&(a=(await Dit(t.client,e.contactName)).resourceId);let c;return e.bankAccountName&&(c=(await Sit(t.client,e.bankAccountName)).resourceId),lz(t.client,{blueprint:i,calcType:r,accountMap:s.mapping,bankAccountId:c,contactId:a,existingTxnId:e.existingTxnId,referencePrefix:e.referencePrefix,finalize:e.finalize})}},{name:"list_capsule_recipes",description:"Server-side recipe lifecycle (NOT the offline calculator \u2014 for offline planning use plan_recipe + execute_recipe). List all registered IFRS capsule recipes with per-version JSON Schemas. Source of truth for recipeName values used in capsuleRecipe payloads on trigger mutations (create_bill, create_journal, create_cash_in, etc.) \u2014 DON'T hard-code the 5 enum values. Each descriptor carries displayName, capsuleType, requiresBaseTransaction, allowedBaseTransactionTypes[], expectedAtomTypes[], and versions[] with inputSchema (JSON Schema Draft 7) per version.",params:{},required:[],group:"capsule_recipes",readOnly:!0,isConcurrencySafe:!0,searchHint:"list available IFRS capsule recipes amortization deferred revenue loan lease accrual",execute:async t=>Rz(t.client)},{name:"get_capsule_recipe",description:"Get one capsule recipe descriptor by enum name. inputSchema at `data.versions[0].inputSchema` (NOT top-level). Carries `allowedBaseTransactionTypes`, `x-accountClass` per *AccountResourceId slot, `x-baseTrxBinding` for auto-fills, and `versions[].templateSlots[]` \u2014 the slotKeys + supportedVariables you can pass to capsuleRecipe.templateOverrides (Customize Recipe). Use list_capsule_recipes for available names.",params:{name:{type:"string",description:"Recipe enum name (uppercase, see list_capsule_recipes for valid values)."}},required:["name"],group:"capsule_recipes",readOnly:!0,isConcurrencySafe:!0,searchHint:"recipe descriptor inputs required fields prepaid loan deferred lease accrual",execute:async(t,e)=>xz(t.client,e.name)},{name:"preview_capsule_recipe",description:"Compute the blueprint a recipe would build, WITHOUT persisting. Returns { legs[], expectedOutput[], previewMarkdown }. **Pre-flight gate** before sending capsuleRecipe payloads \u2014 trigger mutations silently null on publish failure but preview surfaces every problem as a clean 422 (ERR_RECIPE_ACCOUNT_CURRENCY_MISMATCH, RECIPE_INVALID_BASE_TRANSACTION_TYPE, ERR_RECIPE_OVERRIDE_* \u2014 Rule 143). Also the gate for templateOverrides: invalid slotKeys/variables come back as ERR_RECIPE_OVERRIDE_* here. The base-trx triplet (baseTransactionResourceId, baseTransactionType, organizationResourceId) is all-or-nothing \u2014 supply all three to auto-fill totalAmount/currency/anchor dates, OR omit all three for a pure compute preview.",params:{recipeName:{type:"string",description:"Recipe enum name. Source of truth: list_capsule_recipes."},recipeVersion:{type:"number",description:"Optional version pin (default: latest registered)."},inputs:{type:"object",description:"Recipe-specific inputs object. See descriptor.versions[].inputSchema (via get_capsule_recipe) for per-recipe shape. Must be non-null."},baseTransactionResourceId:{type:"string",description:"Optional base-trx UUIDv4. Triplet is all-or-nothing."},baseTransactionType:{type:"string",description:"Optional. Must be one of allowedBaseTransactionTypes for the recipe (SALE | PURCHASE | JOURNAL_MANUAL | JOURNAL_DIRECT_CASH_IN | JOURNAL_DIRECT_CASH_OUT | JOURNAL_CASHFLOW). Triplet is all-or-nothing."},organizationResourceId:{type:"string",description:"Optional org UUIDv4. Triplet is all-or-nothing."},templateOverrides:ist},required:["recipeName","inputs"],group:"capsule_recipes",readOnly:!0,isConcurrencySafe:!0,searchHint:"preview recipe blueprint amortization schedule without posting verify inputs",execute:async(t,e)=>{let r=e;return pa(r),Tz(t.client,r)}},{name:"resume_capsule_recipe",description:"Server-side recipe lifecycle. Resume a FAILED recipe job from the leg that failed. NOT idempotent \u2014 each call counts toward the 3-attempt limit. After 3 same-leg failures the job is terminally BLOCKED_AFTER_3_RESUME_ATTEMPTS and only rollback_capsule_recipe remains. Returns the updated CapsuleRecipeJob handle with status, resumeAttempts, terminalReason.",params:{capsuleResourceId:{type:"string",description:"UUIDv4 of the capsule whose recipe job is being resumed."}},required:["capsuleResourceId"],group:"capsule_recipes",readOnly:!1,searchHint:"retry failed recipe job leg resume after failure",execute:async(t,e)=>Bz(t.client,e.capsuleResourceId)},{name:"rollback_capsule_recipe",description:`Server-side recipe lifecycle. Delete every scheduler atom posted by this capsule's recipe. dryRun=true returns the would-delete list without deleting (idempotent, safe to call repeatedly). dryRun=false performs the delete. Status enum: SUCCESS | BLOCKED | PARTIAL_ROLLBACK | DRY_RUN. PARTIAL_ROLLBACK with blockedAtomResourceIds[] means some atoms are referenced downstream \u2014 retry idempotent; escalate if persistent. Capsules NOT created via the recipe engine return 422 RECIPE_ROLLBACK_JOB_NOT_FOUND ("nothing to roll back").`,params:{capsuleResourceId:{type:"string",description:"UUIDv4 of the capsule to roll back."},dryRun:{type:"boolean",description:"When true (recommended first), preview the would-delete list without actually deleting. Default false."}},required:["capsuleResourceId"],group:"capsule_recipes",readOnly:!1,searchHint:"rollback recipe undo delete scheduler atoms dry run preview",execute:async(t,e)=>{let r=e.dryRun??!1;return kz(t.client,e.capsuleResourceId,{dryRun:r})}},{name:"create_scheduled_journal",description:`Recurring journal. Use \`schedulerEntries\` (NOT journalEntries) \u2014 each needs accountResourceId, amount, type (DEBIT|CREDIT), description. Use \`repeat\` (NOT frequency/interval): ONE_TIME|DAILY|WEEKLY|MONTHLY|YEARLY. Debits must equal credits. Flat structure \u2014 reference, valueDate, saveAsDraft at top level.
797
797
 
798
- Dynamic strings (reference/name/notes): ${BB}.`,params:{reference:{type:"string",description:"Journal reference"},valueDate:{type:"string",description:"Template date (YYYY-MM-DD)"},startDate:{type:"string",description:"First occurrence (YYYY-MM-DD)"},endDate:{type:"string",description:"Last occurrence (YYYY-MM-DD, optional)"},repeat:{type:"string",enum:["ONE_TIME","DAILY","WEEKLY","MONTHLY","YEARLY"],description:"Recurrence interval (QUARTERLY is rejected with 422)"},schedulerEntries:{type:"array",items:{type:"object",properties:{accountResourceId:VI,amount:{type:"number"},type:{type:"string",enum:["DEBIT","CREDIT"]},name:{type:"string",description:"Line description"}},required:["accountResourceId","amount","type"]}},notes:{type:"string",description:"Journal notes"}},required:["startDate","repeat","valueDate","schedulerEntries"],group:"schedulers",readOnly:!1,searchHint:"create recurring scheduled journal entry",execute:async(t,e)=>dR(t.client,{status:"ACTIVE",startDate:e.startDate,endDate:e.endDate,repeat:e.repeat,valueDate:e.valueDate,schedulerEntries:e.schedulerEntries,reference:e.reference,internalNotes:e.notes})},{name:"create_scheduled_invoice",description:`Recurring invoice. Use for fixed-amount recurrence where you want per-period control over currency / tax / line items. DIFFERENT from subscriptions: no proration, but currency/tax/items can differ per occurrence.
798
+ Dynamic strings (reference): ${BB}.`,params:{reference:{type:"string",description:"Journal reference"},valueDate:{type:"string",description:"Template date (YYYY-MM-DD)"},startDate:{type:"string",description:"First occurrence (YYYY-MM-DD)"},endDate:{type:"string",description:"Last occurrence (YYYY-MM-DD, optional)"},repeat:{type:"string",enum:["ONE_TIME","DAILY","WEEKLY","MONTHLY","YEARLY"],description:"Recurrence interval (QUARTERLY is rejected with 422)"},schedulerEntries:{type:"array",items:{type:"object",properties:{accountResourceId:VI,amount:{type:"number"},type:{type:"string",enum:["DEBIT","CREDIT"]},description:{type:"string",description:"Line description"}},required:["accountResourceId","amount","type"]}}},required:["startDate","repeat","valueDate","schedulerEntries"],group:"schedulers",readOnly:!1,searchHint:"create recurring scheduled journal entry",execute:async(t,e)=>dR(t.client,{status:"ACTIVE",startDate:e.startDate,endDate:e.endDate,repeat:e.repeat,valueDate:e.valueDate,schedulerEntries:e.schedulerEntries,reference:e.reference})},{name:"create_scheduled_invoice",description:`Recurring invoice. Use for fixed-amount recurrence where you want per-period control over currency / tax / line items. DIFFERENT from subscriptions: no proration, but currency/tax/items can differ per occurrence.
799
799
 
800
800
  CRITICAL: saveAsDraft MUST be false (API rejects INVALID_SALE_STATUS). Use \`repeat\` (NOT frequency/interval): ONE_TIME | DAILY | WEEKLY | MONTHLY | YEARLY. Each lineItem needs name, unitPrice, quantity, accountResourceId.
801
801
 
@@ -855,7 +855,7 @@ Request patterns:
855
855
 
856
856
  Common line attrs: name, quantity, unit, unitPrice, discount, organizationAccountResourceId, taxProfileResourceId, classifierConfig. Purchase + withholdingTax. Journals/cash-entries use amount + description instead of unit/unitPrice. Full matrix in jaz-api Rule 107.
857
857
 
858
- Response: { updated, failed: [{resourceId, error, errorCode}] }. HTTP 207 = partial.`,params:{entity:{type:"string",enum:[...$I],description:"Transaction type"},lineItemResourceIds:{type:"array",items:{type:"string"},description:"Line item resourceIds to update (ARAP + accounting entities)"},attributes:{type:"object",description:"Fields to update on all specified line items"},schedulerUpdates:{type:"array",items:{type:"object"},description:"Per-scheduler updates: [{ schedulerResourceId, lineItemUpdates: [{ arrayIndex, ...fields }] }]. EXCEPTION: journal-schedules use lineItemResourceId (UUID) instead of arrayIndex."}},required:["entity"],group:"quick_fix",readOnly:!1,searchHint:"bulk update line item accounts tax profiles",execute:async(t,e)=>{let r=e.entity,n=["sale-schedules","purchase-schedules","subscription-schedules","journal-schedules"].includes(r),i={};if(n){if(!e.schedulerUpdates)throw new Error("schedulerUpdates is required for scheduler entities (sale-schedules, purchase-schedules, subscription-schedules, journal-schedules)");i.schedulerUpdates=e.schedulerUpdates}else{if(!e.lineItemResourceIds)throw new Error("lineItemResourceIds is required for non-scheduler entities");i.lineItemResourceIds=e.lineItemResourceIds,i.attributes=e.attributes??{}}return DB(t.client,r,i)}},pr("list_nano_classifiers","List nano classifiers (tracking categories). Paginated. Nano classifiers tag line items with structured categories.","nano_classifiers",(t,e,r)=>v8(t,{limit:r,offset:e}),"list nano classifiers tracking categories types"),xi("get_nano_classifier","Get a nano classifier by resourceId. Returns type and all classes.","nano_classifiers",(t,e)=>I8(t,e),"get nano classifier tracking category details"),Vt({name:"search_nano_classifiers",description:"Search nano classifiers (tracking categories).",group:"nano_classifiers",fields:tR,defaults:rR,fetcher:w8,searchHint:"find nano classifiers tracking categories cost centers departments by type name"}),{name:"create_nano_classifier",description:"Create a nano classifier (tracking category). Provide a type name and list of class names. printable defaults to true.",params:{type:{type:"string",description:'Classifier type name (e.g., "Department", "Project")'},classes:{type:"array",items:{type:"string"},description:'Class names: ["Sales", "Marketing", "Engineering"]'},printable:{type:"boolean",description:"Show on printed documents (default: true)."}},required:["type","classes"],group:"nano_classifiers",readOnly:!1,searchHint:"create new nano classifier tracking category",execute:async(t,e)=>SB(t.client,{type:e.type,classes:e.classes,printable:e.printable??!0})},{name:"update_nano_classifier",description:"Update a nano classifier \u2014 change type name, modify classes, or toggle printable.",params:{resourceId:{type:"string",description:"Nano classifier resourceId"},type:{type:"string",description:"New type name"},classes:{type:"array",items:{type:"object",properties:{className:{type:"string",description:"Class name"},resourceId:{type:"string",description:"Existing class resourceId (omit to add a new class)"},deleted:{type:"boolean",description:"true removes the class"}},required:["className"]},description:"Diff-style class updates: [{className, resourceId?, deleted?}]. Rename by passing resourceId + new className; add by omitting resourceId; remove with deleted: true. Plain strings are rejected by the API."},printable:{type:"boolean",description:"Show on printed documents"}},required:["resourceId","classes"],group:"nano_classifiers",readOnly:!1,searchHint:"update nano classifier classes and settings",execute:async(t,e)=>{let r={};return e.type&&(r.type=e.type),e.classes&&(r.classes=e.classes),e.printable!==void 0&&(r.printable=e.printable),RB(t.client,e.resourceId,r)}},Vr("delete_nano_classifier","Delete a nano classifier.","nano_classifiers",(t,e)=>_8(t,e),"permanently delete a nano classifier type"),{name:"list_invoice_payments",description:"List all payments recorded against an invoice. Returns payment records with amounts, dates, and methods.",params:{resourceId:{type:"string",description:"Invoice resourceId"}},required:["resourceId"],group:"payments",readOnly:!0,searchHint:"list payment records on an invoice",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(t,e)=>ZP(t.client,e.resourceId)},{name:"list_invoice_credits",description:"List all credit notes applied to an invoice.",params:{resourceId:{type:"string",description:"Invoice resourceId"}},required:["resourceId"],group:"payments",readOnly:!0,searchHint:"list credit applications on an invoice",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(t,e)=>XP(t.client,e.resourceId)},{name:"reverse_invoice_credit",description:"Reverse (unapply) a credit note from an invoice. The credit note becomes UNAPPLIED again.",params:{resourceId:{type:"string",description:"Invoice resourceId"},creditResourceId:{type:"string",description:"Credit application resourceId to reverse"}},required:["resourceId","creditResourceId"],group:"payments",readOnly:!1,searchHint:"reverse a credit note application on invoice",isDestructive:!0,execute:async(t,e)=>(await KP(t.client,e.resourceId,e.creditResourceId),{reversed:!0,invoiceId:e.resourceId,creditId:e.creditResourceId})},{name:"list_bill_payments",description:"List all payments recorded against a bill. Returns payment records with amounts, dates, and methods.",params:{resourceId:{type:"string",description:"Bill resourceId"}},required:["resourceId"],group:"payments",readOnly:!0,searchHint:"list payment records on a bill",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(t,e)=>gF(t.client,e.resourceId)},{name:"list_bill_credits",description:"List all credit notes applied to a bill.",params:{resourceId:{type:"string",description:"Bill resourceId"}},required:["resourceId"],group:"payments",readOnly:!0,searchHint:"list credit applications on a bill",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(t,e)=>yF(t.client,e.resourceId)},{name:"reverse_bill_credit",description:"Reverse (unapply) a supplier credit note from a bill. The credit note becomes UNAPPLIED again.",params:{resourceId:{type:"string",description:"Bill resourceId"},creditResourceId:{type:"string",description:"Credit application resourceId to reverse"}},required:["resourceId","creditResourceId"],group:"payments",readOnly:!1,searchHint:"reverse a credit note application on bill",isDestructive:!0,execute:async(t,e)=>(await EF(t.client,e.resourceId,e.creditResourceId),{reversed:!0,billId:e.resourceId,creditId:e.creditResourceId})},xi("get_scheduled_invoice","Get a scheduled (recurring) invoice by resourceId.","schedulers",(t,e)=>JH(t,e),"get scheduled recurring invoice details"),{name:"update_scheduled_invoice",description:"Update a scheduled invoice \u2014 change schedule settings and/or the invoice template.",params:{resourceId:{type:"string",description:"Scheduled invoice resourceId"},repeat:{type:"string",enum:["ONE_TIME","DAILY","WEEKLY","MONTHLY","YEARLY"],description:"Recurrence interval (QUARTERLY is rejected with 422)"},startDate:{type:"string",description:"First occurrence date (YYYY-MM-DD)"},endDate:{type:"string",description:"Last occurrence date (YYYY-MM-DD)"},status:{type:"string",enum:["ACTIVE","INACTIVE"],description:"Status: ACTIVE or INACTIVE (PAUSED is rejected with 422)"},invoice:{type:"object",description:"Invoice template: { reference, valueDate, dueDate, contactResourceId, lineItems, currency, tag, saveAsDraft }"}},required:["resourceId"],group:"schedulers",readOnly:!1,searchHint:"update recurring scheduled invoice settings",execute:async(t,e)=>{let r={};return e.repeat&&(r.repeat=e.repeat),e.startDate&&(r.startDate=e.startDate),e.endDate&&(r.endDate=e.endDate),e.status&&(r.status=e.status),e.invoice&&(r.invoice=e.invoice),VH(t.client,e.resourceId,r)}},Vr("delete_scheduled_invoice","Delete a scheduled (recurring) invoice.","schedulers",(t,e)=>WH(t,e),"delete a recurring scheduled invoice"),xi("get_scheduled_bill","Get a scheduled (recurring) bill by resourceId.","schedulers",(t,e)=>ZH(t,e),"get scheduled recurring bill details"),{name:"update_scheduled_bill",description:"Update a scheduled bill \u2014 change schedule settings and/or the bill template.",params:{resourceId:{type:"string",description:"Scheduled bill resourceId"},repeat:{type:"string",enum:["ONE_TIME","DAILY","WEEKLY","MONTHLY","YEARLY"],description:"Recurrence interval (QUARTERLY is rejected with 422)"},startDate:{type:"string",description:"First occurrence date (YYYY-MM-DD)"},endDate:{type:"string",description:"Last occurrence date (YYYY-MM-DD)"},status:{type:"string",enum:["ACTIVE","INACTIVE"],description:"Status: ACTIVE or INACTIVE (PAUSED is rejected with 422)"},bill:{type:"object",description:"Bill template: { reference, valueDate, dueDate, contactResourceId, lineItems, currency, tag, saveAsDraft }"}},required:["resourceId"],group:"schedulers",readOnly:!1,searchHint:"update recurring scheduled bill settings",execute:async(t,e)=>{let r={};return e.repeat&&(r.repeat=e.repeat),e.startDate&&(r.startDate=e.startDate),e.endDate&&(r.endDate=e.endDate),e.status&&(r.status=e.status),e.bill&&(r.bill=e.bill),XH(t.client,e.resourceId,r)}},Vr("delete_scheduled_bill","Delete a scheduled (recurring) bill.","schedulers",(t,e)=>KH(t,e),"delete a recurring scheduled bill"),xi("get_scheduled_journal","Get a scheduled (recurring) journal by resourceId.","schedulers",(t,e)=>ez(t,e),"get scheduled recurring journal details"),{name:"update_scheduled_journal",description:"Update a scheduled journal \u2014 change schedule settings and/or the journal template.",params:{resourceId:{type:"string",description:"Scheduled journal resourceId"},repeat:{type:"string",enum:["ONE_TIME","DAILY","WEEKLY","MONTHLY","YEARLY"],description:"Recurrence interval (QUARTERLY is rejected with 422)"},startDate:{type:"string",description:"First occurrence date (YYYY-MM-DD)"},endDate:{type:"string",description:"Last occurrence date (YYYY-MM-DD)"},status:{type:"string",enum:["ACTIVE","INACTIVE"],description:"Status: ACTIVE or INACTIVE (PAUSED is rejected with 422)"},valueDate:{type:"string",description:"Journal date (YYYY-MM-DD)"},schedulerEntries:{type:"array",items:{type:"object"},description:"Journal entries: [{ accountResourceId, type: CREDIT|DEBIT, amount, ... }]"},reference:{type:"string",description:"Journal reference"},notes:{type:"string",description:"Journal notes"}},required:["resourceId"],group:"schedulers",readOnly:!1,searchHint:"update recurring scheduled journal settings",execute:async(t,e)=>{let r={};return e.repeat&&(r.repeat=e.repeat),e.startDate&&(r.startDate=e.startDate),e.endDate&&(r.endDate=e.endDate),e.status&&(r.status=e.status),e.valueDate&&(r.valueDate=e.valueDate),e.schedulerEntries&&(r.schedulerEntries=e.schedulerEntries),e.reference&&(r.reference=e.reference),e.notes&&(r.notes=e.notes),tz(t.client,e.resourceId,r)}},Vr("delete_scheduled_journal","Delete a scheduled (recurring) journal.","schedulers",(t,e)=>rz(t,e),"delete a recurring scheduled journal"),xi("get_payment","Get a payment record. Takes a PAYMENT resourceId; the ledger resourceId list_payments/search_payments return is a different entity and 404s here.","payments",(t,e)=>Iz(t,e),"get payment record details by id",{paramDescription:"Payment resourceId (from invoice/bill paymentRecords)"}),{name:"update_payment",description:"Update a payment record \u2014 correct amount, reference, date, method, or account.",params:{resourceId:{type:"string",description:"Payment resourceId (from invoice/bill paymentRecords)"},paymentAmount:{type:"number",description:"Corrected payment amount (bank currency)"},reference:{type:"string",description:"Payment reference"},valueDate:{type:"string",description:"Payment date (YYYY-MM-DD)"},paymentMethod:Fy,accountResourceId:FB,transactionFee:{type:"object",description:"Transaction fee. The API requires the full fee object \u2014 a bare number is rejected.",properties:{feeAccountResourceId:{type:"string",description:"Fee expense account resourceId"},feeType:{type:"string",enum:["FLAT","PERCENTAGE"],description:"How feeValue is interpreted"},feeValue:{type:"number",description:"Fee amount (FLAT) or percentage (PERCENTAGE)"},feeTaxVatApplicable:{type:"boolean",description:"Whether VAT applies to the fee"},feeDescription:{type:"string",description:"Optional fee description"},taxVatProfileResourceId:{type:"string",description:"Optional tax profile for the fee"}},required:["feeAccountResourceId","feeType","feeValue","feeTaxVatApplicable"]},adjustment:fwr},required:["resourceId"],group:"payments",readOnly:!1,searchHint:"update payment amount reference date method",execute:async(t,e)=>{let r={};return e.paymentAmount!==void 0&&(r.paymentAmount=e.paymentAmount),e.reference&&(r.reference=e.reference),e.valueDate&&(r.valueDate=e.valueDate),e.paymentMethod&&(r.paymentMethod=e.paymentMethod),e.accountResourceId&&(r.accountResourceId=e.accountResourceId),e.transactionFee!==void 0&&(r.transactionFee=e.transactionFee),e.adjustment!==void 0&&(r.adjustment=e.adjustment),wz(t.client,e.resourceId,r)}},Vr("delete_payment","Delete (void) a payment record. The associated invoice/bill balance is restored.","payments",(t,e)=>_z(t,e),"delete void a payment record restore balance"),{name:"get_export_columns",description:"List all exportable columns for an entity type, including their paths and data types. Use paths from this response to build custom column sets for export_records or preview_export_records.",params:{entityType:yfe},required:["entityType"],group:"export_records",readOnly:!0,isConcurrencySafe:!0,searchHint:"list export columns fields for entity type",execute:async(t,e)=>R8(t.client,e.entityType)},{name:"preview_export_records",description:"Preview an export before generating the file. Returns totalRecords, up to 10 sample rows, resolved column definitions, and a human-readable filterDescription. Use this to confirm scope before calling export_records. Pass either query OR filter, never both.",params:{entityType:yfe,query:Uot,filter:$ot,columns:qot,sort:jot},required:["entityType"],group:"export_records",readOnly:!0,isConcurrencySafe:!0,searchHint:"preview export records count sample rows filter",execute:async(t,e)=>S8(t.client,{entityType:e.entityType,outputFormat:"XLSX",query:e.query,filter:e.filter,columns:e.columns,sort:e.sort})},{name:"export_records",description:`Raw entity-row XLSX export for one entity type (invoices/bills/contacts/items/journals/bank records/cashflow/fixed assets \u2014 one row per record, with column selection). Returns pre-signed download URL (~5 min), fileName, totalCount. Pass query OR filter, never both. Use preview_export_records first to confirm scope.
858
+ Response: { updated, failed: [{resourceId, error, errorCode}] }. HTTP 207 = partial.`,params:{entity:{type:"string",enum:[...$I],description:"Transaction type"},lineItemResourceIds:{type:"array",items:{type:"string"},description:"Line item resourceIds to update (ARAP + accounting entities)"},attributes:{type:"object",description:"Fields to update on all specified line items"},schedulerUpdates:{type:"array",items:{type:"object"},description:"Per-scheduler updates: [{ schedulerResourceId, lineItemUpdates: [{ arrayIndex, ...fields }] }]. EXCEPTION: journal-schedules use lineItemResourceId (UUID) instead of arrayIndex."}},required:["entity"],group:"quick_fix",readOnly:!1,searchHint:"bulk update line item accounts tax profiles",execute:async(t,e)=>{let r=e.entity,n=["sale-schedules","purchase-schedules","subscription-schedules","journal-schedules"].includes(r),i={};if(n){if(!e.schedulerUpdates)throw new Error("schedulerUpdates is required for scheduler entities (sale-schedules, purchase-schedules, subscription-schedules, journal-schedules)");i.schedulerUpdates=e.schedulerUpdates}else{if(!e.lineItemResourceIds)throw new Error("lineItemResourceIds is required for non-scheduler entities");i.lineItemResourceIds=e.lineItemResourceIds,i.attributes=e.attributes??{}}return DB(t.client,r,i)}},pr("list_nano_classifiers","List nano classifiers (tracking categories). Paginated. Nano classifiers tag line items with structured categories.","nano_classifiers",(t,e,r)=>v8(t,{limit:r,offset:e}),"list nano classifiers tracking categories types"),xi("get_nano_classifier","Get a nano classifier by resourceId. Returns type and all classes.","nano_classifiers",(t,e)=>I8(t,e),"get nano classifier tracking category details"),Vt({name:"search_nano_classifiers",description:"Search nano classifiers (tracking categories).",group:"nano_classifiers",fields:tR,defaults:rR,fetcher:w8,searchHint:"find nano classifiers tracking categories cost centers departments by type name"}),{name:"create_nano_classifier",description:"Create a nano classifier (tracking category). Provide a type name and list of class names. printable defaults to true.",params:{type:{type:"string",description:'Classifier type name (e.g., "Department", "Project")'},classes:{type:"array",items:{type:"string"},description:'Class names: ["Sales", "Marketing", "Engineering"]'},printable:{type:"boolean",description:"Show on printed documents (default: true)."}},required:["type","classes"],group:"nano_classifiers",readOnly:!1,searchHint:"create new nano classifier tracking category",execute:async(t,e)=>SB(t.client,{type:e.type,classes:e.classes,printable:e.printable??!0})},{name:"update_nano_classifier",description:"Update a nano classifier \u2014 change type name, modify classes, or toggle printable.",params:{resourceId:{type:"string",description:"Nano classifier resourceId"},type:{type:"string",description:"New type name"},classes:{type:"array",items:{type:"object",properties:{className:{type:"string",description:"Class name"},resourceId:{type:"string",description:"Existing class resourceId (omit to add a new class)"},deleted:{type:"boolean",description:"true removes the class"}},required:["className"]},description:"Diff-style class updates: [{className, resourceId?, deleted?}]. Rename by passing resourceId + new className; add by omitting resourceId; remove with deleted: true. Plain strings are rejected by the API."},printable:{type:"boolean",description:"Show on printed documents"}},required:["resourceId","classes"],group:"nano_classifiers",readOnly:!1,searchHint:"update nano classifier classes and settings",execute:async(t,e)=>{let r={};return e.type&&(r.type=e.type),e.classes&&(r.classes=e.classes),e.printable!==void 0&&(r.printable=e.printable),RB(t.client,e.resourceId,r)}},Vr("delete_nano_classifier","Delete a nano classifier.","nano_classifiers",(t,e)=>_8(t,e),"permanently delete a nano classifier type"),{name:"list_invoice_payments",description:"List all payments recorded against an invoice. Returns payment records with amounts, dates, and methods.",params:{resourceId:{type:"string",description:"Invoice resourceId"}},required:["resourceId"],group:"payments",readOnly:!0,searchHint:"list payment records on an invoice",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(t,e)=>ZP(t.client,e.resourceId)},{name:"list_invoice_credits",description:"List all credit notes applied to an invoice.",params:{resourceId:{type:"string",description:"Invoice resourceId"}},required:["resourceId"],group:"payments",readOnly:!0,searchHint:"list credit applications on an invoice",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(t,e)=>XP(t.client,e.resourceId)},{name:"reverse_invoice_credit",description:"Reverse (unapply) a credit note from an invoice. The credit note becomes UNAPPLIED again.",params:{resourceId:{type:"string",description:"Invoice resourceId"},creditResourceId:{type:"string",description:"Credit application resourceId to reverse"}},required:["resourceId","creditResourceId"],group:"payments",readOnly:!1,searchHint:"reverse a credit note application on invoice",isDestructive:!0,execute:async(t,e)=>(await KP(t.client,e.resourceId,e.creditResourceId),{reversed:!0,invoiceId:e.resourceId,creditId:e.creditResourceId})},{name:"list_bill_payments",description:"List all payments recorded against a bill. Returns payment records with amounts, dates, and methods.",params:{resourceId:{type:"string",description:"Bill resourceId"}},required:["resourceId"],group:"payments",readOnly:!0,searchHint:"list payment records on a bill",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(t,e)=>gF(t.client,e.resourceId)},{name:"list_bill_credits",description:"List all credit notes applied to a bill.",params:{resourceId:{type:"string",description:"Bill resourceId"}},required:["resourceId"],group:"payments",readOnly:!0,searchHint:"list credit applications on a bill",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(t,e)=>yF(t.client,e.resourceId)},{name:"reverse_bill_credit",description:"Reverse (unapply) a supplier credit note from a bill. The credit note becomes UNAPPLIED again.",params:{resourceId:{type:"string",description:"Bill resourceId"},creditResourceId:{type:"string",description:"Credit application resourceId to reverse"}},required:["resourceId","creditResourceId"],group:"payments",readOnly:!1,searchHint:"reverse a credit note application on bill",isDestructive:!0,execute:async(t,e)=>(await EF(t.client,e.resourceId,e.creditResourceId),{reversed:!0,billId:e.resourceId,creditId:e.creditResourceId})},xi("get_scheduled_invoice","Get a scheduled (recurring) invoice by resourceId.","schedulers",(t,e)=>JH(t,e),"get scheduled recurring invoice details"),{name:"update_scheduled_invoice",description:"Update a scheduled invoice \u2014 change schedule settings and/or the invoice template.",params:{resourceId:{type:"string",description:"Scheduled invoice resourceId"},repeat:{type:"string",enum:["ONE_TIME","DAILY","WEEKLY","MONTHLY","YEARLY"],description:"Recurrence interval (QUARTERLY is rejected with 422)"},startDate:{type:"string",description:"First occurrence date (YYYY-MM-DD)"},endDate:{type:"string",description:"Last occurrence date (YYYY-MM-DD)"},status:{type:"string",enum:["ACTIVE","INACTIVE"],description:"Status: ACTIVE or INACTIVE (PAUSED is rejected with 422)"},invoice:{type:"object",description:"Invoice template: { reference, valueDate, dueDate, contactResourceId, lineItems, currency, tag, saveAsDraft }"}},required:["resourceId"],group:"schedulers",readOnly:!1,searchHint:"update recurring scheduled invoice settings",execute:async(t,e)=>{let r={};return e.repeat&&(r.repeat=e.repeat),e.startDate&&(r.startDate=e.startDate),e.endDate&&(r.endDate=e.endDate),e.status&&(r.status=e.status),e.invoice&&(r.invoice=e.invoice),VH(t.client,e.resourceId,r)}},Vr("delete_scheduled_invoice","Delete a scheduled (recurring) invoice.","schedulers",(t,e)=>WH(t,e),"delete a recurring scheduled invoice"),xi("get_scheduled_bill","Get a scheduled (recurring) bill by resourceId.","schedulers",(t,e)=>ZH(t,e),"get scheduled recurring bill details"),{name:"update_scheduled_bill",description:"Update a scheduled bill \u2014 change schedule settings and/or the bill template.",params:{resourceId:{type:"string",description:"Scheduled bill resourceId"},repeat:{type:"string",enum:["ONE_TIME","DAILY","WEEKLY","MONTHLY","YEARLY"],description:"Recurrence interval (QUARTERLY is rejected with 422)"},startDate:{type:"string",description:"First occurrence date (YYYY-MM-DD)"},endDate:{type:"string",description:"Last occurrence date (YYYY-MM-DD)"},status:{type:"string",enum:["ACTIVE","INACTIVE"],description:"Status: ACTIVE or INACTIVE (PAUSED is rejected with 422)"},bill:{type:"object",description:"Bill template: { reference, valueDate, dueDate, contactResourceId, lineItems, currency, tag, saveAsDraft }"}},required:["resourceId"],group:"schedulers",readOnly:!1,searchHint:"update recurring scheduled bill settings",execute:async(t,e)=>{let r={};return e.repeat&&(r.repeat=e.repeat),e.startDate&&(r.startDate=e.startDate),e.endDate&&(r.endDate=e.endDate),e.status&&(r.status=e.status),e.bill&&(r.bill=e.bill),XH(t.client,e.resourceId,r)}},Vr("delete_scheduled_bill","Delete a scheduled (recurring) bill.","schedulers",(t,e)=>KH(t,e),"delete a recurring scheduled bill"),xi("get_scheduled_journal","Get a scheduled (recurring) journal by resourceId.","schedulers",(t,e)=>ez(t,e),"get scheduled recurring journal details"),{name:"update_scheduled_journal",description:"Update a scheduled journal \u2014 change schedule settings and/or the journal template.",params:{resourceId:{type:"string",description:"Scheduled journal resourceId"},repeat:{type:"string",enum:["ONE_TIME","DAILY","WEEKLY","MONTHLY","YEARLY"],description:"Recurrence interval (QUARTERLY is rejected with 422)"},startDate:{type:"string",description:"First occurrence date (YYYY-MM-DD)"},endDate:{type:"string",description:"Last occurrence date (YYYY-MM-DD)"},status:{type:"string",enum:["ACTIVE","INACTIVE"],description:"Status: ACTIVE or INACTIVE (PAUSED is rejected with 422)"},valueDate:{type:"string",description:"Journal date (YYYY-MM-DD)"},schedulerEntries:{type:"array",items:{type:"object"},description:"Journal entries: [{ accountResourceId, type: CREDIT|DEBIT, amount, ... }]"},reference:{type:"string",description:"Journal reference"}},required:["resourceId"],group:"schedulers",readOnly:!1,searchHint:"update recurring scheduled journal settings",execute:async(t,e)=>{let r={};return e.repeat&&(r.repeat=e.repeat),e.startDate&&(r.startDate=e.startDate),e.endDate&&(r.endDate=e.endDate),e.status&&(r.status=e.status),e.valueDate&&(r.valueDate=e.valueDate),e.schedulerEntries&&(r.schedulerEntries=e.schedulerEntries),e.reference&&(r.reference=e.reference),tz(t.client,e.resourceId,r)}},Vr("delete_scheduled_journal","Delete a scheduled (recurring) journal.","schedulers",(t,e)=>rz(t,e),"delete a recurring scheduled journal"),xi("get_payment","Get a payment record. Takes a PAYMENT resourceId; the ledger resourceId list_payments/search_payments return is a different entity and 404s here.","payments",(t,e)=>Iz(t,e),"get payment record details by id",{paramDescription:"Payment resourceId (from invoice/bill paymentRecords)"}),{name:"update_payment",description:"Update a payment record \u2014 correct amount, reference, date, method, or account.",params:{resourceId:{type:"string",description:"Payment resourceId (from invoice/bill paymentRecords)"},paymentAmount:{type:"number",description:"Corrected payment amount (bank currency)"},reference:{type:"string",description:"Payment reference"},valueDate:{type:"string",description:"Payment date (YYYY-MM-DD)"},paymentMethod:Fy,accountResourceId:FB,transactionFee:{type:"object",description:"Transaction fee. The API requires the full fee object \u2014 a bare number is rejected.",properties:{feeAccountResourceId:{type:"string",description:"Fee expense account resourceId"},feeType:{type:"string",enum:["FLAT","PERCENTAGE"],description:"How feeValue is interpreted"},feeValue:{type:"number",description:"Fee amount (FLAT) or percentage (PERCENTAGE)"},feeTaxVatApplicable:{type:"boolean",description:"Whether VAT applies to the fee"},feeDescription:{type:"string",description:"Optional fee description"},taxVatProfileResourceId:{type:"string",description:"Optional tax profile for the fee"}},required:["feeAccountResourceId","feeType","feeValue","feeTaxVatApplicable"]},adjustment:fwr},required:["resourceId"],group:"payments",readOnly:!1,searchHint:"update payment amount reference date method",execute:async(t,e)=>{let r={};return e.paymentAmount!==void 0&&(r.paymentAmount=e.paymentAmount),e.reference&&(r.reference=e.reference),e.valueDate&&(r.valueDate=e.valueDate),e.paymentMethod&&(r.paymentMethod=e.paymentMethod),e.accountResourceId&&(r.accountResourceId=e.accountResourceId),e.transactionFee!==void 0&&(r.transactionFee=e.transactionFee),e.adjustment!==void 0&&(r.adjustment=e.adjustment),wz(t.client,e.resourceId,r)}},Vr("delete_payment","Delete (void) a payment record. The associated invoice/bill balance is restored.","payments",(t,e)=>_z(t,e),"delete void a payment record restore balance"),{name:"get_export_columns",description:"List all exportable columns for an entity type, including their paths and data types. Use paths from this response to build custom column sets for export_records or preview_export_records.",params:{entityType:yfe},required:["entityType"],group:"export_records",readOnly:!0,isConcurrencySafe:!0,searchHint:"list export columns fields for entity type",execute:async(t,e)=>R8(t.client,e.entityType)},{name:"preview_export_records",description:"Preview an export before generating the file. Returns totalRecords, up to 10 sample rows, resolved column definitions, and a human-readable filterDescription. Use this to confirm scope before calling export_records. Pass either query OR filter, never both.",params:{entityType:yfe,query:Uot,filter:$ot,columns:qot,sort:jot},required:["entityType"],group:"export_records",readOnly:!0,isConcurrencySafe:!0,searchHint:"preview export records count sample rows filter",execute:async(t,e)=>S8(t.client,{entityType:e.entityType,outputFormat:"XLSX",query:e.query,filter:e.filter,columns:e.columns,sort:e.sort})},{name:"export_records",description:`Raw entity-row XLSX export for one entity type (invoices/bills/contacts/items/journals/bank records/cashflow/fixed assets \u2014 one row per record, with column selection). Returns pre-signed download URL (~5 min), fileName, totalCount. Pass query OR filter, never both. Use preview_export_records first to confirm scope.
859
859
 
860
860
  DO NOT use this for analytical / audit reports, financial statements, aging, summary reports, or statement-of-account \u2014 those go through download_export.`,params:{entityType:yfe,query:Uot,filter:$ot,columns:qot,sort:jot},required:["entityType"],group:"export_records",readOnly:!0,isConcurrencySafe:!0,searchHint:"export records download xlsx file url",execute:async(t,e)=>D8(t.client,{entityType:e.entityType,outputFormat:"XLSX",query:e.query,filter:e.filter,columns:e.columns,sort:e.sort})},Vt({name:"search_background_jobs",description:"Search and poll background jobs. ANY operation that returns a jobId (bulk_upsert_contacts, bulk_upsert_items, bank statement import, magic file processing, etc.) can be tracked here. Filter by resourceId (the jobId value) to poll a specific job. Poll until status is SUCCESS, FAILED, or PARTIAL_SUCCESS. Use processedCount/failedCount/totalRecords for progress. IMPORTANT: filter by resourceId field, NOT jobId \u2014 they differ.",group:"background_jobs",fields:bS,defaults:CS,fetcher:xB,searchHint:"poll background job status by jobId type status"}),{name:"bulk_upsert_contacts",description:`Bulk create/update contacts (max 500). resourceId per row \u2192 update (partial; omitted fields preserve existing). Omit resourceId \u2192 create. ${Vl} Per-row failures in errorDetails (NOT failedRows \u2014 that's the sync pattern). On PARTIAL_SUCCESS: succeeded rows are committed; re-submit only failed rowIndex entries.
861
861
 
@@ -869,7 +869,7 @@ ASYNC: returns jobId \u2192 poll search_background_jobs(filter:{resourceId:{eq:j
869
869
 
870
870
  Required per row: reference, registrationType. NEW also needs purchaseBusinessTransactionType + purchaseBusinessTransactionResourceId (the purchase LINE ITEM, not the bill/journal id); TRANSFER takes accumulatedDepreciationAtTransferDate + bookValueAtTransferDate. Recommended: typeCode, typeName, category, purchaseAmount, purchaseDate, effectiveLife, depreciationMethod + the three account UUIDv4s.
871
871
 
872
- ASYNC: returns jobId \u2192 poll search_background_jobs(filter:{resourceId:{eq:jobId}}); on PARTIAL_SUCCESS read data[0].errorDetails.`,params:{fixedAssets:{type:"array",description:"Fixed assets to create/update (max 500).",items:{type:"object",properties:{rowIndex:{type:"string"},reference:{type:"string",description:"Natural key \u2014 required"},registrationType:{type:"string",enum:["NEW","TRANSFER"],description:"NEW = newly acquired, TRANSFER = inherited \u2014 required"},typeCode:{type:"string",description:"Asset class code (e.g. FURNITURE_AND_FIXTURE)"},typeName:{type:"string",description:"Human label for typeCode"},category:{type:"string",enum:["TANGIBLE","INTANGIBLE"],description:"TANGIBLE | INTANGIBLE"},name:{type:"string",description:"Asset name"},purchaseAmount:{type:"number",description:"Acquisition cost."},purchaseDate:{type:"number",description:"Acquisition date, epoch ms (NOT YYYY-MM-DD on this endpoint)."},depreciationStartDate:{type:"number",description:"Epoch ms. Omit to default to purchaseDate."},effectiveLife:{type:"number",description:"Useful life months."},depreciationMethod:{type:"string",enum:["STRAIGHT_LINE","NO_DEPRECIATION"],description:"Bulk accepts only STRAIGHT_LINE or NO_DEPRECIATION (422 otherwise) \u2014 use create_fixed_asset for declining-balance methods."},purchaseAssetAccountResourceId:{type:"string",description:"Asset (PPE) account UUIDv4."},depreciationExpenseAccountResourceId:{type:"string",description:"Depreciation expense account UUIDv4."},accumulatedDepreciationAccountResourceId:{type:"string",description:"Accumulated depreciation account UUIDv4."},purchaseBusinessTransactionType:{type:"string",enum:["PURCHASE","SALE","JOURNAL_MANUAL"],description:"Required for NEW."},purchaseBusinessTransactionResourceId:{type:"string",description:"Purchase LINE ITEM id, unlinked. Required for NEW."},accumulatedDepreciationAtTransferDate:{type:"number",description:"TRANSFER only."},bookValueAtTransferDate:{type:"number",description:"TRANSFER only."},internalNotes:{type:"string"}}}}},required:["fixedAssets"],group:"fixed_assets",readOnly:!1,searchHint:"bulk fixed assets ppe register upsert import migrate",execute:async(t,e)=>{Dn(e.fixedAssets,"fixedAssets",500,"fixed assets");let r=e.fixedAssets;return v0e(r,["purchaseDate","depreciationStartDate"]),e8(t.client,r)}},{name:"quick_reconcile",description:`Bulk-reconcile bank statement entries against a list of journals (max 500). Reconciliation mode is hardcoded to QUICK_RECON. ${Vl} Caller provides bankAccountResourceId + journalsForReconciliation[] (each row: bankStatementEntryResourceId, journalReference, journalAccountResourceId).`,params:{bankAccountResourceId:{type:"string",description:"Bank account UUID (the entries belong to this account)"},journalsForReconciliation:{type:"array",description:"Per-row reconciliation instructions (max 500).",items:{type:"object",properties:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},journalReference:{type:"string",description:"Journal reference text \u2014 required"},journalAccountResourceId:{type:"string",description:"Offsetting account UUID (revenue for cash-in, expense for cash-out) \u2014 required"},contactResourceId:{type:"string",description:"Contact UUID"},capsuleResourceId:{type:"string",description:"Capsule UUID"},taxProfileResourceId:{type:"string",description:"Tax profile UUID"},internalNotes:{type:"string"},journalEntryDescription:{type:"string"},tags:{type:"array",items:{type:"string"}},rowIndex:{type:"string",description:"Optional caller-supplied index for error correlation"}}}}},required:["bankAccountResourceId","journalsForReconciliation"],group:"reconciliations",readOnly:!1,searchHint:"bulk reconcile bank statement journals match",execute:async(t,e)=>(Dn(e.journalsForReconciliation,"journalsForReconciliation",500,"journals"),N8(t.client,e))},{name:"apply_bank_rule",description:"Apply a pre-configured bank rule (action shortcut) to a batch of bank statement entries (max 500). Async \u2014 returns a jobId. Poll search_background_jobs filtered by resourceId. The rule executes its configured action (e.g. RECONCILE_WITH_DIRECT_CASH_ENTRY) on each entry.",params:{actionShortcutResourceId:{type:"string",description:"Bank rule UUID \u2014 required"},businessTransactionResourceIds:{type:"array",description:"Bank statement entry UUIDs to apply the rule to (max 500). Note: the field is named businessTransactionResourceIds for legacy reasons but accepts bank entry IDs.",items:{type:"string"}}},required:["actionShortcutResourceId","businessTransactionResourceIds"],group:"reconciliations",readOnly:!1,searchHint:"bank rule apply action shortcut bulk reconcile",execute:async(t,e)=>(Dn(e.businessTransactionResourceIds,"businessTransactionResourceIds",500,"entries"),O8(t.client,e))},{name:"reconcile_direct_cash_entry",description:"Reconcile a bank statement entry with a single cash-in / cash-out line. Direction (cash-in vs cash-out) is INFERRED from the bank entry sign. Sync \u2014 returns the reconciled entry status. NOT idempotent: calling twice on the same bankStatementEntryResourceId creates duplicate journals. Confirm reconciled-state via view_auto_reconciliation before retrying.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID (used to look up the entry) \u2014 required"},reference:{type:"string",description:"Reference for the cash entry \u2014 required"},accountResourceId:{type:"string",description:"Offsetting account UUID (revenue for cash-in, expense for cash-out) \u2014 required"},amount:{type:"number",description:"Amount in source currency. Defaults to bank entry amount if omitted."},description:{type:"string"},contactResourceId:{type:"string"},taxProfileResourceId:{type:"string"},internalNotes:{type:"string"},bankAccountJournalEntryDescription:{type:"string",description:"Description for the bank-side journal entry"},tags:{type:"array",items:{type:"string"}},taxVatApplicable:{type:"boolean"},taxInclusion:{type:"boolean"},capsuleResourceId:{type:"string"}},required:["bankStatementEntryResourceId","bankAccountResourceId","reference","accountResourceId"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry direct cash in out single line",execute:async(t,e)=>F8(t.client,e)},{name:"reconcile_cash_journal",description:"Reconcile a bank statement entry with a multi-line cashflow journal (multiple cash splits, max 200 lines). Sync \u2014 returns the reconciled entry status. NOT idempotent \u2014 confirm reconciled-state before retrying.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID \u2014 required"},reference:{type:"string",description:"Journal reference \u2014 required"},journalEntries:{type:"array",description:"Cash journal lines (max 200). Each row is one debit OR credit against an account.",items:{type:"object",properties:{accountResourceId:{type:"string",description:"Account UUID \u2014 required"},amount:{type:"number",description:"Amount in source currency \u2014 required (>0)"},description:{type:"string"},taxProfileResourceId:{type:"string"}}}},contactResourceId:{type:"string"},bankAccountJournalEntryDescription:{type:"string"},internalNotes:{type:"string"},tags:{type:"array",items:{type:"string"}},taxVatApplicable:{type:"boolean"},taxInclusion:{type:"boolean"},capsuleResourceId:{type:"string"}},required:["bankStatementEntryResourceId","bankAccountResourceId","reference","journalEntries"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry multi line cash journal splits",execute:async(t,e)=>(Dn(e.journalEntries,"journalEntries",200,"entries"),Q8(t.client,e))},{name:"reconcile_manual_journal",description:'\u26A0\uFE0F CALLER PROVIDES ONLY THE OFFSET LEG(S) \u2014 backend AUTO-ADDS the bank-side leg from the statement entry. Sending both debit AND credit legs \u2192 422 "sum of debit and credit amounts are not equal" (your sides duplicate after the auto-add). Reconcile a bank statement entry with a double-entry manual journal. Sync \u2014 returns the reconciled entry status. valueDate prefills from bank entry if omitted. NOT idempotent.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID \u2014 required"},status:{type:"string",enum:["DRAFT","ACTIVE"],description:"Journal status \u2014 required"},journalEntries:{type:"array",description:"Offset-side journal entries only (max 200). The bank-side leg is auto-added by the API.",items:{type:"object",properties:{accountResourceId:{type:"string",description:"Account UUID \u2014 required"},type:{type:"string",enum:["DEBIT","CREDIT"]},amount:{type:"number",description:"Amount \u2014 required"},description:{type:"string"},contactResourceId:{type:"string"},taxProfileResourceId:{type:"string"}}}},reference:{type:"string"},valueDate:{type:"string",description:"YYYY-MM-DD. Defaults to bank entry value date."},contactResourceId:{type:"string"},internalNotes:{type:"string"},bankAccountJournalEntryDescription:{type:"string"},taxVatApplicable:{type:"boolean"},taxInclusion:{type:"boolean"},tags:{type:"array",items:{type:"string"}},capsuleResourceId:{type:"string"}},required:["bankStatementEntryResourceId","bankAccountResourceId","status","journalEntries"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry manual journal double entry",execute:async(t,e)=>(Dn(e.journalEntries,"journalEntries",200,"entries"),L8(t.client,e))},{name:"reconcile_cash_transfer",description:"Reconcile a bank statement entry with an inter-account transfer. Sync \u2014 returns the reconciled entry status. amount is required only when the counterparty account is in a non-functional currency. NOT idempotent.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID \u2014 required"},accountResourceId:{type:"string",description:"Counterparty cash account UUID \u2014 required"},reference:{type:"string",description:"Transfer reference \u2014 required"},amount:{type:"number",description:"Amount in source currency. Required only for cross-currency transfers."},contactResourceId:{type:"string"},internalNotes:{type:"string"},tags:{type:"array",items:{type:"string"}},capsuleResourceId:{type:"string"}},required:["bankStatementEntryResourceId","bankAccountResourceId","accountResourceId","reference"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry transfer between accounts",execute:async(t,e)=>M8(t.client,e)},{name:"reconcile_invoice_receipt",description:'CREATES A NEW invoice and auto-reconciles it to a bank statement entry (AR). To match an EXISTING open invoice instead, use reconcile_with_payments (do not create a duplicate). \u26A0\uFE0F BSE must have `paymentDirection: PAYIN` (money in \u2014 AR). Produce via `bank add-records` with a POSITIVE amount (creates `credit_amount > 0` \u2192 PAYIN). Statement-imported BSEs from `bank import` also work. The error code "Invalid business transaction type" (422) is misleadingly named \u2014 the actual gate is direction, not entry type. Sync \u2014 returns the reconciled entry status. valueDate / dueDate / payment amount prefill from the bank entry if omitted. NOT idempotent.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID \u2014 required"},invoiceDetails:{type:"object",description:"The invoice to create. Required.",properties:{reference:{type:"string",description:"Invoice reference \u2014 required"},contactResourceId:{type:"string",description:"Customer UUID"},valueDate:{type:"string",description:"YYYY-MM-DD. Defaults to bank entry value date."},dueDate:{type:"string",description:"YYYY-MM-DD. Defaults to value date."},taxInclusion:{type:"boolean"},isTaxVATApplicable:{type:"boolean"},lineItems:{type:"array",description:"Invoice line items (max 500) \u2014 required",items:{type:"object",properties:{name:{type:"string",description:"Line description \u2014 required"},quantity:{type:"number"},unit:{type:"string"},unitPrice:{type:"number"},organizationAccountResourceId:{type:"string",description:"Revenue account UUID"},itemResourceId:{type:"string"},taxProfileResourceId:{type:"string"}}}},recordedPayment:{type:"object",description:"Optional. The matching payment record \u2014 auto-built from the bank entry if omitted.",properties:{reference:{type:"string"},valueDate:{type:"string",description:"YYYY-MM-DD. Defaults to bank entry value date."},organizationAccountResourceId:{type:"string"},paymentAmount:{type:"number"},transactionAmount:{type:"number"},paymentMethod:Fy,adjustment:Qy}},capsuleResourceId:{type:"string"}}}},required:["bankStatementEntryResourceId","bankAccountResourceId","invoiceDetails"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry invoice receipt AR sale",execute:async(t,e)=>(sfe(e.invoiceDetails,"invoiceDetails"),P8(t.client,e))},{name:"reconcile_bill_receipt",description:'CREATES A NEW bill and auto-reconciles it to a bank statement entry (AP). To match an EXISTING open bill instead, use reconcile_with_payments (do not create a duplicate). \u26A0\uFE0F BSE must have `paymentDirection: PAYOUT` (money out \u2014 AP). Produce via `bank add-records` with a NEGATIVE amount (creates `debit_amount > 0` \u2192 PAYOUT). Statement-imported BSEs from `bank import` also work. The error code "Invalid business transaction type" (422) is misleadingly named \u2014 the actual gate is direction, not entry type. Sync \u2014 returns the reconciled entry status. valueDate / dueDate / payment amount prefill from the bank entry if omitted. NOT idempotent.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID \u2014 required"},billDetails:{type:"object",description:"The bill to create. Required.",properties:{reference:{type:"string",description:"Bill reference \u2014 required"},contactResourceId:{type:"string",description:"Supplier UUID"},valueDate:{type:"string",description:"YYYY-MM-DD. Defaults to bank entry value date."},dueDate:{type:"string",description:"YYYY-MM-DD. Defaults to value date."},taxInclusion:{type:"boolean"},isTaxVATApplicable:{type:"boolean"},lineItems:{type:"array",description:"Bill line items (max 500) \u2014 required",items:{type:"object",properties:{name:{type:"string",description:"Line description \u2014 required"},quantity:{type:"number"},unit:{type:"string"},unitPrice:{type:"number"},organizationAccountResourceId:{type:"string",description:"Expense account UUID"},itemResourceId:{type:"string"},taxProfileResourceId:{type:"string"}}}},recordedPayment:{type:"object",description:"Optional. The matching payment record \u2014 auto-built from the bank entry if omitted.",properties:{reference:{type:"string"},valueDate:{type:"string",description:"YYYY-MM-DD"},organizationAccountResourceId:{type:"string"},paymentAmount:{type:"number"},transactionAmount:{type:"number"},paymentMethod:Fy,adjustment:Qy}},capsuleResourceId:{type:"string"}}}},required:["bankStatementEntryResourceId","bankAccountResourceId","billDetails"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry bill receipt AP purchase",execute:async(t,e)=>(sfe(e.billDetails,"billDetails"),U8(t.client,e))},{name:"reconcile_with_payments",description:"USE THIS to match a bank statement entry to an EXISTING open bill / invoice / payment (NOT reconcile_bill_receipt or reconcile_invoice_receipt, which CREATE a new bill/invoice). Pass the open transaction's cashflowTransactionResourceId (from search_cashflow_transactions or a view_auto_reconciliation suggestion) in businessTransactionPayments[] \u2014 this CREATES the payment AND reconciles in one call; no pay_bill / pay_invoice first. FX is resolved server-side \u2014 pass NO rate for the common case (only supply paymentAmount + currencySettings for the rare bill-currency \u2260 bank-currency case). Sync \u2014 returns the reconciled entry status. NOT idempotent: a blind retry double-creates a payment; confirm reconciled-state via search_bank_records(status: RECONCILED) before retrying.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},businessTransactionPayments:{type:"array",description:"Open business transactions (bills/invoices) to reconcile by creating a payment against each.",items:{type:"object",properties:{cashflowTransactionResourceId:{type:"string",description:"Open BT cashflow UUID (the bill/invoice) \u2014 required"},transactionAmount:{type:"number",description:"Payment amount in the BT currency \u2014 required (>0)"},paymentAmount:{type:"number",description:"Actual amount in bank-statement currency. Required ONLY when bank currency \u2260 BT currency."},currencySettings:{type:"object",description:"FX settings \u2014 supply ONLY for cross-currency (bank ccy \u2260 BT ccy). Omit otherwise (server resolves).",properties:{sourceCurrencyCode:{type:"string",description:"BT currency (ISO 4217)"},rateFunctionalToSource:{type:"number"},exchangeToken:{type:"string"}}}}}},matchedPayments:{type:"array",items:{type:"string"},description:"Existing payment UUIDs to reconcile against the entry"},matchedBatchPayments:{type:"array",items:{type:"string"},description:"Existing batch payment UUIDs to reconcile against the entry"},adjustment:{type:"object",description:"Optional adjustment leg to balance payments vs the statement amount (over/under-payment, rounding, or FX gain/loss write-off \u2014 the platform does NOT auto-post FX gain/loss).",properties:{reference:{type:"string"},contactResourceId:{type:"string"},tags:{type:"array",items:{type:"string"}},cashAdjustmentEntries:{type:"array",items:{type:"object",properties:{organizationAccountResourceId:{type:"string",description:"e.g. the FX gain/loss account UUID"},amount:{type:"number"},description:{type:"string"},taxProfileResourceId:{type:"string"},rateSourceToFunctional:{type:"number",description:"Required when this account is in a non-functional currency."}}}},bankAccountJournalEntryRateFunctionalToSource:{type:"number",description:"Required when the bank account is in a non-functional currency."}}}},required:["bankStatementEntryResourceId"],group:"reconciliations",readOnly:!1,searchHint:"match bank entry to existing open bill invoice payment reconcile with payments pay outstanding",execute:async(t,e)=>(Cot(e),$8(t.client,e))},{name:"reconcile_magic_match",description:"Bulk-accept MAGIC_MATCH suggestions: reconcile many bank entries against EXISTING open business transactions and/or payments in one call (max 500 entries). Feed entries from view_auto_reconciliation suggestions. Returns a per-entry split { reconciled[], failed[] } \u2014 a 200 with a non-empty failed[] is a PARTIAL success; surface failed entries (with their errorCode) and loop. Entry-level idempotency-keyed server-side. Use reconcile_with_payments for a single precise match; use this to accept a batch of suggestions at once.",params:{bankAccountResourceId:{type:"string",description:"Bank account UUID the entries belong to \u2014 required"},autoReconcileRunResourceId:{type:"string",description:"Auto-reconciliation run UUID for batch tracking"},entries:{type:"array",description:"One row per bank entry to reconcile (max 500).",items:{type:"object",properties:{workflowType:{type:"string",enum:["MAGIC_MATCH"],description:"Only MAGIC_MATCH (match to existing) is supported here."},bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},matchedBusinessTransactions:{type:"array",items:{type:"string"},description:"Open BT cashflow UUIDs to reconcile by creating payments"},matchedPayments:{type:"array",items:{type:"string"},description:"Existing payment UUIDs"},matchedBatchResourceId:{type:"string",description:"Batch payment UUID"}}}}},required:["bankAccountResourceId","entries"],group:"reconciliations",readOnly:!1,searchHint:"bulk accept magic match suggestions reconcile many bank entries to existing",execute:async(t,e)=>(Dn(e.entries,"entries",500,"entries"),j8(t.client,e))},{name:"reconcile_learned_prediction",description:"Accept an ML learned-prediction suggestion to reconcile a bank entry. predictedPayload + predictedPayloadSchemaVersion are passed through VERBATIM from a view_auto_reconciliation suggestion (recommendationType MAGIC_RECONCILE_WITH_CASH_IN_OUT) \u2014 do not construct them by hand. Pass retryToken to force a fresh journal on an edit-then-retry; omit it for an idempotent replay. Sync \u2014 returns the reconciled entry status. On failure (stale/invalid payload), fall back to reconcile_with_payments \u2014 do NOT retry the same opaque payload.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},learnedPredictionResourceId:{type:"string",description:"Learned-prediction UUID from the suggestion \u2014 required"},predictedPayload:{type:"string",description:"Opaque JSON payload from the suggestion \u2014 required, passed verbatim"},predictedPayloadSchemaVersion:{type:"string",description:"Schema version from the suggestion \u2014 required"},retryToken:{type:"string",description:"Optional idempotency retry token"},autoReconcileRunResourceId:{type:"string",description:"Auto-reconciliation run UUID for batch tracking"}},required:["bankStatementEntryResourceId","learnedPredictionResourceId","predictedPayload","predictedPayloadSchemaVersion"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry learned prediction ML cash in out accept suggestion",execute:async(t,e)=>q8(t.client,e)},{name:"undo_reconciliations",description:"Unlink bank entries from what they were reconciled against, returning each to UNRECONCILED. Re-running reports already-unreconciled/archived entries as per-entry FAILED (INVALID_BANK_STATEMENT_ENTRY_STATUS); it never double-applies. On a non-200 nothing was applied, the batch rolls back. Ids that do not resolve are OMITTED from resetReconciliationResponse, so compare returned ids against what you sent. Does NOT delete the record it was matched to; reconcile_* tools that CREATE one leave it on the books as a bank-rec discrepancy, and re-reconciling without deleting it duplicates the record. Delete via linkedRecords by businessTransactionType: SALE=delete_invoice, PURCHASE=delete_bill, SALE_CREDIT_NOTE=delete_customer_credit_note, PURCHASE_CREDIT_NOTE=delete_supplier_credit_note, PAYMENT_*=delete_payment, JOURNAL_MANUAL=delete_journal (voids an ACTIVE) \u2014 all using businessTransactionResourceId. JOURNAL_DIRECT_CASH_IN/OUT and JOURNAL_CASH_TRANSFER use delete_cash_in/out/transfer with parentEntityResourceId instead. Any other type has no delete tool: locate it with search_cashflow_transactions first.",params:{bankStatementEntryResourceIds:{type:"array",items:{type:"string"},description:"Bank entry UUIDs to unlink. 1-500, unique."}},required:["bankStatementEntryResourceIds"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"undo unreconcile reset reverse reconciliation unlink bank entry mistake wrong match",execute:async(t,e)=>{Dn(e.bankStatementEntryResourceIds,"bankStatementEntryResourceIds",500,"bank entries");let r=[...new Set(e.bankStatementEntryResourceIds)];return Y8(t.client,{...e,bankStatementEntryResourceIds:r})}},{name:"validate_drafts",description:`BULK validate up to 500 draft business transactions in ONE call, mixing any btType. SYNC \u2014 returns per-item errors + display data; no state change. Run before convert_drafts_to_active.
872
+ ASYNC: returns jobId \u2192 poll search_background_jobs(filter:{resourceId:{eq:jobId}}); on PARTIAL_SUCCESS read data[0].errorDetails.`,params:{fixedAssets:{type:"array",description:"Fixed assets to create/update (max 500).",items:{type:"object",properties:{rowIndex:{type:"string"},reference:{type:"string",description:"Natural key \u2014 required"},registrationType:{type:"string",enum:["NEW","TRANSFER"],description:"NEW = newly acquired, TRANSFER = inherited \u2014 required"},typeCode:{type:"string",description:"Asset class code (e.g. FURNITURE_AND_FIXTURE)"},typeName:{type:"string",description:"Human label for typeCode"},category:{type:"string",enum:["TANGIBLE","INTANGIBLE"],description:"TANGIBLE | INTANGIBLE"},name:{type:"string",description:"Asset name"},purchaseAmount:{type:"number",description:"Acquisition cost."},purchaseDate:{type:"number",description:"Acquisition date, epoch ms (NOT YYYY-MM-DD on this endpoint)."},depreciationStartDate:{type:"number",description:"Epoch ms. Omit to default to purchaseDate."},effectiveLife:{type:"number",description:"Useful life months."},depreciationMethod:{type:"string",enum:["STRAIGHT_LINE","NO_DEPRECIATION"],description:"Bulk accepts only STRAIGHT_LINE or NO_DEPRECIATION (422 otherwise) \u2014 use create_fixed_asset for declining-balance methods."},purchaseAssetAccountResourceId:{type:"string",description:"Asset (PPE) account UUIDv4."},depreciationExpenseAccountResourceId:{type:"string",description:"Depreciation expense account UUIDv4."},accumulatedDepreciationAccountResourceId:{type:"string",description:"Accumulated depreciation account UUIDv4."},purchaseBusinessTransactionType:{type:"string",enum:["PURCHASE","SALE","JOURNAL_MANUAL"],description:"Required for NEW."},purchaseBusinessTransactionResourceId:{type:"string",description:"Purchase LINE ITEM id, unlinked. Required for NEW."},accumulatedDepreciationAtTransferDate:{type:"number",description:"TRANSFER only."},bookValueAtTransferDate:{type:"number",description:"TRANSFER only."},internalNotes:{type:"string"}}}}},required:["fixedAssets"],group:"fixed_assets",readOnly:!1,searchHint:"bulk fixed assets ppe register upsert import migrate",execute:async(t,e)=>{Dn(e.fixedAssets,"fixedAssets",500,"fixed assets");let r=e.fixedAssets;return v0e(r,["purchaseDate","depreciationStartDate"]),e8(t.client,r)}},{name:"quick_reconcile",description:`Bulk-reconcile bank statement entries against a list of journals (max 500). Reconciliation mode is hardcoded to QUICK_RECON. ${Vl} Caller provides bankAccountResourceId + journalsForReconciliation[] (each row: bankStatementEntryResourceId, journalReference, journalAccountResourceId).`,params:{bankAccountResourceId:{type:"string",description:"Bank account UUID (the entries belong to this account)"},journalsForReconciliation:{type:"array",description:"Per-row reconciliation instructions (max 500).",items:{type:"object",properties:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},journalReference:{type:"string",description:"Journal reference text \u2014 required"},journalAccountResourceId:{type:"string",description:"Offsetting account UUID (revenue for cash-in, expense for cash-out) \u2014 required"},contactResourceId:{type:"string",description:"Contact UUID"},capsuleResourceId:{type:"string",description:"Capsule UUID"},taxProfileResourceId:{type:"string",description:"Tax profile UUID"},internalNotes:{type:"string"},journalEntryDescription:{type:"string"},tags:{type:"array",items:{type:"string"}},rowIndex:{type:"string",description:"Optional caller-supplied index for error correlation"}}}}},required:["bankAccountResourceId","journalsForReconciliation"],group:"reconciliations",readOnly:!1,searchHint:"bulk reconcile bank statement journals match",execute:async(t,e)=>(Dn(e.journalsForReconciliation,"journalsForReconciliation",500,"journals"),N8(t.client,e))},{name:"apply_bank_rule",description:"Apply a pre-configured bank rule (action shortcut) to a batch of bank statement entries (max 500). Async \u2014 returns a jobId. Poll search_background_jobs filtered by resourceId. The rule executes its configured action (e.g. RECONCILE_WITH_DIRECT_CASH_ENTRY) on each entry.",params:{actionShortcutResourceId:{type:"string",description:"Bank rule UUID \u2014 required"},businessTransactionResourceIds:{type:"array",description:"Bank statement entry UUIDs to apply the rule to (max 500). Note: the field is named businessTransactionResourceIds for legacy reasons but accepts bank entry IDs.",items:{type:"string"}}},required:["actionShortcutResourceId","businessTransactionResourceIds"],group:"reconciliations",readOnly:!1,searchHint:"bank rule apply action shortcut bulk reconcile",execute:async(t,e)=>(Dn(e.businessTransactionResourceIds,"businessTransactionResourceIds",500,"entries"),O8(t.client,e))},{name:"reconcile_direct_cash_entry",description:"Reconcile a bank statement entry with a single cash-in / cash-out line. Direction (cash-in vs cash-out) is INFERRED from the bank entry sign. Sync \u2014 returns the reconciled entry status. NOT idempotent: calling twice on the same bankStatementEntryResourceId creates duplicate journals. Confirm reconciled-state via view_auto_reconciliation before retrying.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID (used to look up the entry) \u2014 required"},reference:{type:"string",description:"Reference for the cash entry \u2014 required"},accountResourceId:{type:"string",description:"Offsetting account UUID (revenue for cash-in, expense for cash-out) \u2014 required"},amount:{type:"number",description:"Amount in source currency. Defaults to bank entry amount if omitted."},description:{type:"string"},contactResourceId:{type:"string"},taxProfileResourceId:{type:"string"},internalNotes:{type:"string"},bankAccountJournalEntryDescription:{type:"string",description:"Description for the bank-side journal entry"},tags:{type:"array",items:{type:"string"}},taxVatApplicable:{type:"boolean"},taxInclusion:{type:"boolean"},capsuleResourceId:{type:"string"}},required:["bankStatementEntryResourceId","bankAccountResourceId","reference","accountResourceId"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry direct cash in out single line",execute:async(t,e)=>F8(t.client,e)},{name:"reconcile_cash_journal",description:"Reconcile a bank statement entry with a multi-line cashflow journal (multiple cash splits, max 200 lines). Sync \u2014 returns the reconciled entry status. NOT idempotent \u2014 confirm reconciled-state before retrying.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID \u2014 required"},reference:{type:"string",description:"Journal reference \u2014 required"},journalEntries:{type:"array",description:"Cash journal lines (max 200). Each row is one debit OR credit against an account.",items:{type:"object",properties:{accountResourceId:{type:"string",description:"Account UUID \u2014 required"},amount:{type:"number",description:"Amount in source currency \u2014 required (>0)"},description:{type:"string"},taxProfileResourceId:{type:"string"}}}},contactResourceId:{type:"string"},bankAccountJournalEntryDescription:{type:"string"},internalNotes:{type:"string"},tags:{type:"array",items:{type:"string"}},taxVatApplicable:{type:"boolean"},taxInclusion:{type:"boolean"},capsuleResourceId:{type:"string"}},required:["bankStatementEntryResourceId","bankAccountResourceId","reference","journalEntries"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry multi line cash journal splits",execute:async(t,e)=>(Dn(e.journalEntries,"journalEntries",200,"entries"),Q8(t.client,e))},{name:"reconcile_manual_journal",description:'\u26A0\uFE0F CALLER PROVIDES ONLY THE OFFSET LEG(S) \u2014 backend AUTO-ADDS the bank-side leg from the statement entry. Sending both debit AND credit legs \u2192 422 "sum of debit and credit amounts are not equal" (your sides duplicate after the auto-add). Reconcile a bank statement entry with a double-entry manual journal. Sync \u2014 returns the reconciled entry status. valueDate prefills from bank entry if omitted. NOT idempotent.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID \u2014 required"},status:{type:"string",enum:["DRAFT","ACTIVE"],description:"Journal status \u2014 required"},journalEntries:{type:"array",description:"Offset-side journal entries only (max 200). The bank-side leg is auto-added by the API.",items:{type:"object",properties:{accountResourceId:{type:"string",description:"Account UUID \u2014 required"},type:{type:"string",enum:["DEBIT","CREDIT"]},amount:{type:"number",description:"Amount \u2014 required"},description:{type:"string"},taxProfileResourceId:{type:"string"}}}},reference:{type:"string"},valueDate:{type:"string",description:"YYYY-MM-DD. Defaults to bank entry value date."},contactResourceId:{type:"string"},internalNotes:{type:"string"},bankAccountJournalEntryDescription:{type:"string"},taxVatApplicable:{type:"boolean"},taxInclusion:{type:"boolean"},tags:{type:"array",items:{type:"string"}},capsuleResourceId:{type:"string"}},required:["bankStatementEntryResourceId","bankAccountResourceId","status","journalEntries"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry manual journal double entry",execute:async(t,e)=>(Dn(e.journalEntries,"journalEntries",200,"entries"),L8(t.client,e))},{name:"reconcile_cash_transfer",description:"Reconcile a bank statement entry with an inter-account transfer. Sync \u2014 returns the reconciled entry status. amount is required only when the counterparty account is in a non-functional currency. NOT idempotent.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID \u2014 required"},accountResourceId:{type:"string",description:"Counterparty cash account UUID \u2014 required"},reference:{type:"string",description:"Transfer reference \u2014 required"},amount:{type:"number",description:"Amount in source currency. Required only for cross-currency transfers."},contactResourceId:{type:"string"},internalNotes:{type:"string"},tags:{type:"array",items:{type:"string"}},capsuleResourceId:{type:"string"}},required:["bankStatementEntryResourceId","bankAccountResourceId","accountResourceId","reference"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry transfer between accounts",execute:async(t,e)=>M8(t.client,e)},{name:"reconcile_invoice_receipt",description:'CREATES A NEW invoice and auto-reconciles it to a bank statement entry (AR). To match an EXISTING open invoice instead, use reconcile_with_payments (do not create a duplicate). \u26A0\uFE0F BSE must have `paymentDirection: PAYIN` (money in \u2014 AR). Produce via `bank add-records` with a POSITIVE amount (creates `credit_amount > 0` \u2192 PAYIN). Statement-imported BSEs from `bank import` also work. The error code "Invalid business transaction type" (422) is misleadingly named \u2014 the actual gate is direction, not entry type. Sync \u2014 returns the reconciled entry status. valueDate / dueDate / payment amount prefill from the bank entry if omitted. NOT idempotent.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID \u2014 required"},invoiceDetails:{type:"object",description:"The invoice to create. Required.",properties:{reference:{type:"string",description:"Invoice reference \u2014 required"},contactResourceId:{type:"string",description:"Customer UUID"},valueDate:{type:"string",description:"YYYY-MM-DD. Defaults to bank entry value date."},dueDate:{type:"string",description:"YYYY-MM-DD. Defaults to value date."},taxInclusion:{type:"boolean"},isTaxVATApplicable:{type:"boolean"},lineItems:{type:"array",description:"Invoice line items (max 500) \u2014 required",items:{type:"object",properties:{name:{type:"string",description:"Line description \u2014 required"},quantity:{type:"number"},unit:{type:"string"},unitPrice:{type:"number"},organizationAccountResourceId:{type:"string",description:"Revenue account UUID"},itemResourceId:{type:"string"},taxProfileResourceId:{type:"string"}}}},recordedPayment:{type:"object",description:"Optional. The matching payment record \u2014 auto-built from the bank entry if omitted.",properties:{reference:{type:"string"},valueDate:{type:"string",description:"YYYY-MM-DD. Defaults to bank entry value date."},organizationAccountResourceId:{type:"string"},paymentAmount:{type:"number"},transactionAmount:{type:"number"},paymentMethod:Fy,adjustment:Qy}},capsuleResourceId:{type:"string"}}}},required:["bankStatementEntryResourceId","bankAccountResourceId","invoiceDetails"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry invoice receipt AR sale",execute:async(t,e)=>(sfe(e.invoiceDetails,"invoiceDetails"),P8(t.client,e))},{name:"reconcile_bill_receipt",description:'CREATES A NEW bill and auto-reconciles it to a bank statement entry (AP). To match an EXISTING open bill instead, use reconcile_with_payments (do not create a duplicate). \u26A0\uFE0F BSE must have `paymentDirection: PAYOUT` (money out \u2014 AP). Produce via `bank add-records` with a NEGATIVE amount (creates `debit_amount > 0` \u2192 PAYOUT). Statement-imported BSEs from `bank import` also work. The error code "Invalid business transaction type" (422) is misleadingly named \u2014 the actual gate is direction, not entry type. Sync \u2014 returns the reconciled entry status. valueDate / dueDate / payment amount prefill from the bank entry if omitted. NOT idempotent.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},bankAccountResourceId:{type:"string",description:"Bank account UUID \u2014 required"},billDetails:{type:"object",description:"The bill to create. Required.",properties:{reference:{type:"string",description:"Bill reference \u2014 required"},contactResourceId:{type:"string",description:"Supplier UUID"},valueDate:{type:"string",description:"YYYY-MM-DD. Defaults to bank entry value date."},dueDate:{type:"string",description:"YYYY-MM-DD. Defaults to value date."},taxInclusion:{type:"boolean"},isTaxVATApplicable:{type:"boolean"},lineItems:{type:"array",description:"Bill line items (max 500) \u2014 required",items:{type:"object",properties:{name:{type:"string",description:"Line description \u2014 required"},quantity:{type:"number"},unit:{type:"string"},unitPrice:{type:"number"},organizationAccountResourceId:{type:"string",description:"Expense account UUID"},itemResourceId:{type:"string"},taxProfileResourceId:{type:"string"}}}},recordedPayment:{type:"object",description:"Optional. The matching payment record \u2014 auto-built from the bank entry if omitted.",properties:{reference:{type:"string"},valueDate:{type:"string",description:"YYYY-MM-DD"},organizationAccountResourceId:{type:"string"},paymentAmount:{type:"number"},transactionAmount:{type:"number"},paymentMethod:Fy,adjustment:Qy}},capsuleResourceId:{type:"string"}}}},required:["bankStatementEntryResourceId","bankAccountResourceId","billDetails"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry bill receipt AP purchase",execute:async(t,e)=>(sfe(e.billDetails,"billDetails"),U8(t.client,e))},{name:"reconcile_with_payments",description:"USE THIS to match a bank statement entry to an EXISTING open bill / invoice / payment (NOT reconcile_bill_receipt or reconcile_invoice_receipt, which CREATE a new bill/invoice). Pass the open transaction's cashflowTransactionResourceId (from search_cashflow_transactions or a view_auto_reconciliation suggestion) in businessTransactionPayments[] \u2014 this CREATES the payment AND reconciles in one call; no pay_bill / pay_invoice first. FX is resolved server-side \u2014 pass NO rate for the common case (only supply paymentAmount + currencySettings for the rare bill-currency \u2260 bank-currency case). Sync \u2014 returns the reconciled entry status. NOT idempotent: a blind retry double-creates a payment; confirm reconciled-state via search_bank_records(status: RECONCILED) before retrying.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},businessTransactionPayments:{type:"array",description:"Open business transactions (bills/invoices) to reconcile by creating a payment against each.",items:{type:"object",properties:{cashflowTransactionResourceId:{type:"string",description:"Open BT cashflow UUID (the bill/invoice) \u2014 required"},transactionAmount:{type:"number",description:"Payment amount in the BT currency \u2014 required (>0)"},paymentAmount:{type:"number",description:"Actual amount in bank-statement currency. Required ONLY when bank currency \u2260 BT currency."},currencySettings:{type:"object",description:"FX settings \u2014 supply ONLY for cross-currency (bank ccy \u2260 BT ccy). Omit otherwise (server resolves).",properties:{sourceCurrencyCode:{type:"string",description:"BT currency (ISO 4217)"},rateFunctionalToSource:{type:"number"},exchangeToken:{type:"string"}}}}}},matchedPayments:{type:"array",items:{type:"string"},description:"Existing payment UUIDs to reconcile against the entry"},matchedBatchPayments:{type:"array",items:{type:"string"},description:"Existing batch payment UUIDs to reconcile against the entry"},adjustment:{type:"object",description:"Optional adjustment leg to balance payments vs the statement amount (over/under-payment, rounding, or FX gain/loss write-off \u2014 the platform does NOT auto-post FX gain/loss).",properties:{reference:{type:"string"},contactResourceId:{type:"string"},tags:{type:"array",items:{type:"string"}},cashAdjustmentEntries:{type:"array",items:{type:"object",properties:{organizationAccountResourceId:{type:"string",description:"e.g. the FX gain/loss account UUID"},amount:{type:"number"},description:{type:"string"},taxProfileResourceId:{type:"string"},rateSourceToFunctional:{type:"number",description:"Required when this account is in a non-functional currency."}}}},bankAccountJournalEntryRateFunctionalToSource:{type:"number",description:"Required when the bank account is in a non-functional currency."}}}},required:["bankStatementEntryResourceId"],group:"reconciliations",readOnly:!1,searchHint:"match bank entry to existing open bill invoice payment reconcile with payments pay outstanding",execute:async(t,e)=>(Cot(e),$8(t.client,e))},{name:"reconcile_magic_match",description:"Bulk-accept MAGIC_MATCH suggestions: reconcile many bank entries against EXISTING open business transactions and/or payments in one call (max 500 entries). Feed entries from view_auto_reconciliation suggestions. Returns a per-entry split { reconciled[], failed[] } \u2014 a 200 with a non-empty failed[] is a PARTIAL success; surface failed entries (with their errorCode) and loop. Entry-level idempotency-keyed server-side. Use reconcile_with_payments for a single precise match; use this to accept a batch of suggestions at once.",params:{bankAccountResourceId:{type:"string",description:"Bank account UUID the entries belong to \u2014 required"},autoReconcileRunResourceId:{type:"string",description:"Auto-reconciliation run UUID for batch tracking"},entries:{type:"array",description:"One row per bank entry to reconcile (max 500).",items:{type:"object",properties:{workflowType:{type:"string",enum:["MAGIC_MATCH"],description:"Only MAGIC_MATCH (match to existing) is supported here."},bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},matchedBusinessTransactions:{type:"array",items:{type:"string"},description:"Open BT cashflow UUIDs to reconcile by creating payments"},matchedPayments:{type:"array",items:{type:"string"},description:"Existing payment UUIDs"},matchedBatchResourceId:{type:"string",description:"Batch payment UUID"}}}}},required:["bankAccountResourceId","entries"],group:"reconciliations",readOnly:!1,searchHint:"bulk accept magic match suggestions reconcile many bank entries to existing",execute:async(t,e)=>(Dn(e.entries,"entries",500,"entries"),j8(t.client,e))},{name:"reconcile_learned_prediction",description:"Accept an ML learned-prediction suggestion to reconcile a bank entry. predictedPayload + predictedPayloadSchemaVersion are passed through VERBATIM from a view_auto_reconciliation suggestion (recommendationType MAGIC_RECONCILE_WITH_CASH_IN_OUT) \u2014 do not construct them by hand. Pass retryToken to force a fresh journal on an edit-then-retry; omit it for an idempotent replay. Sync \u2014 returns the reconciled entry status. On failure (stale/invalid payload), fall back to reconcile_with_payments \u2014 do NOT retry the same opaque payload.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID \u2014 required"},learnedPredictionResourceId:{type:"string",description:"Learned-prediction UUID from the suggestion \u2014 required"},predictedPayload:{type:"string",description:"Opaque JSON payload from the suggestion \u2014 required, passed verbatim"},predictedPayloadSchemaVersion:{type:"string",description:"Schema version from the suggestion \u2014 required"},retryToken:{type:"string",description:"Optional idempotency retry token"},autoReconcileRunResourceId:{type:"string",description:"Auto-reconciliation run UUID for batch tracking"}},required:["bankStatementEntryResourceId","learnedPredictionResourceId","predictedPayload","predictedPayloadSchemaVersion"],group:"reconciliations",readOnly:!1,searchHint:"reconcile bank entry learned prediction ML cash in out accept suggestion",execute:async(t,e)=>q8(t.client,e)},{name:"undo_reconciliations",description:"Unlink bank entries from what they were reconciled against, returning each to UNRECONCILED. Re-running reports already-unreconciled/archived entries as per-entry FAILED (INVALID_BANK_STATEMENT_ENTRY_STATUS); it never double-applies. On a non-200 nothing was applied, the batch rolls back. Ids that do not resolve are OMITTED from resetReconciliationResponse, so compare returned ids against what you sent. Does NOT delete the record it was matched to; reconcile_* tools that CREATE one leave it on the books as a bank-rec discrepancy, and re-reconciling without deleting it duplicates the record. Delete via linkedRecords by businessTransactionType: SALE=delete_invoice, PURCHASE=delete_bill, SALE_CREDIT_NOTE=delete_customer_credit_note, PURCHASE_CREDIT_NOTE=delete_supplier_credit_note, PAYMENT_*=delete_payment, JOURNAL_MANUAL=delete_journal (voids an ACTIVE) \u2014 all using businessTransactionResourceId. JOURNAL_DIRECT_CASH_IN/OUT and JOURNAL_CASH_TRANSFER use delete_cash_in/out/transfer with parentEntityResourceId instead. Any other type has no delete tool: locate it with search_cashflow_transactions first.",params:{bankStatementEntryResourceIds:{type:"array",items:{type:"string"},description:"Bank entry UUIDs to unlink. 1-500, unique."}},required:["bankStatementEntryResourceIds"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"undo unreconcile reset reverse reconciliation unlink bank entry mistake wrong match",execute:async(t,e)=>{Dn(e.bankStatementEntryResourceIds,"bankStatementEntryResourceIds",500,"bank entries");let r=[...new Set(e.bankStatementEntryResourceIds)];return Y8(t.client,{...e,bankStatementEntryResourceIds:r})}},{name:"validate_drafts",description:`BULK validate up to 500 draft business transactions in ONE call, mixing any btType. SYNC \u2014 returns per-item errors + display data; no state change. Run before convert_drafts_to_active.
873
873
 
874
874
  btType enum: SALE = invoice, PURCHASE = bill, SALE_CREDIT_NOTE = customer CN, PURCHASE_CREDIT_NOTE = supplier CN. Journals NOT in this enum.
875
875
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jaz-clio",
3
- "version": "5.46.11",
3
+ "version": "5.46.12",
4
4
  "description": "Clio: Command Line Interface Operator for Jaz AI.",
5
5
  "type": "module",
6
6
  "bin": {