Skip to content

Commit f62cd5f

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): align item updates and generated docs
1 parent b119f62 commit f62cd5f

7 files changed

Lines changed: 95 additions & 40 deletions

File tree

apps/docs/content/docs/en/integrations/quickbooks.mdx

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ List or read one account, customer, vendor, item, or employee
7272
| --------- | ---- | ----------- |
7373
| `recordType` | string | Master-data record type returned by this action |
7474
| `item` | json | Single QuickBooks master-data record returned by a by-ID read |
75+
|`Id` | string | QuickBooks entity ID |
76+
|`SyncToken` | string | Entity sync token |
77+
|`Active` | boolean | Whether the entity is active |
78+
|`MetaData` | json | Entity creation and update timestamps |
79+
|`CreateTime` | string | Entity creation timestamp |
80+
|`LastUpdatedTime` | string | Entity last-updated timestamp |
7581
|`Name` | string | Item name |
7682
|`SubAccount` | boolean | Whether this is a subaccount |
7783
|`ParentRef` | json | Parent item or category reference |
@@ -118,6 +124,12 @@ List or read one account, customer, vendor, item, or employee
118124
|`PrimaryAddr` | json | Employee primary address |
119125
|`BillableTime` | boolean | Whether employee time is billable |
120126
| `items` | array | QuickBooks master-data records returned by a list read |
127+
|`Id` | string | QuickBooks entity ID |
128+
|`SyncToken` | string | Entity sync token |
129+
|`Active` | boolean | Whether the entity is active |
130+
|`MetaData` | json | Entity creation and update timestamps |
131+
|`CreateTime` | string | Entity creation timestamp |
132+
|`LastUpdatedTime` | string | Entity last-updated timestamp |
121133
|`Name` | string | Item name |
122134
|`SubAccount` | boolean | Whether this is a subaccount |
123135
|`ParentRef` | json | Parent item or category reference |
@@ -163,6 +175,11 @@ List or read one account, customer, vendor, item, or employee
163175
|`InvStartDate` | string | Inventory tracking start date |
164176
|`PrimaryAddr` | json | Employee primary address |
165177
|`BillableTime` | boolean | Whether employee time is billable |
178+
| `startPosition` | number | One-based position of the first record in this page |
179+
| `maxResults` | number | Actual number of records returned in this page |
180+
| `nextStartPosition` | number | Position to use when explicitly requesting the next page |
181+
| `hasMore` | boolean | Conservative indication that another page may exist |
182+
| `time` | string | QuickBooks response timestamp |
166183

167184
### `quickbooks_create_customer`
168185

