Skip to content

Commit 9db087d

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): document webhook event selectors
1 parent 6bee3b9 commit 9db087d

3 files changed

Lines changed: 69 additions & 21 deletions

File tree

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,6 +2933,7 @@ Trigger when selected Account events occur in QuickBooks
29332933
| Parameter | Type | Required | Description |
29342934
| --------- | ---- | -------- | ----------- |
29352935
| `triggerCredentials` | string | Yes | QuickBooks Account |
2936+
| `eventTypes` | string | Yes | Event Types |
29362937

29372938
#### Output
29382939

@@ -2962,6 +2963,7 @@ Trigger when selected Bill events occur in QuickBooks
29622963
| Parameter | Type | Required | Description |
29632964
| --------- | ---- | -------- | ----------- |
29642965
| `triggerCredentials` | string | Yes | QuickBooks Account |
2966+
| `eventTypes` | string | Yes | Event Types |
29652967

29662968
#### Output
29672969

@@ -2991,6 +2993,7 @@ Trigger when selected Bill Payment events occur in QuickBooks
29912993
| Parameter | Type | Required | Description |
29922994
| --------- | ---- | -------- | ----------- |
29932995
| `triggerCredentials` | string | Yes | QuickBooks Account |
2996+
| `eventTypes` | string | Yes | Event Types |
29942997

29952998
#### Output
29962999

@@ -3020,6 +3023,7 @@ Trigger when selected Budget events occur in QuickBooks
30203023
| Parameter | Type | Required | Description |
30213024
| --------- | ---- | -------- | ----------- |
30223025
| `triggerCredentials` | string | Yes | QuickBooks Account |
3026+
| `eventTypes` | string | Yes | Event Types |
30233027

30243028
#### Output
30253029

@@ -3049,6 +3053,7 @@ Trigger when selected Class events occur in QuickBooks
30493053
| Parameter | Type | Required | Description |
30503054
| --------- | ---- | -------- | ----------- |
30513055
| `triggerCredentials` | string | Yes | QuickBooks Account |
3056+
| `eventTypes` | string | Yes | Event Types |
30523057

30533058
#### Output
30543059

@@ -3078,6 +3083,7 @@ Trigger when selected Credit Memo events occur in QuickBooks
30783083
| Parameter | Type | Required | Description |
30793084
| --------- | ---- | -------- | ----------- |
30803085
| `triggerCredentials` | string | Yes | QuickBooks Account |
3086+
| `eventTypes` | string | Yes | Event Types |
30813087

30823088
#### Output
30833089

@@ -3107,6 +3113,7 @@ Trigger when selected Currency events occur in QuickBooks
31073113
| Parameter | Type | Required | Description |
31083114
| --------- | ---- | -------- | ----------- |
31093115
| `triggerCredentials` | string | Yes | QuickBooks Account |
3116+
| `eventTypes` | string | Yes | Event Types |
31103117

31113118
#### Output
31123119

@@ -3136,6 +3143,7 @@ Trigger when selected Customer events occur in QuickBooks
31363143
| Parameter | Type | Required | Description |
31373144
| --------- | ---- | -------- | ----------- |
31383145
| `triggerCredentials` | string | Yes | QuickBooks Account |
3146+
| `eventTypes` | string | Yes | Event Types |
31393147

31403148
#### Output
31413149

@@ -3165,6 +3173,7 @@ Trigger when selected Department events occur in QuickBooks
31653173
| Parameter | Type | Required | Description |
31663174
| --------- | ---- | -------- | ----------- |
31673175
| `triggerCredentials` | string | Yes | QuickBooks Account |
3176+
| `eventTypes` | string | Yes | Event Types |
31683177

31693178
#### Output
31703179

@@ -3194,6 +3203,7 @@ Trigger when selected Deposit events occur in QuickBooks
31943203
| Parameter | Type | Required | Description |
31953204
| --------- | ---- | -------- | ----------- |
31963205
| `triggerCredentials` | string | Yes | QuickBooks Account |
3206+
| `eventTypes` | string | Yes | Event Types |
31973207

31983208
#### Output
31993209

@@ -3223,6 +3233,7 @@ Trigger when selected Employee events occur in QuickBooks
32233233
| Parameter | Type | Required | Description |
32243234
| --------- | ---- | -------- | ----------- |
32253235
| `triggerCredentials` | string | Yes | QuickBooks Account |
3236+
| `eventTypes` | string | Yes | Event Types |
32263237

32273238
#### Output
32283239

@@ -3252,6 +3263,7 @@ Trigger when selected Estimate events occur in QuickBooks
32523263
| Parameter | Type | Required | Description |
32533264
| --------- | ---- | -------- | ----------- |
32543265
| `triggerCredentials` | string | Yes | QuickBooks Account |
3266+
| `eventTypes` | string | Yes | Event Types |
32553267

32563268
#### Output
32573269

@@ -3281,6 +3293,7 @@ Trigger when selected Invoice events occur in QuickBooks
32813293
| Parameter | Type | Required | Description |
32823294
| --------- | ---- | -------- | ----------- |
32833295
| `triggerCredentials` | string | Yes | QuickBooks Account |
3296+
| `eventTypes` | string | Yes | Event Types |
32843297

