Skip to content

Commit 69d5c90

Browse files
BillLeoutsakosvl346Bill Leoutsakos
andauthored
feat(quickbooks): add accountant filters (#6208)
* feat(quickbooks): add safe n8n parity tools * feat(quickbooks): expose accountant parity options * fix(quickbooks): address parity review findings * fix(quickbooks): require recipient for payment email * chore(quickbooks): sync parity catalog --------- Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
1 parent 2b1f2c2 commit 69d5c90

28 files changed

Lines changed: 1749 additions & 160 deletions

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

Lines changed: 111 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ List or read one account, class, customer, department, employee, item, or vendor
8080
| `recordId` | string | No | QuickBooks record ID, required for by-ID reads |
8181
| `startPosition` | number | No | One-based position of the first list record to return |
8282
| `maxResults` | number | No | Number of list records to request \(1–100\) |
83+
| `activeStatus` | string | No | List records using the QuickBooks default, active, or inactive status |
8384

8485
#### Output
8586

@@ -116,7 +117,7 @@ List or read one account, class, customer, department, employee, item, or vendor
116117
|`BillAddr` | json | Customer or vendor billing address |
117118
|`ShipAddr` | json | Customer shipping address |
118119
|`Balance` | number | Customer or vendor balance |
119-
|`PrintOnCheckName` | string | Name printed on checks |
120+
|`PrintOnCheckName` | string | Vendor or employee name printed on checks |
120121
|`Vendor1099` | boolean | Whether the vendor is tracked for 1099 reporting |
121122
|`AcctNum` | string | Vendor account number |
122123
|`Description` | string | Item sales description |
@@ -138,6 +139,8 @@ List or read one account, class, customer, department, employee, item, or vendor
138139
|`InvStartDate` | string | Inventory tracking start date |
139140
|`PrimaryAddr` | json | Employee primary address |
140141
|`BillableTime` | boolean | Whether employee time is billable |
142+
|`domain` | string | QuickBooks domain |
143+
|`sparse` | boolean | Whether this is a sparse entity |
141144
|`SubClass` | boolean | Whether the Class is nested under another Class |
142145
|`SubDepartment` | boolean | Whether the Department is nested under another Department |
143146
| `items` | array | QuickBooks master-data records returned by a list read |
@@ -170,7 +173,7 @@ List or read one account, class, customer, department, employee, item, or vendor
170173
|`BillAddr` | json | Customer or vendor billing address |
171174
|`ShipAddr` | json | Customer shipping address |
172175
|`Balance` | number | Customer or vendor balance |
173-
|`PrintOnCheckName` | string | Name printed on checks |
176+
|`PrintOnCheckName` | string | Vendor or employee name printed on checks |
174177
|`Vendor1099` | boolean | Whether the vendor is tracked for 1099 reporting |
175178
|`AcctNum` | string | Vendor account number |
176179
|`Description` | string | Item sales description |
@@ -192,6 +195,8 @@ List or read one account, class, customer, department, employee, item, or vendor
192195
|`InvStartDate` | string | Inventory tracking start date |
193196
|`PrimaryAddr` | json | Employee primary address |
194197
|`BillableTime` | boolean | Whether employee time is billable |
198+
|`domain` | string | QuickBooks domain |
199+
|`sparse` | boolean | Whether this is a sparse entity |
195200
|`SubClass` | boolean | Whether the Class is nested under another Class |
196201
|`SubDepartment` | boolean | Whether the Department is nested under another Department |
197202
| `startPosition` | number | One-based position of the first record in this page |
@@ -296,6 +301,94 @@ Sparse-update a customer in the connected QuickBooks Online company
296301
|`value` | string | QuickBooks entity ID |
297302
|`name` | string | QuickBooks entity display name |
298303

304+
### `quickbooks_create_employee`
305+
306+
Create a non-payroll employee profile in the connected QuickBooks Online company
307+
308+
#### Input
309+
310+
| Parameter | Type | Required | Description |
311+
| --------- | ---- | -------- | ----------- |
312+
| `displayName` | string | Yes | Unique employee display name |
313+
| `givenName` | string | No | Employee given name |
314+
| `familyName` | string | No | Employee family name |
315+
| `primaryEmail` | string | No | Employee primary email address |
316+
| `primaryPhone` | string | No | Employee primary phone number |
317+
| `primaryAddress` | json | No | Employee primary address |
318+
| `printOnCheckName` | string | No | Employee name printed on checks |
319+
| `billableTime` | boolean | No | Whether employee time is billable |
320+
| `requestId` | string | No | Optional Intuit idempotency request ID, up to 50 characters |
321+
322+
#### Output
323+
324+
| Parameter | Type | Description |
325+
| --------- | ---- | ----------- |
326+
| `recordId` | string | ID of the created or updated QuickBooks entity |
327+
| `syncToken` | string | Latest sync token required for a subsequent update |
328+
| `time` | string | QuickBooks response timestamp |
329+
| `record` | json | Created QuickBooks Employee record |
330+
|`Id` | string | QuickBooks entity ID |
331+
|`SyncToken` | string | Entity sync token |
332+
|`Active` | boolean | Whether the entity is active |
333+
|`MetaData` | json | Entity creation and update timestamps |
334+
|`CreateTime` | string | Entity creation timestamp |
335+
|`LastUpdatedTime` | string | Entity last-updated timestamp |
336+
|`DisplayName` | string | Employee display name |
337+
|`GivenName` | string | Given name |
338+
|`FamilyName` | string | Family name |
339+
|`PrintOnCheckName` | string | Employee name printed on checks |
340+
|`PrimaryEmailAddr` | json | Employee primary email address |
341+
|`PrimaryPhone` | json | Employee primary phone number |
342+
|`PrimaryAddr` | json | Employee primary address |
343+
|`BillableTime` | boolean | Whether employee time is billable |
344+
|`domain` | string | QuickBooks domain |
345+
|`sparse` | boolean | Whether this is a sparse entity |
346+
347+
### `quickbooks_update_employee`
348+
349+
Sparse-update a non-payroll employee profile in the connected QuickBooks Online company
350+
351+
#### Input
352+
353+
| Parameter | Type | Required | Description |
354+
| --------- | ---- | -------- | ----------- |
355+
| `employeeId` | string | Yes | ID of the employee to update |
356+
| `syncToken` | string | Yes | Current employee sync token |
357+
| `displayName` | string | No | Replacement employee display name |
358+
| `givenName` | string | No | Replacement employee given name |
359+
| `familyName` | string | No | Replacement employee family name |
360+
| `primaryEmail` | string | No | Replacement employee primary email address |
361+
| `primaryPhone` | string | No | Replacement employee primary phone number |
362+
| `primaryAddress` | json | No | Replacement employee primary address |
363+
| `printOnCheckName` | string | No | Replacement employee name printed on checks |
364+
| `billableTime` | boolean | No | Whether employee time is billable |
365+
| `activeStatus` | string | No | Employee status change: unchanged, active, or inactive |
366+
367+
#### Output
368+
369+
| Parameter | Type | Description |
370+
| --------- | ---- | ----------- |
371+
| `recordId` | string | ID of the created or updated QuickBooks entity |
372+
| `syncToken` | string | Latest sync token required for a subsequent update |
373+
| `time` | string | QuickBooks response timestamp |
374+
| `record` | json | Updated QuickBooks Employee record |
375+
|`Id` | string | QuickBooks entity ID |
376+
|`SyncToken` | string | Entity sync token |
377+
|`Active` | boolean | Whether the entity is active |
378+
|`MetaData` | json | Entity creation and update timestamps |
379+
|`CreateTime` | string | Entity creation timestamp |
380+
|`LastUpdatedTime` | string | Entity last-updated timestamp |
381+
|`DisplayName` | string | Employee display name |
382+
|`GivenName` | string | Given name |
383+
|`FamilyName` | string | Family name |
384+
|`PrintOnCheckName` | string | Employee name printed on checks |
385+
|`PrimaryEmailAddr` | json | Employee primary email address |
386+
|`PrimaryPhone` | json | Employee primary phone number |
387+
|`PrimaryAddr` | json | Employee primary address |
388+
|`BillableTime` | boolean | Whether employee time is billable |
389+
|`domain` | string | QuickBooks domain |
390+
|`sparse` | boolean | Whether this is a sparse entity |
391+
299392
### `quickbooks_create_vendor`
300393

301394
Create a vendor in the connected QuickBooks Online company
@@ -524,6 +617,9 @@ List or read one estimate, invoice, sales receipt, payment, credit memo, or refu
524617
| `transactionId` | string | No | QuickBooks transaction ID, required for by-ID reads |
525618
| `startPosition` | number | No | One-based position of the first list record to return |
526619
| `maxResults` | number | No | Number of list records to request \(1–100\) |
620+
| `startDate` | string | No | List transactions on or after this date in YYYY-MM-DD format |
621+
| `endDate` | string | No | List transactions on or before this date in YYYY-MM-DD format |
622+
| `customerId` | string | No | List transactions for one QuickBooks customer ID |
527623

528624
#### Output
529625

@@ -1417,6 +1513,9 @@ List or read one purchase order, bill, bill payment, vendor credit, or purchase
14171513
| `transactionId` | string | No | QuickBooks transaction ID, required for by-ID reads |
14181514
| `startPosition` | number | No | One-based position of the first list record to return |
14191515
| `maxResults` | number | No | Number of list records to request \(1–100\) |
1516+
| `startDate` | string | No | List transactions on or after this date in YYYY-MM-DD format |
1517+
| `endDate` | string | No | List transactions on or before this date in YYYY-MM-DD format |
1518+
| `vendorId` | string | No | List transactions for one supported QuickBooks vendor ID |
14201519

14211520
#### Output
14221521

@@ -2282,6 +2381,8 @@ List or read one journal entry, deposit, or transfer
22822381
| `transactionId` | string | No | QuickBooks transaction ID, required for by-ID reads |
22832382
| `startPosition` | number | No | One-based position of the first list record to return |
22842383
| `maxResults` | number | No | Number of list records to request \(1–100\) |
2384+
| `startDate` | string | No | List transactions on or after this date in YYYY-MM-DD format |
2385+
| `endDate` | string | No | List transactions on or before this date in YYYY-MM-DD format |
22852386

22862387
#### Output
22872388

@@ -2537,6 +2638,13 @@ Run a fixed QuickBooks financial report with verified accountant-focused filters
25372638
| `departmentId` | string | No | Single QuickBooks department ID filter |
25382639
| `agingMethod` | string | No | Age open balances from the report date or current date |
25392640
| `agingDays` | number | No | Positive number of days in each aging period |
2641+
| `transactionType` | string | No | Transaction type filter for Transaction List |
2642+
| `groupBy` | string | No | Grouping dimension for Transaction List |
2643+
| `accountsPayablePaid` | string | No | Accounts-payable paid status for Transaction List |
2644+
| `accountsReceivablePaid` | string | No | Accounts-receivable paid status for Transaction List |
2645+
| `clearedStatus` | string | No | Cleared status filter for Transaction List |
2646+
| `documentNumber` | string | No | Document number filter for Transaction List |
2647+
| `sourceAccountType` | string | No | Source account type filter for Transaction List |
25402648

25412649
#### Output
25422650

@@ -2584,7 +2692,7 @@ Send a supported QuickBooks transaction by email. This causes an external email
25842692
| --------- | ---- | -------- | ----------- |
25852693
| `transactionType` | string | Yes | Supported transaction type to email |
25862694
| `transactionId` | string | Yes | QuickBooks transaction ID |
2587-
| `recipient` | string | No | Optional single recipient override; otherwise QuickBooks uses the stored recipient |
2695+
| `recipient` | string | No | Required for Customer Payments; otherwise an optional single recipient override |
25882696
| `confirmSend` | boolean | Yes | Explicit confirmation that an external email should be sent |
25892697

25902698
#### Output

apps/sim/app/api/tools/quickbooks/documents.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,30 @@ describe('QuickBooks document API routes', () => {
153153
expect(String(mockFetch.mock.calls[0][0])).toContain('/invoice/A%2FB/pdf')
154154
})
155155

156+
it('accepts Payment through the canonical PDF route contract', async () => {
157+
mockFetch.mockResolvedValueOnce(
158+
new Response('%PDF-1.4 fixture', {
159+
headers: { 'content-type': 'application/pdf' },
160+
})
161+
)
162+
163+
const response = await downloadTransactionPdf(
164+
createMockRequest('POST', {
165+
...auth,
166+
transactionType: 'payment',
167+
transactionId: '42',
168+
})
169+
)
170+
171+
expect(response.status).toBe(200)
172+
await expect(response.json()).resolves.toMatchObject({
173+
success: true,
174+
output: { transactionType: 'payment', transactionId: '42' },
175+
})
176+
expect(mockFetch).toHaveBeenCalledTimes(1)
177+
expect(String(mockFetch.mock.calls[0][0])).toContain('/payment/42/pdf')
178+
})
179+
156180
it('rejects non-PDF and oversized PDF responses', async () => {
157181
mockFetch.mockResolvedValueOnce(
158182
new Response('not a PDF', { headers: { 'content-type': 'text/plain' } })

0 commit comments

Comments
 (0)