@@ -190,6 +207,12 @@ Create a customer in the connected QuickBooks Online company
190207
| `syncToken` | string | Latest sync token required for a subsequent update |
191208
| `time` | string | QuickBooks response timestamp |
192209
| `record` | json | Created QuickBooks Customer record |
210+
|`Id` | string | QuickBooks entity ID |
211+
|`SyncToken` | string | Entity sync token |
212+
|`Active` | boolean | Whether the entity is active |
213+
|`MetaData` | json | Entity creation and update timestamps |
214+
|`CreateTime` | string | Entity creation timestamp |
215+
|`LastUpdatedTime` | string | Entity last-updated timestamp |
193216
|`DisplayName` | string | Customer display name |
194217
|`CompanyName` | string | Customer company name |
195218
|`GivenName` | string | Given name |
@@ -233,6 +256,12 @@ Sparse-update a customer in the connected QuickBooks Online company
233256
| `syncToken` | string | Latest sync token required for a subsequent update |
234257
| `time` | string | QuickBooks response timestamp |
235258
| `record` | json | Updated QuickBooks Customer record |
259+
|`Id` | string | QuickBooks entity ID |
260+
|`SyncToken` | string | Entity sync token |
261+
|`Active` | boolean | Whether the entity is active |
262+
|`MetaData` | json | Entity creation and update timestamps |
263+
|`CreateTime` | string | Entity creation timestamp |
264+
|`LastUpdatedTime` | string | Entity last-updated timestamp |
236265
|`DisplayName` | string | Customer display name |
237266
|`CompanyName` | string | Customer company name |
238267
|`GivenName` | string | Given name |
@@ -274,6 +303,12 @@ Create a vendor in the connected QuickBooks Online company
274303
| `syncToken` | string | Latest sync token required for a subsequent update |
275304
| `time` | string | QuickBooks response timestamp |
276305
| `record` | json | Created QuickBooks Vendor record |
306+
|`Id` | string | QuickBooks entity ID |
307+
|`SyncToken` | string | Entity sync token |
308+
|`Active` | boolean | Whether the entity is active |
309+
|`MetaData` | json | Entity creation and update timestamps |
310+
|`CreateTime` | string | Entity creation timestamp |
311+
|`LastUpdatedTime` | string | Entity last-updated timestamp |
277312
|`DisplayName` | string | Vendor display name |
278313
|`CompanyName` | string | Vendor company name |
279314
|`GivenName` | string | Given name |
@@ -319,6 +354,12 @@ Sparse-update a vendor in the connected QuickBooks Online company
319354
| `syncToken` | string | Latest sync token required for a subsequent update |
320355
| `time` | string | QuickBooks response timestamp |
321356
| `record` | json | Updated QuickBooks Vendor record |
357+
|`Id` | string | QuickBooks entity ID |
358+
|`SyncToken` | string | Entity sync token |
359+
|`Active` | boolean | Whether the entity is active |
360+
|`MetaData` | json | Entity creation and update timestamps |
361+
|`CreateTime` | string | Entity creation timestamp |
362+
|`LastUpdatedTime` | string | Entity last-updated timestamp |
322363
|`DisplayName` | string | Vendor display name |
323364
|`CompanyName` | string | Vendor company name |
324365
|`GivenName` | string | Given name |
@@ -360,6 +401,12 @@ Create a Service or Non-inventory item in QuickBooks Online
360401
| `syncToken` | string | Latest sync token required for a subsequent update |
361402
| `time` | string | QuickBooks response timestamp |
362403
| `record` | json | Created QuickBooks Item record |
404+
|`Id` | string | QuickBooks entity ID |
405+
|`SyncToken` | string | Entity sync token |
406+
|`Active` | boolean | Whether the entity is active |
407+
|`MetaData` | json | Entity creation and update timestamps |
408+
|`CreateTime` | string | Entity creation timestamp |
409+
|`LastUpdatedTime` | string | Entity last-updated timestamp |
363410
|`Name` | string | Item name |
364411
|`Description` | string | Item sales description |
365412
|`FullyQualifiedName` | string | Hierarchical qualified item name |
@@ -386,15 +433,14 @@ Create a Service or Non-inventory item in QuickBooks Online
386433

387434
### `quickbooks_update_item`
388435

389-
Sparse-update a Service or Non-inventory item in QuickBooks Online
436+
Sparse-update supported fields on an item without changing its type
390437

391438
#### Input
392439

393440
| Parameter | Type | Required | Description |
394441
| --------- | ---- | -------- | ----------- |
395442
| `itemId` | string | Yes | ID of the item to update |
396443
| `syncToken` | string | Yes | Current item sync token |
397-
| `itemType` | string | Yes | Current item type: service or non_inventory |
398444
| `name` | string | No | Replacement item name |
399445
| `incomeAccountId` | string | No | Replacement income account ID |
400446
| `description` | string | No | Replacement sales description |
@@ -413,6 +459,12 @@ Sparse-update a Service or Non-inventory item in QuickBooks Online
413459
| `syncToken` | string | Latest sync token required for a subsequent update |
414460
| `time` | string | QuickBooks response timestamp |
415461
| `record` | json | Updated QuickBooks Item record |
462+
|`Id` | string | QuickBooks entity ID |
463+
|`SyncToken` | string | Entity sync token |
464+
|`Active` | boolean | Whether the entity is active |
465+
|`MetaData` | json | Entity creation and update timestamps |
466+
|`CreateTime` | string | Entity creation timestamp |
467+
|`LastUpdatedTime` | string | Entity last-updated timestamp |
416468
|`Name` | string | Item name |
417469
|`Description` | string | Item sales description |
418470
|`FullyQualifiedName` | string | Hierarchical qualified item name |