32853298
#### Output
32863299

@@ -3310,6 +3323,7 @@ Trigger when selected Item events occur in QuickBooks
33103323
| Parameter | Type | Required | Description |
33113324
| --------- | ---- | -------- | ----------- |
33123325
| `triggerCredentials` | string | Yes | QuickBooks Account |
3326+
| `eventTypes` | string | Yes | Event Types |
33133327

33143328
#### Output
33153329

@@ -3339,6 +3353,7 @@ Trigger when selected Journal Code events occur in QuickBooks
33393353
| Parameter | Type | Required | Description |
33403354
| --------- | ---- | -------- | ----------- |
33413355
| `triggerCredentials` | string | Yes | QuickBooks Account |
3356+
| `eventTypes` | string | Yes | Event Types |
33423357

33433358
#### Output
33443359

@@ -3368,6 +3383,7 @@ Trigger when selected Journal Entry events occur in QuickBooks
33683383
| Parameter | Type | Required | Description |
33693384
| --------- | ---- | -------- | ----------- |
33703385
| `triggerCredentials` | string | Yes | QuickBooks Account |
3386+
| `eventTypes` | string | Yes | Event Types |
33713387

33723388
#### Output
33733389

@@ -3397,6 +3413,7 @@ Trigger when selected Payment events occur in QuickBooks
33973413
| Parameter | Type | Required | Description |
33983414
| --------- | ---- | -------- | ----------- |
33993415
| `triggerCredentials` | string | Yes | QuickBooks Account |
3416+
| `eventTypes` | string | Yes | Event Types |
34003417

34013418
#### Output
34023419

@@ -3426,6 +3443,7 @@ Trigger when selected Payment Method events occur in QuickBooks
34263443
| Parameter | Type | Required | Description |
34273444
| --------- | ---- | -------- | ----------- |
34283445
| `triggerCredentials` | string | Yes | QuickBooks Account |
3446+
| `eventTypes` | string | Yes | Event Types |
34293447

34303448
#### Output
34313449

@@ -3484,6 +3502,7 @@ Trigger when selected Purchase events occur in QuickBooks
34843502
| Parameter | Type | Required | Description |
34853503
| --------- | ---- | -------- | ----------- |
34863504
| `triggerCredentials` | string | Yes | QuickBooks Account |
3505+
| `eventTypes` | string | Yes | Event Types |
34873506

34883507
#### Output
34893508

@@ -3513,6 +3532,7 @@ Trigger when selected Purchase Order events occur in QuickBooks
35133532
| Parameter | Type | Required | Description |
35143533
| --------- | ---- | -------- | ----------- |
35153534
| `triggerCredentials` | string | Yes | QuickBooks Account |
3535+
| `eventTypes` | string | Yes | Event Types |
35163536

35173537
#### Output
35183538

@@ -3542,6 +3562,7 @@ Trigger when selected Refund Receipt events occur in QuickBooks
35423562
| Parameter | Type | Required | Description |
35433563
| --------- | ---- | -------- | ----------- |
35443564
| `triggerCredentials` | string | Yes | QuickBooks Account |
3565+
| `eventTypes` | string | Yes | Event Types |
35453566

35463567
#### Output
35473568

@@ -3571,6 +3592,7 @@ Trigger when selected Sales Receipt events occur in QuickBooks
35713592
| Parameter | Type | Required | Description |
35723593
| --------- | ---- | -------- | ----------- |
35733594
| `triggerCredentials` | string | Yes | QuickBooks Account |
3595+
| `eventTypes` | string | Yes | Event Types |
35743596

35753597
#### Output
35763598

@@ -3600,6 +3622,7 @@ Trigger when selected Tax Agency events occur in QuickBooks
36003622
| Parameter | Type | Required | Description |
36013623
| --------- | ---- | -------- | ----------- |
36023624
| `triggerCredentials` | string | Yes | QuickBooks Account |
3625+
| `eventTypes` | string | Yes | Event Types |
36033626

36043627
#### Output
36053628

@@ -3629,6 +3652,7 @@ Trigger when selected Term events occur in QuickBooks
36293652
| Parameter | Type | Required | Description |
36303653
| --------- | ---- | -------- | ----------- |
36313654
| `triggerCredentials` | string | Yes | QuickBooks Account |
3655+
| `eventTypes` | string | Yes | Event Types |
36323656

36333657
#### Output
36343658

@@ -3658,6 +3682,7 @@ Trigger when selected Time Activity events occur in QuickBooks
36583682
| Parameter | Type | Required | Description |
36593683
| --------- | ---- | -------- | ----------- |
36603684
| `triggerCredentials` | string | Yes | QuickBooks Account |
3685+
| `eventTypes` | string | Yes | Event Types |
36613686

36623687
#### Output
36633688

