jaz-clio 5.46.8 → 5.46.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/skills/api/SKILL.md +3 -3
- package/assets/skills/cli/SKILL.md +1 -1
- package/assets/skills/conversion/SKILL.md +1 -1
- package/assets/skills/jaz-kit/SKILL.md +1 -1
- package/assets/skills/jaz-pseudo-sql/SKILL.md +1 -1
- package/assets/skills/jobs/SKILL.md +1 -1
- package/assets/skills/transaction-recipes/SKILL.md +1 -1
- package/cli.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jaz-api
|
|
3
|
-
version: 5.46.
|
|
3
|
+
version: 5.46.9
|
|
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
|
|
@@ -388,9 +388,9 @@ Bills, invoices, and credit notes share identical mandatory field specs. Adding
|
|
|
388
388
|
|
|
389
389
|
### Bulk Upserts (transactions)
|
|
390
390
|
|
|
391
|
-
118. **8 bulk-upsert endpoints for transactions** — `POST /api/v1/{invoices,bills,customer-credit-notes,supplier-credit-notes,journals,fixed-assets}/bulk-upsert` plus line-item variants for invoices and bills (`/invoices/line-items/bulk-upsert`, `/bills/line-items/bulk-upsert`). Max **500 rows per call**. All async — return `{data: {jobId, subscriptionFBPath, status, totalRecords}}`. Poll `search_background_jobs` with `filter: {resourceId: {eq: jobId}}` until terminal status. **Natural keys**: invoices = `invoiceReference`, bills = `billReference`, credit notes = `creditNoteReference`, **journals = `journalReference` (NOT `reference` — asymmetric vs other entities)**, fixed assets = `reference`. **`currencyCode` is REQUIRED** on every transaction row (invoices, bills, CCN, SCN) — missing it returns errorCode `IMPORT_CURRENCY_REQUIRED`. **Journals are the exception**: the bulk journal row has no currency field and any `currencyCode` sent is discarded, and the public request model exposes no per-leg currency field either. **Journals legs use `journalEntries[]`** (NOT `entries[]` — different from `journals create` which uses entries), and **a journal leg is `organizationAccountResourceId` + exactly one of `debitAmount`/`creditAmount`** — NOT the `accountResourceId`+`amount`+`type` shape `journals create` takes, and omit the unused side rather than sending 0.
|
|
391
|
+
118. **8 bulk-upsert endpoints for transactions** — `POST /api/v1/{invoices,bills,customer-credit-notes,supplier-credit-notes,journals,fixed-assets}/bulk-upsert` plus line-item variants for invoices and bills (`/invoices/line-items/bulk-upsert`, `/bills/line-items/bulk-upsert`). Max **500 rows per call**. All async — return `{data: {jobId, subscriptionFBPath, status, totalRecords}}`. Poll `search_background_jobs` with `filter: {resourceId: {eq: jobId}}` until terminal status. **Natural keys**: invoices = `invoiceReference`, bills = `billReference`, credit notes = `creditNoteReference`, **journals = `journalReference` (NOT `reference` — asymmetric vs other entities)**, fixed assets = `reference`. **`currencyCode` is REQUIRED** on every transaction row (invoices, bills, CCN, SCN) — missing it returns errorCode `IMPORT_CURRENCY_REQUIRED`. **Journals are the exception**: the bulk journal row has no currency field and any `currencyCode` sent is discarded, and the public request model exposes no per-leg currency field either. **Journals legs use `journalEntries[]`** (NOT `entries[]` — different from `journals create` which uses entries), and **a journal leg is `organizationAccountResourceId` + exactly one of `debitAmount`/`creditAmount`** — NOT the `accountResourceId`+`amount`+`type` shape `journals create` takes, and omit the unused side rather than sending 0. **On the six TRANSACTION bulk tools the natural key is the only upsert key — `resourceId` does not override it.** Probed live 2026-09-02 on invoices, bills, customer credit notes and invoice line items: sending an existing record's `resourceId` together with a DIFFERENT natural key left the original untouched and created a second record. (Supplier credit notes and bill line items were not probed; they were changed on their twin's evidence plus spec absence.) `resourceId` has been removed from all six. It remains valid, and spec-backed, on `bulk_upsert_contacts`, `bulk_upsert_items` and `bulk_upsert_chart_of_accounts` — see rule 137. Journals upsert by `journalReference` only. **Currency and due date split by shape, so pick the tool by what you need:** the FLAT pair (`bulk_upsert_invoices` / `bulk_upsert_bills`) IGNORES both — a row sent `currencyCode: EUR` against a USD-base org stored USD, omitting `currencyCode` entirely still succeeds, and `dueDate` comes back equal to `valueDate` with `terms: 0`. The NESTED pair (`bulk_upsert_invoice_line_items` / `bulk_upsert_bill_line_items`) honours `dueDate` (it is in fact REQUIRED there — omitting it fails the row with `DUE_DATE_REQUIRED`) and requires `currencyCode`. **So a bulk import that needs a real due date or a non-base currency must use the NESTED tools.** `tags` is on no transaction bulk wire definition and has been removed from these tools. `rowIndex` is optional caller-supplied for error reporting — on journals it sits on the leg, not the row.
|
|
392
392
|
|
|
393
|
-
118b. **Credit-note rows carry two extra requirements** (customer and supplier alike, and nothing here applies to journals). The tools speak `currencyCode`, but these two contracts — like the two line-item ones — name the wire field `transactionCurrency`; the client renames it for you via `toWireCurrencyRow`. They also require **`transactionRateType`** (`ORGANIZATION_RATE` | `TRANSACTION_RATE`): omit it and the row fails `IMPORT_TRANSACTION_RATE_TYPE_INVALID` even when the currency is right. `TRANSACTION_RATE` reads `rateFunctionToSource` (1 base unit = N transaction currency); `ORGANIZATION_RATE` uses the org rate. Neither endpoint carries `tags` on its wire definition, so do not report tags "applied" through this route. (The two line-item endpoints were probed the same way on 2026-09-02 and do NOT need `transactionRateType
|
|
393
|
+
118b. **Credit-note rows carry two extra requirements** (customer and supplier alike, and nothing here applies to journals). The tools speak `currencyCode`, but these two contracts — like the two line-item ones — name the wire field `transactionCurrency`; the client renames it for you via `toWireCurrencyRow`. They also require **`transactionRateType`** (`ORGANIZATION_RATE` | `TRANSACTION_RATE`): omit it and the row fails `IMPORT_TRANSACTION_RATE_TYPE_INVALID` even when the currency is right. `TRANSACTION_RATE` reads `rateFunctionToSource` (1 base unit = N transaction currency); `ORGANIZATION_RATE` uses the org rate. Neither endpoint carries `tags` on its wire definition, so do not report tags "applied" through this route. (The two line-item endpoints were probed the same way on 2026-09-02 and do NOT need `transactionRateType`.)
|
|
394
394
|
|
|
395
395
|
119. **PARTIAL_SUCCESS handling** — When `search_background_jobs` returns `PARTIAL_SUCCESS` for a bulk-upsert job, the per-row failures are in `data[0].errorDetails` on the SAME response (an array of per-row error objects). Top-level counts (`processedCount`, `failedCount`, `totalRecords`) tell you *how many* failed; `errorDetails` tells you *which rows and why*. Don't pretend the operation succeeded — surface the failed rows to the user. The rule of thumb: poll with `search_background_jobs` filtered by `resourceId: { eq: jobId }`, then read `data[0].errorDetails` for terminal states.
|
|
396
396
|
|
package/cli.mjs
CHANGED
|
@@ -861,9 +861,9 @@ DO NOT use this for analytical / audit reports, financial statements, aging, sum
|
|
|
861
861
|
|
|
862
862
|
Whole-batch 422 (validate before submit): (1) each contact must have at least one of customer:true OR supplier:true (after defaults + backfill); (2) emailList unique within a contact (case-insensitive after trim); (3) paymentTerms.value must be positive integer when paymentTerms.name != "CUSTOM"; (4) no duplicate names within batch (after whitespace+case normalize); (5) billingAddress / shippingAddress: addressLine1 required when address object provided.`,params:{contacts:{type:"array",description:"Array of contacts to create or update (max 500)",items:{type:"object",properties:{resourceId:{type:"string",description:"Contact resourceId (omit for create, provide UUID for update)"},billingName:{type:"string",description:"Billing name (required for create)"},name:{type:"string",description:"Display name (defaults to billingName)"},emails:{type:"array",items:{type:"string"},description:"Email addresses"},customer:{type:"boolean",description:"Mark as customer"},supplier:{type:"boolean",description:"Mark as supplier"},taxId:{type:"string",description:"Tax ID / GST registration number"},taxIdType:{type:"string",description:"Tax ID type (e.g., GST, VAT)"},registrationNumber:{type:"string",description:"Business registration number"},currencyCode:{type:"string",description:"Default currency code (e.g., SGD)"},status:{type:"string",enum:["ACTIVE","INACTIVE"],description:"Contact status"},paymentTerms:{type:"number",description:"Payment terms in days (e.g., 30 for Net 30)"},notes:{type:"string",description:"Internal notes"},billingAddress:{type:"object",description:"Billing address",properties:{address:{type:"string"},city:{type:"string"},state:{type:"string"},postalCode:{type:"string"},country:{type:"string"}}},shippingAddress:{type:"object",description:"Shipping address",properties:{address:{type:"string"},city:{type:"string"},state:{type:"string"},postalCode:{type:"string"},country:{type:"string"}}}}}}},required:["contacts"],group:"contacts",readOnly:!1,searchHint:"bulk create update contacts upsert",execute:async(t,e)=>(Un(e.contacts,"contacts"),uF(t.client,e.contacts))},{name:"bulk_upsert_invoices",description:`Max 500 invoices per call. FLAT shape \u2014 ONE line per invoice via itemDescription + totalAmount + invoiceAccountResourceId at row level. For multi-line, use bulk_upsert_invoice_line_items (nested lineItems[]).
|
|
863
863
|
|
|
864
|
-
Natural key: invoiceReference (rows sharing one within a batch are MERGED \u2014 last wins). resourceId
|
|
864
|
+
Natural key: invoiceReference (rows sharing one within a batch are MERGED \u2014 last wins). resourceId does NOT update by id here \u2014 it is ignored and you get a duplicate.
|
|
865
865
|
|
|
866
|
-
ASYNC: returns jobId \u2192 poll search_background_jobs(filter:{resourceId:{eq:jobId}}); PARTIAL_SUCCESS \u2192 data[0].errorDetails. Dates ISO 8601 (YYYY-MM-DD); dateFormat field removed.`,params:{invoices:{type:"array",description:"Array of invoices to create or update (max 500). Each row needs at least: invoiceReference, contactResourceId, valueDate, totalAmount, invoiceAccountResourceId.",items:{type:"object",properties:{rowIndex:{type:"string",description:"Optional caller-supplied row index for error reporting"},resourceId:{type:"string",description:"Invoice resourceId (UUID) \u2014 provide to update by ID"},invoiceReference:{type:"string",description:"Natural key (e.g., INV-2025-001) \u2014 required"},contactResourceId:{type:"string",description:"Customer contact UUID \u2014 required"},valueDate:{type:"string",description:"Invoice date YYYY-MM-DD \u2014 required"},dueDate:{type:"string",description:"Due date YYYY-MM-DD"},totalAmount:{type:"number",description:"Total amount (BigDecimal)"},currencyCode:{type:"string",description:"Currency (e.g., SGD)"},invoiceAccountResourceId:{type:"string",description:"Revenue account UUID"},itemDescription:{type:"string",description:"Single-line item description"},internalNotes:{type:"string",description:"Internal notes"},tags:{type:"array",items:{type:"string"},description:"Tag resourceIds"}}}}},required:["invoices"],group:"invoices",readOnly:!1,searchHint:"bulk create update invoices upsert import migrate",execute:async(t,e)=>{Un(e.invoices,"invoices");let r=e.invoices;return dl(r,["valueDate","dueDate"]),KP(t.client,r)}},{name:"bulk_upsert_invoice_line_items",description:`Nested line items per invoice (max 500 invoices per call). Each row carries lineItems[] under its parent invoice (scoped by invoiceReference). ${Vl} Dates are ISO 8601 only.`,params:{invoices:{type:"array",description:"Array of invoices, each with nested lineItems[].",items:{type:"object",required:["invoiceReference","currencyCode"],properties:{rowIndex:{type:"string"},resourceId:{type:"string",description:"Invoice resourceId \u2014 provide to update by ID"},invoiceReference:{type:"string",description:"Natural key \u2014 required"},contactResourceId:{type:"string",description:"Customer UUID \u2014 required"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},dueDate:{type:"string",description:"YYYY-MM-DD"},currencyCode:{type:"string",description:"ISO 4217 (SGD) \u2014 required"},internalNotes:{type:"string"},lineItems:{type:"array",description:"Line items belonging to this invoice",items:{type:"object",properties:{itemDescription:{type:"string",description:"Line description \u2014 required"},quantity:{type:"number"},unit:{type:"string",description:"Unit of measure (pcs, kg, etc.)"},unitPrice:{type:"number"},accountResourceId:{type:"string",description:"Revenue account UUID"},taxProfileResourceId:{type:"string"}}}}}}}},required:["invoices"],group:"invoices",readOnly:!1,searchHint:"bulk invoices line items multi-line upsert import",execute:async(t,e)=>{Un(e.invoices,"invoices");let r=e.invoices;return dl(r,["valueDate","dueDate"]),e2(t.client,r)}},{name:"bulk_upsert_bills",description:`Max 500 bills per call. FLAT shape: ONE line per bill via \`itemDescription\` + \`totalAmount\` + \`billAccountResourceId\` at row level. For multi-line bills use \`bulk_upsert_bill_line_items\` instead \u2014 that variant takes nested \`lineItems[]\`. Natural key: \`billReference\` (rows sharing one within a batch are MERGED \u2014 last wins). ${Vl} Dates are ISO 8601 only \u2014 dateFormat field was removed.`,params:{bills:{type:"array",description:"Array of bills to create or update (max 500). Each row needs at least: billReference, contactResourceId, valueDate, totalAmount, billAccountResourceId.",items:{type:"object",properties:{rowIndex:{type:"string"},resourceId:{type:"string"},billReference:{type:"string",description:"Natural key \u2014 required"},contactResourceId:{type:"string",description:"Supplier UUID \u2014 required"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},dueDate:{type:"string"},totalAmount:{type:"number"},currencyCode:{type:"string"},billAccountResourceId:{type:"string",description:"Expense account UUID"},itemDescription:{type:"string"},internalNotes:{type:"string"},tags:{type:"array",items:{type:"string"}}}}}},required:["bills"],group:"bills",readOnly:!1,searchHint:"bulk create update bills upsert import migrate",execute:async(t,e)=>{Un(e.bills,"bills");let r=e.bills;return dl(r,["valueDate","dueDate"]),EF(t.client,r)}},{name:"bulk_upsert_bill_line_items",description:`Nested line items per bill (max 500 bills per call). Each row carries lineItems[] under its parent bill (scoped by billReference). ${Vl}`,params:{bills:{type:"array",description:"Array of bills, each with nested lineItems[].",items:{type:"object",required:["billReference","currencyCode"],properties:{rowIndex:{type:"string"},resourceId:{type:"string"},billReference:{type:"string",description:"Natural key \u2014 required"},contactResourceId:{type:"string",description:"Supplier UUID \u2014 required"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},dueDate:{type:"string"},currencyCode:{type:"string",description:"ISO 4217 (SGD) \u2014 required"},internalNotes:{type:"string"},lineItems:{type:"array",items:{type:"object",properties:{itemDescription:{type:"string",description:"Required"},quantity:{type:"number"},unit:{type:"string"},unitPrice:{type:"number"},accountResourceId:{type:"string",description:"Expense account UUID"},taxProfileResourceId:{type:"string"}}}}}}}},required:["bills"],group:"bills",readOnly:!1,searchHint:"bulk bills line items multi-line upsert import",execute:async(t,e)=>{Un(e.bills,"bills");let r=e.bills;return dl(r,["valueDate","dueDate"]),bF(t.client,r)}},{name:"bulk_upsert_customer_credit_notes",description:`Max 500 customer credit notes per call. Natural key: creditNoteReference. ${Vl} Dates are ISO 8601 only.`,params:{customerCreditNotes:{type:"array",description:"Array of customer credit notes (max 500).",items:{type:"object",required:["creditNoteReference","currencyCode","transactionRateType"],properties:{rowIndex:{type:"string"},resourceId:{type:"string"},creditNoteReference:{type:"string",description:"Natural key \u2014 required"},contactResourceId:{type:"string",description:"Customer UUID \u2014 required"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},currencyCode:{type:"string",description:"ISO 4217 (SGD) \u2014 required"},transactionRateType:{type:"string",enum:["ORGANIZATION_RATE","TRANSACTION_RATE"],description:"Required; else the row fails."},rateFunctionToSource:{type:"number",description:"1 base = N currencyCode; TRANSACTION_RATE only."},internalNotes:{type:"string"},lineItems:{type:"array",items:{type:"object",properties:{itemDescription:{type:"string",description:"Required"},quantity:{type:"number"},unitPrice:{type:"number"},accountResourceId:{type:"string"},taxProfileResourceId:{type:"string"}}}}}}}},required:["customerCreditNotes"],group:"customer_credit_notes",readOnly:!1,searchHint:"bulk customer credit notes refund upsert import",execute:async(t,e)=>{Un(e.customerCreditNotes,"customerCreditNotes",500,"customer credit notes");let r=e.customerCreditNotes;return dl(r,["valueDate"]),J2(t.client,r)}},{name:"bulk_upsert_supplier_credit_notes",description:`Max 500 supplier credit notes per call. Natural key: creditNoteReference. ${Vl} Dates are ISO 8601 only.`,params:{supplierCreditNotes:{type:"array",description:"Array of supplier credit notes (max 500).",items:{type:"object",required:["creditNoteReference","currencyCode","transactionRateType"],properties:{rowIndex:{type:"string"},resourceId:{type:"string"},creditNoteReference:{type:"string",description:"Natural key \u2014 required"},contactResourceId:{type:"string",description:"Supplier UUID \u2014 required"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},currencyCode:{type:"string",description:"ISO 4217 (SGD) \u2014 required"},transactionRateType:{type:"string",enum:["ORGANIZATION_RATE","TRANSACTION_RATE"],description:"Required; else the row fails."},rateFunctionToSource:{type:"number",description:"1 base = N currencyCode; TRANSACTION_RATE only."},internalNotes:{type:"string"},lineItems:{type:"array",items:{type:"object",properties:{itemDescription:{type:"string",description:"Required"},quantity:{type:"number"},unitPrice:{type:"number"},accountResourceId:{type:"string"},taxProfileResourceId:{type:"string"}}}}}}}},required:["supplierCreditNotes"],group:"supplier_credit_notes",readOnly:!1,searchHint:"bulk supplier credit notes refund upsert import",execute:async(t,e)=>{Un(e.supplierCreditNotes,"supplierCreditNotes",500,"supplier credit notes");let r=e.supplierCreditNotes;return dl(r,["valueDate"]),tU(t.client,r)}},{name:"bulk_upsert_journals",description:`Max 500 manual journals per call. NATURAL KEY: \`journalReference\` (NOT \`reference\` \u2014 every other bulk-upsert uses entityReference, this one is asymmetric). LEGS field: \`journalEntries[]\` (NOT \`entries[]\` \u2014 different from \`clio journals create\` which uses entries). A leg is \`organizationAccountResourceId\` + EXACTLY ONE of \`debitAmount\` / \`creditAmount\` \u2014 omit the unused side, do not send 0, and do NOT use the \`accountResourceId\`+\`amount\`+\`type\` shape \`create_journal\` takes. Debits must equal credits per journal. ${Vl} Dates are ISO 8601 (YYYY-MM-DD) only \u2014 dateFormat field was removed.`,params:{journals:{type:"array",description:"Array of journals to create or update (max 500). Each row has journalEntries[] (debit/credit legs).",items:{type:"object",properties:{journalReference:{type:"string",description:"Natural key \u2014 required (NOTE: field is `journalReference`, not `reference`)"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},contactResourceId:{type:"string"},taxVatApplicable:{type:"boolean"},taxInclusion:{type:"boolean"},journalEntries:{type:"array",description:"Journal legs (debits must equal credits) \u2014 field is `journalEntries`, NOT `entries`",items:{type:"object",properties:{organizationAccountResourceId:{type:"string",description:"Required \u2014 NOT `accountResourceId`"},debitAmount:{type:"number",description:"Debit leg \u2014 omit on a credit leg"},creditAmount:{type:"number",description:"Credit leg \u2014 omit on a debit leg"},description:{type:"string"},rowIndex:{type:"string",description:"1-based, echoed back on per-row errors"},taxProfileResourceId:{type:"string"}}}}}}}},required:["journals"],group:"journals",readOnly:!1,searchHint:"bulk manual journals upsert import migration. Legs use organizationAccountResourceId + debitAmount or creditAmount, never amount/type",execute:async(t,e)=>{Un(e.journals,"journals");let r=e.journals;return dl(r,["valueDate"]),E2(t.client,r)}},{name:"bulk_upsert_fixed_assets",description:`Bulk create/update fixed assets (max 500). Natural key: reference.
|
|
866
|
+
ASYNC: returns jobId \u2192 poll search_background_jobs(filter:{resourceId:{eq:jobId}}); PARTIAL_SUCCESS \u2192 data[0].errorDetails. Dates ISO 8601 (YYYY-MM-DD); dateFormat field removed.`,params:{invoices:{type:"array",description:"Array of invoices to create or update (max 500). Each row needs at least: invoiceReference, contactResourceId, valueDate, totalAmount, invoiceAccountResourceId.",items:{type:"object",properties:{rowIndex:{type:"string",description:"Optional caller-supplied row index for error reporting"},invoiceReference:{type:"string",description:"Natural key (e.g., INV-2025-001) \u2014 required"},contactResourceId:{type:"string",description:"Customer contact UUID \u2014 required"},valueDate:{type:"string",description:"Invoice date YYYY-MM-DD \u2014 required"},totalAmount:{type:"number",description:"Total amount (BigDecimal)"},invoiceAccountResourceId:{type:"string",description:"Revenue account UUID"},itemDescription:{type:"string",description:"Single-line item description"},internalNotes:{type:"string",description:"Internal notes"}}}}},required:["invoices"],group:"invoices",readOnly:!1,searchHint:"bulk create update invoices upsert import migrate",execute:async(t,e)=>{Un(e.invoices,"invoices");let r=e.invoices;return dl(r,["valueDate","dueDate"]),KP(t.client,r)}},{name:"bulk_upsert_invoice_line_items",description:`Nested line items per invoice (max 500 invoices per call). Each row carries lineItems[] under its parent invoice (scoped by invoiceReference). ${Vl} Dates are ISO 8601 only.`,params:{invoices:{type:"array",description:"Array of invoices, each with nested lineItems[].",items:{type:"object",required:["invoiceReference","currencyCode"],properties:{rowIndex:{type:"string"},invoiceReference:{type:"string",description:"Natural key \u2014 required"},contactResourceId:{type:"string",description:"Customer UUID \u2014 required"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},dueDate:{type:"string",description:"YYYY-MM-DD"},currencyCode:{type:"string",description:"ISO 4217 (SGD) \u2014 required"},internalNotes:{type:"string"},lineItems:{type:"array",description:"Line items belonging to this invoice",items:{type:"object",properties:{itemDescription:{type:"string",description:"Line description \u2014 required"},quantity:{type:"number"},unit:{type:"string",description:"Unit of measure (pcs, kg, etc.)"},unitPrice:{type:"number"},accountResourceId:{type:"string",description:"Revenue account UUID"},taxProfileResourceId:{type:"string"}}}}}}}},required:["invoices"],group:"invoices",readOnly:!1,searchHint:"bulk invoices line items multi-line upsert import",execute:async(t,e)=>{Un(e.invoices,"invoices");let r=e.invoices;return dl(r,["valueDate","dueDate"]),e2(t.client,r)}},{name:"bulk_upsert_bills",description:`Max 500 bills per call. FLAT shape: ONE line per bill via \`itemDescription\` + \`totalAmount\` + \`billAccountResourceId\` at row level. For multi-line bills use \`bulk_upsert_bill_line_items\` instead \u2014 that variant takes nested \`lineItems[]\`. Natural key: \`billReference\` (rows sharing one within a batch are MERGED \u2014 last wins). ${Vl} Dates are ISO 8601 only \u2014 dateFormat field was removed.`,params:{bills:{type:"array",description:"Array of bills to create or update (max 500). Each row needs at least: billReference, contactResourceId, valueDate, totalAmount, billAccountResourceId.",items:{type:"object",properties:{rowIndex:{type:"string"},billReference:{type:"string",description:"Natural key \u2014 required"},contactResourceId:{type:"string",description:"Supplier UUID \u2014 required"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},totalAmount:{type:"number"},billAccountResourceId:{type:"string",description:"Expense account UUID"},itemDescription:{type:"string"},internalNotes:{type:"string"}}}}},required:["bills"],group:"bills",readOnly:!1,searchHint:"bulk create update bills upsert import migrate",execute:async(t,e)=>{Un(e.bills,"bills");let r=e.bills;return dl(r,["valueDate","dueDate"]),EF(t.client,r)}},{name:"bulk_upsert_bill_line_items",description:`Nested line items per bill (max 500 bills per call). Each row carries lineItems[] under its parent bill (scoped by billReference). ${Vl}`,params:{bills:{type:"array",description:"Array of bills, each with nested lineItems[].",items:{type:"object",required:["billReference","currencyCode"],properties:{rowIndex:{type:"string"},billReference:{type:"string",description:"Natural key \u2014 required"},contactResourceId:{type:"string",description:"Supplier UUID \u2014 required"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},dueDate:{type:"string"},currencyCode:{type:"string",description:"ISO 4217 (SGD) \u2014 required"},internalNotes:{type:"string"},lineItems:{type:"array",items:{type:"object",properties:{itemDescription:{type:"string",description:"Required"},quantity:{type:"number"},unit:{type:"string"},unitPrice:{type:"number"},accountResourceId:{type:"string",description:"Expense account UUID"},taxProfileResourceId:{type:"string"}}}}}}}},required:["bills"],group:"bills",readOnly:!1,searchHint:"bulk bills line items multi-line upsert import",execute:async(t,e)=>{Un(e.bills,"bills");let r=e.bills;return dl(r,["valueDate","dueDate"]),bF(t.client,r)}},{name:"bulk_upsert_customer_credit_notes",description:`Max 500 customer credit notes per call. Natural key: creditNoteReference. ${Vl} Dates are ISO 8601 only.`,params:{customerCreditNotes:{type:"array",description:"Array of customer credit notes (max 500).",items:{type:"object",required:["creditNoteReference","currencyCode","transactionRateType"],properties:{rowIndex:{type:"string"},creditNoteReference:{type:"string",description:"Natural key \u2014 required"},contactResourceId:{type:"string",description:"Customer UUID \u2014 required"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},currencyCode:{type:"string",description:"ISO 4217 (SGD) \u2014 required"},transactionRateType:{type:"string",enum:["ORGANIZATION_RATE","TRANSACTION_RATE"],description:"Required; else the row fails."},rateFunctionToSource:{type:"number",description:"1 base = N currencyCode; TRANSACTION_RATE only."},internalNotes:{type:"string"},lineItems:{type:"array",items:{type:"object",properties:{itemDescription:{type:"string",description:"Required"},quantity:{type:"number"},unitPrice:{type:"number"},accountResourceId:{type:"string"},taxProfileResourceId:{type:"string"}}}}}}}},required:["customerCreditNotes"],group:"customer_credit_notes",readOnly:!1,searchHint:"bulk customer credit notes refund upsert import",execute:async(t,e)=>{Un(e.customerCreditNotes,"customerCreditNotes",500,"customer credit notes");let r=e.customerCreditNotes;return dl(r,["valueDate"]),J2(t.client,r)}},{name:"bulk_upsert_supplier_credit_notes",description:`Max 500 supplier credit notes per call. Natural key: creditNoteReference. ${Vl} Dates are ISO 8601 only.`,params:{supplierCreditNotes:{type:"array",description:"Array of supplier credit notes (max 500).",items:{type:"object",required:["creditNoteReference","currencyCode","transactionRateType"],properties:{rowIndex:{type:"string"},creditNoteReference:{type:"string",description:"Natural key \u2014 required"},contactResourceId:{type:"string",description:"Supplier UUID \u2014 required"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},currencyCode:{type:"string",description:"ISO 4217 (SGD) \u2014 required"},transactionRateType:{type:"string",enum:["ORGANIZATION_RATE","TRANSACTION_RATE"],description:"Required; else the row fails."},rateFunctionToSource:{type:"number",description:"1 base = N currencyCode; TRANSACTION_RATE only."},internalNotes:{type:"string"},lineItems:{type:"array",items:{type:"object",properties:{itemDescription:{type:"string",description:"Required"},quantity:{type:"number"},unitPrice:{type:"number"},accountResourceId:{type:"string"},taxProfileResourceId:{type:"string"}}}}}}}},required:["supplierCreditNotes"],group:"supplier_credit_notes",readOnly:!1,searchHint:"bulk supplier credit notes refund upsert import",execute:async(t,e)=>{Un(e.supplierCreditNotes,"supplierCreditNotes",500,"supplier credit notes");let r=e.supplierCreditNotes;return dl(r,["valueDate"]),tU(t.client,r)}},{name:"bulk_upsert_journals",description:`Max 500 manual journals per call. NATURAL KEY: \`journalReference\` (NOT \`reference\` \u2014 every other bulk-upsert uses entityReference, this one is asymmetric). LEGS field: \`journalEntries[]\` (NOT \`entries[]\` \u2014 different from \`clio journals create\` which uses entries). A leg is \`organizationAccountResourceId\` + EXACTLY ONE of \`debitAmount\` / \`creditAmount\` \u2014 omit the unused side, do not send 0, and do NOT use the \`accountResourceId\`+\`amount\`+\`type\` shape \`create_journal\` takes. Debits must equal credits per journal. ${Vl} Dates are ISO 8601 (YYYY-MM-DD) only \u2014 dateFormat field was removed.`,params:{journals:{type:"array",description:"Array of journals to create or update (max 500). Each row has journalEntries[] (debit/credit legs).",items:{type:"object",properties:{journalReference:{type:"string",description:"Natural key \u2014 required (NOTE: field is `journalReference`, not `reference`)"},valueDate:{type:"string",description:"YYYY-MM-DD \u2014 required"},contactResourceId:{type:"string"},taxVatApplicable:{type:"boolean"},taxInclusion:{type:"boolean"},journalEntries:{type:"array",description:"Journal legs (debits must equal credits) \u2014 field is `journalEntries`, NOT `entries`",items:{type:"object",properties:{organizationAccountResourceId:{type:"string",description:"Required \u2014 NOT `accountResourceId`"},debitAmount:{type:"number",description:"Debit leg \u2014 omit on a credit leg"},creditAmount:{type:"number",description:"Credit leg \u2014 omit on a debit leg"},description:{type:"string"},rowIndex:{type:"string",description:"1-based, echoed back on per-row errors"},taxProfileResourceId:{type:"string"}}}}}}}},required:["journals"],group:"journals",readOnly:!1,searchHint:"bulk manual journals upsert import migration. Legs use organizationAccountResourceId + debitAmount or creditAmount, never amount/type",execute:async(t,e)=>{Un(e.journals,"journals");let r=e.journals;return dl(r,["valueDate"]),E2(t.client,r)}},{name:"bulk_upsert_fixed_assets",description:`Bulk create/update fixed assets (max 500). Natural key: reference.
|
|
867
867
|
|
|
868
868
|
\u26A0\uFE0F DATES ARE EPOCH MILLISECONDS here \u2014 purchaseDate and depreciationStartDate are numbers (e.g. 1745107200000), NOT the YYYY-MM-DD every other bulk-upsert takes. A date string \u2192 cryptic 400 "Invalid request body".
|
|
869
869
|
|