apps/sim/blocks/blocks/quickbooks.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ export const QuickBooksBlock: BlockConfig<QuickBooksResponse> = {
356356
{ label: 'Service', id: 'service' },
357357
{ label: 'Non-inventory', id: 'non_inventory' },
358358
],
359-
condition: { field: 'operation', value: [...ITEM_OPERATIONS] },
360-
required: { field: 'operation', value: [...ITEM_OPERATIONS] },
359+
condition: { field: 'operation', value: 'quickbooks_create_item' },
360+
required: { field: 'operation', value: 'quickbooks_create_item' },
361361
value: () => 'service',
362362
},
363363
{
@@ -531,7 +531,8 @@ export const QuickBooksBlock: BlockConfig<QuickBooksResponse> = {
531531
itemId: optionalValue(params.itemId),
532532
syncToken: optionalValue(params.syncToken),
533533
name: optionalValue(params.name),
534-
itemType: optionalValue(params.itemType),
534+
itemType:
535+
operation === 'quickbooks_create_item' ? optionalValue(params.itemType) : undefined,
535536
incomeAccountId: optionalValue(params.incomeAccountId),
536537
description: optionalValue(params.description),
537538
unitPrice: parseOptionalNumber(params.unitPrice, 'unitPrice'),
@@ -685,7 +686,7 @@ export const QuickBooksBlockMeta = {
685686
icon: QuickBooksIcon,
686687
title: 'QuickBooks catalogue maintenance',
687688
prompt:
688-
'Build a workflow that reads QuickBooks accounts, then creates or updates approved Service and Non-inventory items with the correct income and expense account references.',
689+
'Build a workflow that reads QuickBooks accounts, creates approved Service or Non-inventory items, or updates exposed item fields without changing item types.',
689690
modules: ['tables', 'agent', 'workflows'],
690691
category: 'operations',
691692
tags: ['finance', 'catalogue', 'operations'],
@@ -744,9 +745,9 @@ export const QuickBooksBlockMeta = {
744745
},
745746
{
746747
name: 'maintain-products-and-services',
747-
description: 'Create or update supported Service and Non-inventory QuickBooks items.',
748+
description: 'Create supported items or update exposed item fields without changing types.',
748749
content:
749-
'# Maintain QuickBooks Products and Services\n\n## Steps\n1. Read Account master data to obtain approved account IDs.\n2. Create or update a Service or Non-inventory Item.\n3. Store the latest item ID and sync token.\n\n## Output\nReturn the native Item record. Do not claim to manage Inventory, Category, or Group items.',
750+
'# Maintain QuickBooks Products and Services\n\n## Steps\n1. Read Account master data to obtain approved account IDs.\n2. Create a Service or Non-inventory Item, or update exposed basic fields without changing the existing item Type.\n3. Store the latest item ID and sync token.\n\n## Output\nReturn the native Item record. Do not claim to create Inventory, Category, or Group items or manage their specialized fields.',
750751
},
751752
{
752753
name: 'audit-quickbooks-master-data',

apps/sim/lib/integrations/integrations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"updatedAt": "2026-07-31",
2+
"updatedAt": "2026-08-01",
33
"integrations": [
44
{
55
"type": "onepassword",
@@ -14555,7 +14555,7 @@
1455514555
},
1455614556
{
1455714557
"name": "Items: Update",
14558-
"description": "Sparse-update a Service or Non-inventory item in QuickBooks Online"
14558+
"description": "Sparse-update supported fields on an item without changing its type"
1455914559
},
1456014560
{
1456114561
"name": "Purchasing: List Purchase Orders",

apps/sim/tools/quickbooks/quickbooks.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@ describe('QuickBooks item mutations', () => {
618618
...authParams,
619619
itemId: '44',
620620
syncToken: '2',
621-
itemType: 'service',
622621
activeStatus: 'unchanged',
623622
unitPrice: 15.75,
624623
expenseAccountId: '80',
@@ -630,13 +629,7 @@ describe('QuickBooks item mutations', () => {
630629
UnitPrice: 15.75,
631630
ExpenseAccountRef: { value: '80' },
632631
})
633-
expect(quickbooksUpdateItemTool.params.itemType).toMatchObject({ required: true })
634-
expect(() =>
635-
quickbooksUpdateItemTool.request.body!({
636-
...params,
637-
itemType: 'inventory' as QuickBooksUpdateItemParams['itemType'],
638-
})
639-
).toThrow('Unsupported writable')
632+
expect(quickbooksUpdateItemTool.params).not.toHaveProperty('itemType')
640633
})
641634

642635
it('returns the native mutation record and convenient identifiers', async () => {
@@ -837,7 +830,7 @@ describe('QuickBooks tool and block boundaries', () => {
837830
})
838831
expect(subBlocks.itemType.condition).toEqual({
839832
field: 'operation',
840-
value: ['quickbooks_create_item', 'quickbooks_update_item'],
833+
value: 'quickbooks_create_item',
841834
})
842835
})
843836
})

apps/sim/tools/quickbooks/read_master_data.ts

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ import type {
88
QuickBooksReadMasterDataResponse,
99
QuickBooksVendor,
1010
} from '@/tools/quickbooks/types'
11-
import {
12-
QUICKBOOKS_LIST_OUTPUTS,
13-
QUICKBOOKS_MASTER_DATA_PROPERTIES,
14-
} from '@/tools/quickbooks/types'
11+
import { QUICKBOOKS_MASTER_DATA_PROPERTIES } from '@/tools/quickbooks/types'
1512
import {
1613
buildQuickBooksEntityUrl,
1714
buildQuickBooksQueryUrl,
@@ -265,11 +262,31 @@ export const quickbooksReadMasterDataTool: ToolConfig<
265262
properties: QUICKBOOKS_MASTER_DATA_PROPERTIES,
266263
},
267264
},
268-
...Object.fromEntries(
269-
Object.entries(QUICKBOOKS_LIST_OUTPUTS).map(([key, value]) => [
270-
key,
271-
{ ...value, optional: true },
272-
])
273-
),
265+
startPosition: {
266+
type: 'number',
267+
description: 'One-based position of the first record in this page',
268+
optional: true,
269+
},
270+
maxResults: {
271+
type: 'number',
272+
description: 'Actual number of records returned in this page',
273+
optional: true,
274+
},
275+
nextStartPosition: {
276+
type: 'number',
277+
description: 'Position to use when explicitly requesting the next page',
278+
optional: true,
279+
},
280+
hasMore: {
281+
type: 'boolean',
282+
description: 'Conservative indication that another page may exist',
283+
optional: true,
284+
},
285+
time: {
286+
type: 'string',
287+
description: 'QuickBooks response timestamp',
288+
optional: true,
289+
nullable: true,
290+
},
274291
},
275292
}

apps/sim/tools/quickbooks/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export interface QuickBooksCreateItemParams extends QuickBooksAuthParams {
289289
}
290290

291291
export interface QuickBooksUpdateItemParams
292-
extends Omit<QuickBooksCreateItemParams, 'name' | 'incomeAccountId'> {
292+
extends Omit<QuickBooksCreateItemParams, 'name' | 'itemType' | 'incomeAccountId'> {
293293
itemId: string
294294
syncToken: string
295295
name?: string
@@ -431,7 +431,7 @@ export const QUICKBOOKS_LIST_OUTPUTS: Record<string, OutputProperty> = {
431431
},
432432
}
433433

434-
const QUICKBOOKS_ENTITY_BASE_PROPERTIES: Record<string, OutputProperty> = {
434+
export const QUICKBOOKS_ENTITY_BASE_PROPERTIES: Record<string, OutputProperty> = {
435435
Id: { type: 'string', description: 'QuickBooks entity ID' },
436436
SyncToken: { type: 'string', description: 'Entity sync token', optional: true },
437437
Active: { type: 'boolean', description: 'Whether the entity is active', optional: true },

apps/sim/tools/quickbooks/update_item.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
optionalQuickBooksString,
1515
quickBooksActiveValue,
1616
quickBooksReference,
17-
quickBooksWritableItemType,
1817
requiredQuickBooksString,
1918
transformQuickBooksMutationResponse,
2019
validateQuickBooksOptionalNumber,
@@ -27,7 +26,7 @@ export const quickbooksUpdateItemTool: ToolConfig<
2726
> = {
2827
id: 'quickbooks_update_item',
2928
name: 'QuickBooks Update Item',
30-
description: 'Sparse-update a Service or Non-inventory item in QuickBooks Online',
29+
description: 'Sparse-update supported fields on an item without changing its type',
3130
version: '1.0.0',
3231
params: {
3332
accessToken: {
@@ -54,12 +53,6 @@ export const quickbooksUpdateItemTool: ToolConfig<
5453
visibility: 'user-or-llm',
5554
description: 'Current item sync token',
5655
},
57-
itemType: {
58-
type: 'string',
59-
required: true,
60-
visibility: 'user-or-llm',
61-
description: 'Current item type: service or non_inventory',
62-
},
6356
name: {
6457
type: 'string',
6558
required: false,
@@ -127,7 +120,6 @@ export const quickbooksUpdateItemTool: ToolConfig<
127120
method: 'POST',
128121
headers: (params) => getQuickBooksToolHeaders(params.accessToken, 'application/json'),
129122
body: (params) => {
130-
quickBooksWritableItemType(params.itemType)
131123
const body = filterUndefined({
132124
Id: requiredQuickBooksString(params.itemId, 'itemId'),
133125
SyncToken: requiredQuickBooksString(params.syncToken, 'syncToken'),

0 commit comments

Comments
 (0)