@@ -3687,6 +3712,7 @@ Trigger when selected Transfer events occur in QuickBooks
36873712
| Parameter | Type | Required | Description |
36883713
| --------- | ---- | -------- | ----------- |
36893714
| `triggerCredentials` | string | Yes | QuickBooks Account |
3715+
| `eventTypes` | string | Yes | Event Types |
36903716

36913717
#### Output
36923718

@@ -3716,6 +3742,7 @@ Trigger when selected Vendor Credit events occur in QuickBooks
37163742
| Parameter | Type | Required | Description |
37173743
| --------- | ---- | -------- | ----------- |
37183744
| `triggerCredentials` | string | Yes | QuickBooks Account |
3745+
| `eventTypes` | string | Yes | Event Types |
37193746

37203747
#### Output
37213748

@@ -3745,6 +3772,7 @@ Trigger when selected Vendor events occur in QuickBooks
37453772
| Parameter | Type | Required | Description |
37463773
| --------- | ---- | -------- | ----------- |
37473774
| `triggerCredentials` | string | Yes | QuickBooks Account |
3775+
| `eventTypes` | string | Yes | Event Types |
37483776

37493777
#### Output
37503778

apps/sim/triggers/quickbooks/preferences_updated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { QuickBooksIcon } from '@/components/icons'
22
import {
3+
buildQuickBooksSingleEventTriggerSubBlocks,
34
buildQuickBooksTriggerOutputs,
4-
buildQuickBooksTriggerSubBlocks,
55
QUICKBOOKS_WEBHOOK_HEADERS,
66
} from '@/triggers/quickbooks/utils'
77
import type { TriggerConfig } from '@/triggers/types'
@@ -13,7 +13,7 @@ export const quickBooksPreferencesUpdatedTrigger: TriggerConfig = {
1313
description: 'Trigger when QuickBooks Preferences are updated',
1414
version: '1.0.0',
1515
icon: QuickBooksIcon,
16-
subBlocks: buildQuickBooksTriggerSubBlocks('quickbooks_preferences_updated'),
16+
subBlocks: buildQuickBooksSingleEventTriggerSubBlocks('quickbooks_preferences_updated'),
1717
outputs: buildQuickBooksTriggerOutputs(),
1818
webhook: { method: 'POST', headers: { ...QUICKBOOKS_WEBHOOK_HEADERS } },
1919
}

apps/sim/triggers/quickbooks/utils.ts

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -312,24 +312,45 @@ export function buildQuickBooksTriggerSubBlocks(triggerId: string): SubBlockConf
312312
const definition = getQuickBooksTriggerDefinition(triggerId)
313313
if (!definition) throw new Error(`Unknown QuickBooks trigger: ${triggerId}`)
314314

315-
const eventTypes: SubBlockConfig[] =
316-
definition.actions.length === 1
317-
? []
318-
: [
319-
{
320-
id: 'eventTypes',
321-
title: 'Event Types',
322-
type: 'dropdown',
323-
multiSelect: true,
324-
options: definition.actions.map((action) => ({
325-
label: action.charAt(0).toUpperCase() + action.slice(1),
326-
id: action,
327-
})),
328-
mode: 'trigger',
329-
required: true,
330-
condition: { field: 'selectedTriggerId', value: triggerId },
331-
},
332-
]
315+
return [
316+
{
317+
id: 'triggerCredentials',
318+
title: 'QuickBooks Account',
319+
type: 'oauth-input',
320+
serviceId: 'quickbooks',
321+
requiredScopes: getScopesForService('quickbooks'),
322+
mode: 'trigger',
323+
required: true,
324+
condition: { field: 'selectedTriggerId', value: triggerId },
325+
},
326+
{
327+
id: 'eventTypes',
328+
title: 'Event Types',
329+
type: 'dropdown',
330+
multiSelect: true,
331+
options: definition.actions.map((action) => ({
332+
label: action.charAt(0).toUpperCase() + action.slice(1),
333+
id: action,
334+
})),
335+
mode: 'trigger',
336+
required: true,
337+
condition: { field: 'selectedTriggerId', value: triggerId },
338+
},
339+
{
340+
id: 'triggerInstructions',
341+
title: 'Setup Instructions',
342+
hideFromPreview: true,
343+
type: 'text',
344+
defaultValue: quickBooksSetupInstructions(definition.label),
345+
mode: 'trigger',
346+
condition: { field: 'selectedTriggerId', value: triggerId },
347+
},
348+
]
349+
}
350+
351+
export function buildQuickBooksSingleEventTriggerSubBlocks(triggerId: string): SubBlockConfig[] {
352+
const definition = getQuickBooksTriggerDefinition(triggerId)
353+
if (!definition) throw new Error(`Unknown QuickBooks trigger: ${triggerId}`)
333354

334355
return [
335356
{
@@ -342,7 +363,6 @@ export function buildQuickBooksTriggerSubBlocks(triggerId: string): SubBlockConf
342363
required: true,
343364
condition: { field: 'selectedTriggerId', value: triggerId },
344365
},
345-
...eventTypes,
346366
{
347367
id: 'triggerInstructions',
348368
title: 'Setup Instructions',

0 commit comments

Comments
 (0)