jaz-clio 9.0.0 → 9.0.2

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: 9.0.0
3
+ version: 9.0.2
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, 148 production gotchas, error
@@ -334,7 +334,7 @@ Bills, invoices, and credit notes share identical mandatory field specs. Adding
334
334
  97. **Inventory balances: one item or all.** One item: `GET /inventory-item-balance/:itemResourceId` (`get_inventory_balance`) returns `{ itemResourceId, latestAverageCostAmount, baseQty, baseUnit }`; the id is the ITEM resourceId, not an inventory-specific ID. All items: `GET /inventory-balances/:balanceStatus` (`list_inventory_balances`, `clio inventory balances --status`) with `balanceStatus` one of `ALL`, `AVAILABLE`, `FULLY_DRAWN` (anything else is 422); rows carry `itemCode`, `internalName`, `totalQuantity`, `baseUnit`, `averageCostAmount`, `balanceAmount`. The API answers an empty result with 404; the tool and CLI return it as `data: []`. `offset` is a page number here, though the spec says row (probed live 2026-09-23).
335
335
 
336
336
  ### Withholding Tax
337
- 98. **Withholding codes are `GET /withholding-codes`** (`list_withholding_codes`, `clio tax-profiles withholding-codes`): the BIR ATCs with `code`, `rate`, `rateType`, `type` (corp, ind, final, wvat), `description` and `resourceId`; filters `countryCode`, `code` (contains, space included) and `type`; `limit` max 100, `offset` is a page. `GET /withholding-tax-codes` is a different list (MSIC/PSIC industry codes) that no withholding field accepts. A customer's 2307 is a sale batch payment with method `WITHHOLDING_TAX_CERTIFICATE` (`record_withholding_tax_certificate`): PH orgs only, sales only, account = the system "Creditable Withholding Tax" account, one allocation per code by `resourceId`, and each allocation's `baseAmount` is the TAX WITHHELD (the dashboard's "Withholding" column; `amount` is the income); the `baseAmount`s must add up to the payment total within 0.01.
337
+ 98. **Withholding codes are `GET /withholding-codes`** (`list_withholding_codes`, `clio tax-profiles withholding-codes`): the BIR ATCs with `code`, `rate`, `rateType`, `type` (corp, ind, final, wvat), `description` and `resourceId`; filters `countryCode`, `code` (contains, space included) and `type`; `limit` max 100, `offset` is a page. `GET /withholding-tax-codes` is a different list (MSIC/PSIC industry codes) that no withholding field accepts. A customer's 2307 is a sale batch payment with method `WITHHOLDING_TAX_CERTIFICATE` (`record_withholding_tax_certificate`): PH orgs only, sales only, account = the system "Creditable Withholding Tax" account, one allocation per code by `resourceId`, and each allocation's `baseAmount` is the TAX WITHHELD (the dashboard's "Withholding" column; `amount` is the income); the `baseAmount`s must add up to the payment total within 0.01. The certificate lands on the invoice as `recordedWithholding_ph` (`get_invoice`), not among its payments, so an empty payment list does not mean it failed; `delete_payment` with the record's `resourceId` removes it (verified live 2026-10-07).
338
338
  99. **Duplicate detection fields**. API rejects duplicates with 422: Contacts on `name` (NOT `billingName`), Items on `itemCode`, Accounts on `name`, Tax Profiles on `name`. Agent tools auto-search before creating; if a match is found, the existing entity is returned instead of hitting a 422.
339
339
 
340
340
  ### Tax Profile Scoping
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-cli
3
- version: 9.0.0
3
+ version: 9.0.2
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: 9.0.0
3
+ version: 9.0.2
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: 9.0.0
3
+ version: 9.0.2
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: 9.0.0
3
+ version: 9.0.2
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: 9.0.0
3
+ version: 9.0.2
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: 9.0.0
3
+ version: 9.0.2
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
@@ -808,7 +808,7 @@ Common: name, quantity, unit, unitPrice, discount {rateType: PERCENTAGE|FLAT, ra
808
808
 
809
809
  classifierConfig: set one (\u22651 class by resourceId or entityResourceId) or remove one ({resourceId, deleted: true}); others stay; [] no-op.
810
810
 
811
- Response: { updated, failed: [{resourceId, error, errorCode}] }.`,params:{entity:{type:"string",enum:[...u_],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; only these change"},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,isDestructive:!0,searchHint:"bulk update line item accounts tax profiles",execute:async(e,t)=>{let r=t.entity,n=RG.includes(r),i={};if(n){if(!t.schedulerUpdates)throw new Error("schedulerUpdates is required for scheduler entities (sale-schedules, purchase-schedules, subscription-schedules, journal-schedules)");i.schedulerUpdates=t.schedulerUpdates}else{if(!t.lineItemResourceIds)throw new Error("lineItemResourceIds is required for non-scheduler entities");let o=eit(e,r,t.lineItemResourceIds,t.attributes??{},"LINE_ITEMS");if(o)return o;i.lineItemResourceIds=t.lineItemResourceIds,i.attributes=t.attributes??{}}return EB(e.client,r,i)}},yr("list_nano_classifiers","List nano classifiers (tracking categories). Paginated. Nano classifiers tag line items with structured categories.","nano_classifiers",(e,t,r)=>LG(e,{limit:r,offset:t}),"list nano classifiers tracking categories types"),Ui("get_nano_classifier","Get a nano classifier by resourceId. Returns type and all classes.","nano_classifiers",(e,t)=>Yy(e,t),"get nano classifier tracking category details"),Vt({name:"search_nano_classifiers",description:"Search nano classifiers (tracking categories).",group:"nano_classifiers",fields:kR,defaults:BR,fetcher:PG,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(e,t)=>bB(e.client,{type:t.type,classes:t.classes,printable:t.printable??!0})},{name:"update_nano_classifier",description:"Update a nano classifier. Omitted fields are kept; classes is optional.",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: [{className, resourceId?, deleted?}]. No resourceId adds; resourceId + new className renames; deleted: true removes. Unlisted classes are kept. Plain strings are rejected."},printable:{type:"boolean",description:"Show on printed documents"},format:{type:"string",enum:[...zrt],description:"Non-CUSTOM replaces the classes with that record list."}},required:["resourceId"],group:"nano_classifiers",readOnly:!1,isDestructive:!0,searchHint:"update nano classifier classes and settings",execute:async(e,t)=>{let r=t.resourceId,n=t.format,i={};return t.type&&(i.type=t.type),t.printable!==void 0&&(i.printable=t.printable),n&&(i.format=n),Object.assign(i,await MG(e.client,r,{classes:t.classes,format:n})),IB(e.client,r,i)}},en("delete_nano_classifier","Delete a nano classifier.","nano_classifiers",(e,t)=>UG(e,t),"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(e,t)=>LR(e.client,t.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(e,t)=>NU(e.client,t.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(e,t)=>(await OU(e.client,t.resourceId,t.creditResourceId),{reversed:!0,invoiceId:t.resourceId,creditId:t.creditResourceId})},{name:"record_withholding_tax_certificate",description:`Record a customer's Withholding Tax Certificate (BIR Form 2307, creditable withholding / CWT; PH orgs only) against their invoices and customer credit notes, as one payment batch. accountResourceId must be the "Creditable Withholding Tax" system account. Each transaction's amounts are the tax withheld from it. Async: returns a jobId (search_background_jobs).`,params:{accountResourceId:{type:"string",description:'The "Creditable Withholding Tax" account (search_accounts)'},reference:{type:"string",description:"Recorded on every payment record"},valueDate:ho,transactions:{type:"array",items:{type:"object",required:["businessTransactionResourceId","transactionAmount","paymentAmount"],properties:{businessTransactionResourceId:{type:"string",description:"Invoice or customer credit note resourceId"},businessTransactionType:{type:"string",enum:["SALE","SALE_CREDIT_NOTE"],description:"Default SALE"},transactionAmount:{type:"number",description:"Tax withheld, in the transaction currency"},paymentAmount:{type:"number",description:"Tax withheld, in the account currency"},currency:zs}},description:"Transactions the certificate covers (1-500)"},ph2307Details:{type:"object",required:["periodStartDate","periodEndDate","allocations"],properties:{contactResourceId:{type:"string",description:"The customer who issued the certificate. Required."},certificateNumber:{type:"string"},periodStartDate:{type:"string",description:"YYYY-MM-DD, not in the future"},periodEndDate:{type:"string",description:"YYYY-MM-DD, not in the future"},remarks:{type:"string"},paymentAmountPhp:{type:"number",description:"Total withheld in PHP. Required when the payment is not in PHP."},allocations:{type:"array",items:{type:"object",required:["withholdingCodeResourceId","baseAmount"],properties:{withholdingCodeResourceId:{type:"string",description:"list_withholding_codes resourceId; each code once"},baseAmount:{type:"number",description:"TAX WITHHELD under this code (not the income)"},amount:{type:"number",description:"Income it was withheld from; same sign as baseAmount"}}},description:"One row per code on the certificate. The baseAmounts must add up to the transactions' paymentAmount total (credit notes negative), within 0.01."}},description:"The certificate as printed"},customFields:Ni},required:["accountResourceId","reference","valueDate","transactions","ph2307Details"],group:"payments",readOnly:!1,searchHint:"record BIR 2307 withholding tax certificate CWT creditable withholding received from customer on invoices",isDestructive:!0,execute:async(e,t)=>Art(e.client,{accountResourceId:t.accountResourceId,paymentMethod:"WITHHOLDING_TAX_CERTIFICATE",reference:t.reference,valueDate:t.valueDate,transactions:t.transactions,ph2307Details:t.ph2307Details,...t.customFields!==void 0&&{customFields:t.customFields}})},{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(e,t)=>q0(e.client,t.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(e,t)=>PQ(e.client,t.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(e,t)=>(await MQ(e.client,t.resourceId,t.creditResourceId),{reversed:!0,billId:t.resourceId,creditId:t.creditResourceId})},Ui("get_scheduled_invoice","Get a scheduled (recurring) invoice by resourceId.","schedulers",(e,t)=>zz(e,t),"get scheduled recurring invoice details"),{name:"update_scheduled_invoice",description:"Update a scheduled invoice: 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,isDestructive:!0,searchHint:"update recurring scheduled invoice settings",execute:async(e,t)=>{let r={};return t.repeat&&(r.repeat=t.repeat),t.startDate&&(r.startDate=t.startDate),t.endDate&&(r.endDate=t.endDate),t.status&&(r.status=t.status),t.invoice&&(r.invoice=t.invoice),Jz(e.client,t.resourceId,r)}},en("delete_scheduled_invoice","Delete a scheduled (recurring) invoice.","schedulers",(e,t)=>Gz(e,t),"delete a recurring scheduled invoice"),Ui("get_scheduled_bill","Get a scheduled (recurring) bill by resourceId.","schedulers",(e,t)=>Vz(e,t),"get scheduled recurring bill details"),{name:"update_scheduled_bill",description:"Update a scheduled bill: 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,isDestructive:!0,searchHint:"update recurring scheduled bill settings",execute:async(e,t)=>{let r={};return t.repeat&&(r.repeat=t.repeat),t.startDate&&(r.startDate=t.startDate),t.endDate&&(r.endDate=t.endDate),t.status&&(r.status=t.status),t.bill&&(r.bill=t.bill),Wz(e.client,t.resourceId,r)}},en("delete_scheduled_bill","Delete a scheduled (recurring) bill.","schedulers",(e,t)=>Zz(e,t),"delete a recurring scheduled bill"),Ui("get_scheduled_journal","Get a scheduled (recurring) journal by resourceId.","schedulers",(e,t)=>Kz(e,t),"get scheduled recurring journal details"),{name:"update_scheduled_journal",description:"Update a scheduled journal. Send startDate and the full schedulerEntries every time (422 without). Omitted tax flags reset to off, so a taxed schedule needs taxInclusion.",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"},currency:zs,taxVatApplicable:{type:"boolean",description:"Tax on. Defaults true when an entry has a tax profile"},taxInclusion:{type:"boolean",description:"Prices include tax. Required when taxed"}},required:["resourceId"],group:"schedulers",readOnly:!1,isDestructive:!0,searchHint:"update recurring scheduled journal settings",execute:async(e,t)=>{let r={};return t.repeat&&(r.repeat=t.repeat),t.startDate&&(r.startDate=t.startDate),t.endDate&&(r.endDate=t.endDate),t.status&&(r.status=t.status),t.valueDate&&(r.valueDate=t.valueDate),t.schedulerEntries&&(r.schedulerEntries=t.schedulerEntries),t.reference&&(r.reference=t.reference),t.currency&&(r.currency=t.currency),t.taxVatApplicable!==void 0&&(r.taxVatApplicable=t.taxVatApplicable),t.taxInclusion!==void 0&&(r.taxInclusion=t.taxInclusion),Xz(e.client,t.resourceId,r)}},en("delete_scheduled_journal","Delete a scheduled (recurring) journal.","schedulers",(e,t)=>eJ(e,t),"delete a recurring scheduled journal"),Ui("get_payment","Get a payment record. Takes a PAYMENT resourceId; the ledger resourceId search_cashflow_transactions returns is a different entity and 404s here.","payments",(e,t)=>gJ(e,t),"get payment record details by id",{paramDescription:"Payment resourceId (from invoice/bill paymentRecords)"}),{name:"update_payment",description:"Update a payment record: 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:$f,accountResourceId:FB,transactionFee:{type:"object",description:"Transaction fee. The API requires the full fee object; 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:Fbr},required:["resourceId"],group:"payments",readOnly:!1,isDestructive:!0,searchHint:"update payment amount reference date method",execute:async(e,t)=>{let r={};return t.paymentAmount!==void 0&&(r.paymentAmount=t.paymentAmount),t.reference&&(r.reference=t.reference),t.valueDate&&(r.valueDate=t.valueDate),t.paymentMethod&&(r.paymentMethod=t.paymentMethod),t.accountResourceId&&(r.accountResourceId=t.accountResourceId),t.transactionFee!==void 0&&(r.transactionFee=t.transactionFee),t.adjustment!==void 0&&(r.adjustment=t.adjustment),yJ(e.client,t.resourceId,r)}},en("delete_payment","Delete (void) a payment record. The associated invoice/bill balance is restored.","payments",(e,t)=>EJ(e,t),"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:bpe},required:["entityType"],group:"export_records",readOnly:!0,isConcurrencySafe:!0,searchHint:"list export columns fields for entity type",execute:async(e,t)=>jG(e.client,t.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:bpe,query:Pnt,filter:Mnt,columns:Unt,sort:$nt},required:["entityType"],group:"export_records",readOnly:!0,isConcurrencySafe:!0,searchHint:"preview export records count sample rows filter",execute:async(e,t)=>qG(e.client,{entityType:t.entityType,outputFormat:"XLSX",query:t.query,filter:t.filter,columns:t.columns,sort:t.sort})},{name:"export_records",description:`Raw entity-row XLSX export for one entity type (invoices/bills/contacts/items/journals/bank records/cashflow/fixed assets; 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.
811
+ Response: { updated, failed: [{resourceId, error, errorCode}] }.`,params:{entity:{type:"string",enum:[...u_],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; only these change"},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,isDestructive:!0,searchHint:"bulk update line item accounts tax profiles",execute:async(e,t)=>{let r=t.entity,n=RG.includes(r),i={};if(n){if(!t.schedulerUpdates)throw new Error("schedulerUpdates is required for scheduler entities (sale-schedules, purchase-schedules, subscription-schedules, journal-schedules)");i.schedulerUpdates=t.schedulerUpdates}else{if(!t.lineItemResourceIds)throw new Error("lineItemResourceIds is required for non-scheduler entities");let o=eit(e,r,t.lineItemResourceIds,t.attributes??{},"LINE_ITEMS");if(o)return o;i.lineItemResourceIds=t.lineItemResourceIds,i.attributes=t.attributes??{}}return EB(e.client,r,i)}},yr("list_nano_classifiers","List nano classifiers (tracking categories). Paginated. Nano classifiers tag line items with structured categories.","nano_classifiers",(e,t,r)=>LG(e,{limit:r,offset:t}),"list nano classifiers tracking categories types"),Ui("get_nano_classifier","Get a nano classifier by resourceId. Returns type and all classes.","nano_classifiers",(e,t)=>Yy(e,t),"get nano classifier tracking category details"),Vt({name:"search_nano_classifiers",description:"Search nano classifiers (tracking categories).",group:"nano_classifiers",fields:kR,defaults:BR,fetcher:PG,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(e,t)=>bB(e.client,{type:t.type,classes:t.classes,printable:t.printable??!0})},{name:"update_nano_classifier",description:"Update a nano classifier. Omitted fields are kept; classes is optional.",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: [{className, resourceId?, deleted?}]. No resourceId adds; resourceId + new className renames; deleted: true removes. Unlisted classes are kept. Plain strings are rejected."},printable:{type:"boolean",description:"Show on printed documents"},format:{type:"string",enum:[...zrt],description:"Non-CUSTOM replaces the classes with that record list."}},required:["resourceId"],group:"nano_classifiers",readOnly:!1,isDestructive:!0,searchHint:"update nano classifier classes and settings",execute:async(e,t)=>{let r=t.resourceId,n=t.format,i={};return t.type&&(i.type=t.type),t.printable!==void 0&&(i.printable=t.printable),n&&(i.format=n),Object.assign(i,await MG(e.client,r,{classes:t.classes,format:n})),IB(e.client,r,i)}},en("delete_nano_classifier","Delete a nano classifier.","nano_classifiers",(e,t)=>UG(e,t),"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(e,t)=>LR(e.client,t.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(e,t)=>NU(e.client,t.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(e,t)=>(await OU(e.client,t.resourceId,t.creditResourceId),{reversed:!0,invoiceId:t.resourceId,creditId:t.creditResourceId})},{name:"record_withholding_tax_certificate",description:`Record a customer's Withholding Tax Certificate (BIR Form 2307, creditable withholding / CWT; PH orgs only) against their invoices and customer credit notes, as one payment batch. accountResourceId must be the "Creditable Withholding Tax" system account. Each transaction's amounts are the tax withheld from it. Async: returns a jobId (search_background_jobs). Read it back on get_invoice as recordedWithholding_ph; it is not in the invoice's payment list. delete_payment with that record's resourceId removes it.`,params:{accountResourceId:{type:"string",description:'The "Creditable Withholding Tax" account (search_accounts)'},reference:{type:"string",description:"Recorded on every payment record"},valueDate:ho,transactions:{type:"array",items:{type:"object",required:["businessTransactionResourceId","transactionAmount","paymentAmount"],properties:{businessTransactionResourceId:{type:"string",description:"Invoice or customer credit note resourceId"},businessTransactionType:{type:"string",enum:["SALE","SALE_CREDIT_NOTE"],description:"Default SALE"},transactionAmount:{type:"number",description:"Tax withheld, in the transaction currency"},paymentAmount:{type:"number",description:"Tax withheld, in the account currency"},currency:zs}},description:"Transactions the certificate covers (1-500)"},ph2307Details:{type:"object",required:["periodStartDate","periodEndDate","allocations"],properties:{contactResourceId:{type:"string",description:"The customer who issued the certificate. Required."},certificateNumber:{type:"string"},periodStartDate:{type:"string",description:"YYYY-MM-DD, not in the future"},periodEndDate:{type:"string",description:"YYYY-MM-DD, not in the future"},remarks:{type:"string"},paymentAmountPhp:{type:"number",description:"Total withheld in PHP. Required when the payment is not in PHP."},allocations:{type:"array",items:{type:"object",required:["withholdingCodeResourceId","baseAmount"],properties:{withholdingCodeResourceId:{type:"string",description:"list_withholding_codes resourceId; each code once"},baseAmount:{type:"number",description:"TAX WITHHELD under this code (not the income)"},amount:{type:"number",description:"Income it was withheld from; same sign as baseAmount"}}},description:"One row per code on the certificate. The baseAmounts must add up to the transactions' paymentAmount total (credit notes negative), within 0.01."}},description:"The certificate as printed"},customFields:Ni},required:["accountResourceId","reference","valueDate","transactions","ph2307Details"],group:"payments",readOnly:!1,searchHint:"record BIR 2307 withholding tax certificate CWT creditable withholding received from customer on invoices",isDestructive:!0,execute:async(e,t)=>Art(e.client,{accountResourceId:t.accountResourceId,paymentMethod:"WITHHOLDING_TAX_CERTIFICATE",reference:t.reference,valueDate:t.valueDate,transactions:t.transactions,ph2307Details:t.ph2307Details,...t.customFields!==void 0&&{customFields:t.customFields}})},{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(e,t)=>q0(e.client,t.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(e,t)=>PQ(e.client,t.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(e,t)=>(await MQ(e.client,t.resourceId,t.creditResourceId),{reversed:!0,billId:t.resourceId,creditId:t.creditResourceId})},Ui("get_scheduled_invoice","Get a scheduled (recurring) invoice by resourceId.","schedulers",(e,t)=>zz(e,t),"get scheduled recurring invoice details"),{name:"update_scheduled_invoice",description:"Update a scheduled invoice: 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,isDestructive:!0,searchHint:"update recurring scheduled invoice settings",execute:async(e,t)=>{let r={};return t.repeat&&(r.repeat=t.repeat),t.startDate&&(r.startDate=t.startDate),t.endDate&&(r.endDate=t.endDate),t.status&&(r.status=t.status),t.invoice&&(r.invoice=t.invoice),Jz(e.client,t.resourceId,r)}},en("delete_scheduled_invoice","Delete a scheduled (recurring) invoice.","schedulers",(e,t)=>Gz(e,t),"delete a recurring scheduled invoice"),Ui("get_scheduled_bill","Get a scheduled (recurring) bill by resourceId.","schedulers",(e,t)=>Vz(e,t),"get scheduled recurring bill details"),{name:"update_scheduled_bill",description:"Update a scheduled bill: 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,isDestructive:!0,searchHint:"update recurring scheduled bill settings",execute:async(e,t)=>{let r={};return t.repeat&&(r.repeat=t.repeat),t.startDate&&(r.startDate=t.startDate),t.endDate&&(r.endDate=t.endDate),t.status&&(r.status=t.status),t.bill&&(r.bill=t.bill),Wz(e.client,t.resourceId,r)}},en("delete_scheduled_bill","Delete a scheduled (recurring) bill.","schedulers",(e,t)=>Zz(e,t),"delete a recurring scheduled bill"),Ui("get_scheduled_journal","Get a scheduled (recurring) journal by resourceId.","schedulers",(e,t)=>Kz(e,t),"get scheduled recurring journal details"),{name:"update_scheduled_journal",description:"Update a scheduled journal. Send startDate and the full schedulerEntries every time (422 without). Omitted tax flags reset to off, so a taxed schedule needs taxInclusion.",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"},currency:zs,taxVatApplicable:{type:"boolean",description:"Tax on. Defaults true when an entry has a tax profile"},taxInclusion:{type:"boolean",description:"Prices include tax. Required when taxed"}},required:["resourceId"],group:"schedulers",readOnly:!1,isDestructive:!0,searchHint:"update recurring scheduled journal settings",execute:async(e,t)=>{let r={};return t.repeat&&(r.repeat=t.repeat),t.startDate&&(r.startDate=t.startDate),t.endDate&&(r.endDate=t.endDate),t.status&&(r.status=t.status),t.valueDate&&(r.valueDate=t.valueDate),t.schedulerEntries&&(r.schedulerEntries=t.schedulerEntries),t.reference&&(r.reference=t.reference),t.currency&&(r.currency=t.currency),t.taxVatApplicable!==void 0&&(r.taxVatApplicable=t.taxVatApplicable),t.taxInclusion!==void 0&&(r.taxInclusion=t.taxInclusion),Xz(e.client,t.resourceId,r)}},en("delete_scheduled_journal","Delete a scheduled (recurring) journal.","schedulers",(e,t)=>eJ(e,t),"delete a recurring scheduled journal"),Ui("get_payment","Get a payment record. Takes a PAYMENT resourceId; the ledger resourceId search_cashflow_transactions returns is a different entity and 404s here.","payments",(e,t)=>gJ(e,t),"get payment record details by id",{paramDescription:"Payment resourceId (from invoice/bill paymentRecords)"}),{name:"update_payment",description:"Update a payment record: 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:$f,accountResourceId:FB,transactionFee:{type:"object",description:"Transaction fee. The API requires the full fee object; 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:Fbr},required:["resourceId"],group:"payments",readOnly:!1,isDestructive:!0,searchHint:"update payment amount reference date method",execute:async(e,t)=>{let r={};return t.paymentAmount!==void 0&&(r.paymentAmount=t.paymentAmount),t.reference&&(r.reference=t.reference),t.valueDate&&(r.valueDate=t.valueDate),t.paymentMethod&&(r.paymentMethod=t.paymentMethod),t.accountResourceId&&(r.accountResourceId=t.accountResourceId),t.transactionFee!==void 0&&(r.transactionFee=t.transactionFee),t.adjustment!==void 0&&(r.adjustment=t.adjustment),yJ(e.client,t.resourceId,r)}},en("delete_payment","Delete (void) a payment record. The associated invoice/bill balance is restored.","payments",(e,t)=>EJ(e,t),"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:bpe},required:["entityType"],group:"export_records",readOnly:!0,isConcurrencySafe:!0,searchHint:"list export columns fields for entity type",execute:async(e,t)=>jG(e.client,t.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:bpe,query:Pnt,filter:Mnt,columns:Unt,sort:$nt},required:["entityType"],group:"export_records",readOnly:!0,isConcurrencySafe:!0,searchHint:"preview export records count sample rows filter",execute:async(e,t)=>qG(e.client,{entityType:t.entityType,outputFormat:"XLSX",query:t.query,filter:t.filter,columns:t.columns,sort:t.sort})},{name:"export_records",description:`Raw entity-row XLSX export for one entity type (invoices/bills/contacts/items/journals/bank records/cashflow/fixed assets; 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.
812
812
 
813
813
  DO NOT use this for analytical / audit reports, financial statements, aging, summary reports, or statement-of-account; those go through download_export.`,params:{entityType:bpe,query:Pnt,filter:Mnt,columns:Unt,sort:$nt},required:["entityType"],group:"export_records",readOnly:!0,isConcurrencySafe:!0,searchHint:"export records download xlsx file url",execute:async(e,t)=>$G(e.client,{entityType:t.entityType,outputFormat:"XLSX",query:t.query,filter:t.filter,columns:t.columns,sort:t.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; they differ.",group:"background_jobs",fields:qD,defaults:jD,fetcher:CB,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. ${ql} Per-row failures in errorDetails (NOT failedRows; that's the sync pattern). On PARTIAL_SUCCESS: succeeded rows are committed; re-submit only failed rowIndex entries.
814
814
 
@@ -822,7 +822,7 @@ ASYNC: returns jobId \u2192 poll search_background_jobs(filter:{resourceId:{eq:j
822
822
 
823
823
  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.
824
824
 
825
- 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"},registrationType:{type:"string",enum:["NEW","TRANSFER"],description:"NEW = newly acquired, TRANSFER = inherited; 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); 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:[...jy],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:["reference"]}}},required:["fixedAssets"],group:"fixed_assets",readOnly:!1,isDestructive:!0,searchHint:"bulk fixed assets ppe register upsert import migrate",execute:async(e,t)=>{Ut(t.fixedAssets,"fixedAssets",500,"fixed assets");let r=t.fixedAssets;return ORe(r,["purchaseDate","depreciationStartDate"]),iG(e.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. ${ql} 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"},journalReference:{type:"string",description:"Journal reference text"},journalAccountResourceId:{type:"string",description:"Offsetting account UUID (revenue for cash-in, expense for cash-out)"},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:["bankStatementEntryResourceId","journalAccountResourceId","journalReference"]}}},required:["bankAccountResourceId","journalsForReconciliation"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"bulk reconcile bank statement journals match",execute:async(e,t)=>(Ut(t.journalsForReconciliation,"journalsForReconciliation",500,"journals"),iV(e.client,t))},{name:"apply_bank_rule",description:"Apply a pre-configured bank rule (action shortcut) to a batch of bank statement entries (max 500). Async: 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"},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,isDestructive:!0,searchHint:"bank rule apply action shortcut bulk reconcile",execute:async(e,t)=>(Ut(t.businessTransactionResourceIds,"businessTransactionResourceIds",500,"entries"),oV(e.client,t))},{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: returns the reconciled entry status. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID (used to look up the entry)"},reference:{type:"string",description:"Reference for the cash entry"},accountResourceId:{type:"string",description:"Offsetting account UUID (revenue for cash-in, expense for cash-out)"},amount:{type:"number",description:"Amount in source currency; defaults to and must EQUAL the entry amount; a partial allocation 422s (Total journal entries amount mismatch). Split an entry via reconcile_cash_journal instead."},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,isDestructive:!0,searchHint:"reconcile bank entry direct cash in out single line",execute:async(e,t)=>sV(e.client,t)},{name:"reconcile_cash_journal",description:"Reconcile a bank statement entry with a multi-line cashflow journal (multiple cash splits, max 200 lines). Sync: returns the reconciled entry status. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID"},reference:{type:"string",description:"Journal reference"},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"},amount:{type:"number",description:"Amount in source currency (>0)"},description:{type:"string"},taxProfileResourceId:{type:"string"}},required:["accountResourceId","amount"]}},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,isDestructive:!0,searchHint:"reconcile bank entry multi line cash journal splits",execute:async(e,t)=>(Ut(t.journalEntries,"journalEntries",200,"entries"),aV(e.client,t))},{name:"reconcile_manual_journal",description:'\u26A0\uFE0F CALLER PROVIDES ONLY THE OFFSET LEG(S); 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: returns the reconciled entry status. valueDate prefills from bank entry if omitted. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID"},status:{type:"string",enum:["DRAFT","ACTIVE"],description:"Journal status"},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"},type:{type:"string",enum:["DEBIT","CREDIT"]},amount:{type:"number",description:"Amount, required"},description:{type:"string"},taxProfileResourceId:{type:"string"},exchangeRate:{type:"number",description:"Line rate, account currency to base; applied as sent."}},required:["accountResourceId","type"]}},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,isDestructive:!0,searchHint:"reconcile bank entry manual journal double entry",execute:async(e,t)=>(Ut(t.journalEntries,"journalEntries",200,"entries"),cV(e.client,t))},{name:"reconcile_cash_transfer",description:"Reconcile a bank statement entry with an inter-account transfer. Sync: returns the reconciled entry status. amount is required only when the counterparty account is in a non-functional currency. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID"},accountResourceId:{type:"string",description:"Counterparty cash account UUID"},reference:{type:"string",description:"Transfer reference"},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,isDestructive:!0,searchHint:"reconcile bank entry transfer between accounts",execute:async(e,t)=>lV(e.client,t)},{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, 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; the actual gate is direction, not entry type. Sync: returns the reconciled entry status. valueDate / dueDate / payment amount prefill from the bank entry if omitted. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID"},invoiceDetails:Jnt("Invoice","Customer","Revenue")},required:["bankStatementEntryResourceId","bankAccountResourceId","invoiceDetails"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"reconcile bank entry invoice receipt AR sale",execute:async(e,t)=>(ipe(t.invoiceDetails,"invoiceDetails"),uV(e.client,t))},{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, 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; the actual gate is direction, not entry type. Sync: returns the reconciled entry status. valueDate / dueDate / payment amount prefill from the bank entry if omitted. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID"},billDetails:Jnt("Bill","Supplier","Expense")},required:["bankStatementEntryResourceId","bankAccountResourceId","billDetails"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"reconcile bank entry bill receipt AP purchase",execute:async(e,t)=>(ipe(t.billDetails,"billDetails"),dV(e.client,t))},{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[]: this CREATES the payment AND reconciles in one call; no pay_bill / pay_invoice first. FX is resolved server-side; pass NO rate for the common case (only supply paymentAmount + currencySettings for the rare bill-currency \u2260 bank-currency case). Sync: 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"},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)"},transactionAmount:{type:"number",description:"Payment amount in the BT currency (>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: 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"}},required:["sourceCurrencyCode"]}},required:["cashflowTransactionResourceId","transactionAmount"]}},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; 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."}},required:["amount"]}},bankAccountJournalEntryRateFunctionalToSource:{type:"number",description:"Required when the bank account is in a non-functional currency."}}}},required:["bankStatementEntryResourceId"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"match bank entry to existing open bill invoice payment reconcile with payments pay outstanding",execute:async(e,t)=>(lnt(t),fV(e.client,t))},{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[] }: 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"},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"},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:["bankStatementEntryResourceId","workflowType"]}}},required:["bankAccountResourceId","entries"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"bulk accept magic match suggestions reconcile many bank entries to existing",execute:async(e,t)=>(Ut(t.entries,"entries",500,"entries"),hV(e.client,t))},{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); 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: returns the reconciled entry status. On failure (stale/invalid payload), fall back to reconcile_with_payments; do NOT retry the same opaque payload.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},learnedPredictionResourceId:{type:"string",description:"Learned-prediction UUID from the suggestion"},predictedPayload:{type:"string",description:"Opaque JSON payload from the suggestion; required, passed verbatim"},predictedPayloadSchemaVersion:{type:"string",description:"Schema version from the suggestion"},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,isDestructive:!0,searchHint:"reconcile bank entry learned prediction ML cash in out accept suggestion",execute:async(e,t)=>pV(e.client,t)},{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); 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(e,t)=>{Ut(t.bankStatementEntryResourceIds,"bankStatementEntryResourceIds",500,"bank entries");let r=[...new Set(t.bankStatementEntryResourceIds)];return mV(e.client,{...t,bankStatementEntryResourceIds:r})}},{name:"validate_drafts",description:`BULK validate up to 500 draft business transactions in ONE call, mixing any btType. SYNC: returns per-item errors + display data; no state change. Run before convert_drafts_to_active.
825
+ 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"},registrationType:{type:"string",enum:["NEW","TRANSFER"],description:"NEW = newly acquired, TRANSFER = inherited; 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); 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:[...jy],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:["reference"]}}},required:["fixedAssets"],group:"fixed_assets",readOnly:!1,isDestructive:!0,searchHint:"bulk fixed assets ppe register upsert import migrate",execute:async(e,t)=>{Ut(t.fixedAssets,"fixedAssets",500,"fixed assets");let r=t.fixedAssets;return ORe(r,["purchaseDate","depreciationStartDate"]),iG(e.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. ${ql} 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"},journalReference:{type:"string",description:"Journal reference text"},journalAccountResourceId:{type:"string",description:"Offsetting account UUID (revenue for cash-in, expense for cash-out)"},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:["bankStatementEntryResourceId","journalAccountResourceId","journalReference"]}}},required:["bankAccountResourceId","journalsForReconciliation"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"bulk reconcile bank statement journals match",execute:async(e,t)=>(Ut(t.journalsForReconciliation,"journalsForReconciliation",500,"journals"),iV(e.client,t))},{name:"apply_bank_rule",description:"Reconcile bank statement entries (max 500) with one saved bank rule: each entry gets the cash-in or cash-out entry the rule defines (its accounts and amount split). Async: returns a jobId; poll search_background_jobs filtered by resourceId.",params:{actionShortcutResourceId:{type:"string",description:"Saved bank rule resourceId"},businessTransactionResourceIds:{type:"array",description:"Bank statement entry resourceIds (max 500).",items:{type:"string"}}},required:["actionShortcutResourceId","businessTransactionResourceIds"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"bank rule apply action shortcut bulk reconcile",execute:async(e,t)=>(Ut(t.businessTransactionResourceIds,"businessTransactionResourceIds",500,"entries"),oV(e.client,t))},{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: returns the reconciled entry status. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID (used to look up the entry)"},reference:{type:"string",description:"Reference for the cash entry"},accountResourceId:{type:"string",description:"Offsetting account UUID (revenue for cash-in, expense for cash-out)"},amount:{type:"number",description:"Amount in source currency; defaults to and must EQUAL the entry amount; a partial allocation 422s (Total journal entries amount mismatch). Split an entry via reconcile_cash_journal instead."},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,isDestructive:!0,searchHint:"reconcile bank entry direct cash in out single line",execute:async(e,t)=>sV(e.client,t)},{name:"reconcile_cash_journal",description:"Reconcile a bank statement entry with a multi-line cashflow journal (multiple cash splits, max 200 lines). Sync: returns the reconciled entry status. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID"},reference:{type:"string",description:"Journal reference"},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"},amount:{type:"number",description:"Amount in source currency (>0)"},description:{type:"string"},taxProfileResourceId:{type:"string"}},required:["accountResourceId","amount"]}},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,isDestructive:!0,searchHint:"reconcile bank entry multi line cash journal splits",execute:async(e,t)=>(Ut(t.journalEntries,"journalEntries",200,"entries"),aV(e.client,t))},{name:"reconcile_manual_journal",description:'\u26A0\uFE0F CALLER PROVIDES ONLY THE OFFSET LEG(S); 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: returns the reconciled entry status. valueDate prefills from bank entry if omitted. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID"},status:{type:"string",enum:["DRAFT","ACTIVE"],description:"Journal status"},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"},type:{type:"string",enum:["DEBIT","CREDIT"]},amount:{type:"number",description:"Amount, required"},description:{type:"string"},taxProfileResourceId:{type:"string"},exchangeRate:{type:"number",description:"Line rate, account currency to base; applied as sent."}},required:["accountResourceId","type"]}},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,isDestructive:!0,searchHint:"reconcile bank entry manual journal double entry",execute:async(e,t)=>(Ut(t.journalEntries,"journalEntries",200,"entries"),cV(e.client,t))},{name:"reconcile_cash_transfer",description:"Reconcile a bank statement entry with an inter-account transfer. Sync: returns the reconciled entry status. amount is required only when the counterparty account is in a non-functional currency. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID"},accountResourceId:{type:"string",description:"Counterparty cash account UUID"},reference:{type:"string",description:"Transfer reference"},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,isDestructive:!0,searchHint:"reconcile bank entry transfer between accounts",execute:async(e,t)=>lV(e.client,t)},{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, 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; the actual gate is direction, not entry type. Sync: returns the reconciled entry status. valueDate / dueDate / payment amount prefill from the bank entry if omitted. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID"},invoiceDetails:Jnt("Invoice","Customer","Revenue")},required:["bankStatementEntryResourceId","bankAccountResourceId","invoiceDetails"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"reconcile bank entry invoice receipt AR sale",execute:async(e,t)=>(ipe(t.invoiceDetails,"invoiceDetails"),uV(e.client,t))},{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, 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; the actual gate is direction, not entry type. Sync: returns the reconciled entry status. valueDate / dueDate / payment amount prefill from the bank entry if omitted. Retrying a RECONCILED entry 422s (Invalid bank statement entry status); it does not duplicate.',params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},bankAccountResourceId:{type:"string",description:"Bank account UUID"},billDetails:Jnt("Bill","Supplier","Expense")},required:["bankStatementEntryResourceId","bankAccountResourceId","billDetails"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"reconcile bank entry bill receipt AP purchase",execute:async(e,t)=>(ipe(t.billDetails,"billDetails"),dV(e.client,t))},{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[]: this CREATES the payment AND reconciles in one call; no pay_bill / pay_invoice first. FX is resolved server-side; pass NO rate for the common case (only supply paymentAmount + currencySettings for the rare bill-currency \u2260 bank-currency case). Sync: 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"},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)"},transactionAmount:{type:"number",description:"Payment amount in the BT currency (>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: 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"}},required:["sourceCurrencyCode"]}},required:["cashflowTransactionResourceId","transactionAmount"]}},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; 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."}},required:["amount"]}},bankAccountJournalEntryRateFunctionalToSource:{type:"number",description:"Required when the bank account is in a non-functional currency."}}}},required:["bankStatementEntryResourceId"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"match bank entry to existing open bill invoice payment reconcile with payments pay outstanding",execute:async(e,t)=>(lnt(t),fV(e.client,t))},{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[] }: 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"},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"},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:["bankStatementEntryResourceId","workflowType"]}}},required:["bankAccountResourceId","entries"],group:"reconciliations",readOnly:!1,isDestructive:!0,searchHint:"bulk accept magic match suggestions reconcile many bank entries to existing",execute:async(e,t)=>(Ut(t.entries,"entries",500,"entries"),hV(e.client,t))},{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); 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: returns the reconciled entry status. On failure (stale/invalid payload), fall back to reconcile_with_payments; do NOT retry the same opaque payload.",params:{bankStatementEntryResourceId:{type:"string",description:"Bank entry UUID"},learnedPredictionResourceId:{type:"string",description:"Learned-prediction UUID from the suggestion"},predictedPayload:{type:"string",description:"Opaque JSON payload from the suggestion; required, passed verbatim"},predictedPayloadSchemaVersion:{type:"string",description:"Schema version from the suggestion"},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,isDestructive:!0,searchHint:"reconcile bank entry learned prediction ML cash in out accept suggestion",execute:async(e,t)=>pV(e.client,t)},{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); 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(e,t)=>{Ut(t.bankStatementEntryResourceIds,"bankStatementEntryResourceIds",500,"bank entries");let r=[...new Set(t.bankStatementEntryResourceIds)];return mV(e.client,{...t,bankStatementEntryResourceIds:r})}},{name:"validate_drafts",description:`BULK validate up to 500 draft business transactions in ONE call, mixing any btType. SYNC: returns per-item errors + display data; no state change. Run before convert_drafts_to_active.
826
826
 
827
827
  btType enum: SALE = invoice, PURCHASE = bill, SALE_CREDIT_NOTE = customer CN, PURCHASE_CREDIT_NOTE = supplier CN. Journals NOT in this enum.
828
828
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jaz-clio",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "description": "Fastest ledger for agents. Jaz accounting CLI and MCP server: invoicing, bills, payments, quotes & orders, bank reconciliation, fixed assets, inventory, expense claims, tax, reports, and period close.",
5
5
  "type": "module",
6
6
  "bin": {