Skip to content

Commit b6bf2bb

Browse files
committed
feat(quickbooks): finalize credential-scoped webhook triggers
1 parent 1889331 commit b6bf2bb

77 files changed

Lines changed: 1367 additions & 1268 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
1111
/>
1212

1313
{/* MANUAL-CONTENT-START:intro */}
14-
Connect one QuickBooks Online company per credential. Create an app in the Intuit Developer Portal, register `https://<your-sim-host>/api/auth/oauth2/callback/quickbooks` as its redirect URI, then enter that app's client ID and client secret in Sim and select its Sandbox or Production environment. Sim encrypts this app configuration on the credential and uses it for authorization, refresh, and revocation.
14+
Connect one QuickBooks Online company per credential. Create an app in the Intuit Developer Portal, register `https://<your-sim-host>/api/auth/oauth2/callback/quickbooks` as its redirect URI, then enter that app's client ID, client secret, and webhook verifier token in Sim and select its Sandbox or Production environment. Sim encrypts this app configuration on the credential and uses it for authorization, refresh, revocation, and webhook signature verification.
1515

1616
During OAuth, choose the company that the workflow should access. Intuit returns the realm ID in the callback, and Sim verifies that the issued token can read CompanyInfo through that company-scoped API path before binding it to the credential, so you do not enter a realm ID or API host. The `CompanyInfo.Id` field is a separate entity ID and is not used as the realm ID.
1717

@@ -21,6 +21,8 @@ QuickBooks update actions require the record ID and its current `SyncToken`; pro
2121

2222
Sandbox credentials call only Intuit's sandbox API and are suitable for disposable test data. Production credentials call the production API and affect the selected live company.
2323

24+
QuickBooks triggers use Intuit's app-level webhook model. After adding a trigger and deploying the workflow once, copy the generated Webhook URL from the block into the matching Development or Production Webhooks settings for the same Intuit app. Enable the CloudEvents payload format and select every entity and operation needed by your deployed workflows. One Intuit endpoint can serve multiple connected companies; Sim verifies the raw-body `intuit-signature` with that app's encrypted verifier token and routes each event by both Intuit app and OAuth-derived realm ID.
25+
2426
Run Financial Report exposes verified financial statements, aging, balance, sales, and expense reports while preserving QuickBooks' native columns and nested rows. Advanced controls appear only where QuickBooks supports them. Use Read Master Data to discover customer, vendor, account, item, class, and department IDs for report filters. Intuit recommends report periods of six months or less for performance, though Sim does not forbid longer accounting periods.
2527

2628
Document actions can read attachment metadata, add one File or Note attachment, download an attachment file, and download supported transactions as PDFs. Downloaded files are stored as Sim files for downstream blocks. Attachment deletion, bulk upload/download, and bulk email remain outside this version of the block.
@@ -2973,7 +2975,7 @@ Trigger when selected Account events occur in QuickBooks
29732975
| Parameter | Type | Required | Description |
29742976
| --------- | ---- | -------- | ----------- |
29752977
| `triggerCredentials` | string | Yes | QuickBooks Account |
2976-
| `eventTypes` | string | Yes | Event Types |
2978+
| `eventTypes_quickbooks_account_events` | string | Yes | Event Types |
29772979

29782980
#### Output
29792981

@@ -3003,7 +3005,7 @@ Trigger when selected Bill events occur in QuickBooks
30033005
| Parameter | Type | Required | Description |
30043006
| --------- | ---- | -------- | ----------- |
30053007
| `triggerCredentials` | string | Yes | QuickBooks Account |
3006-
| `eventTypes` | string | Yes | Event Types |
3008+
| `eventTypes_quickbooks_bill_events` | string | Yes | Event Types |
30073009

30083010
#### Output
30093011

@@ -3033,7 +3035,7 @@ Trigger when selected Bill Payment events occur in QuickBooks
30333035
| Parameter | Type | Required | Description |
30343036
| --------- | ---- | -------- | ----------- |
30353037
| `triggerCredentials` | string | Yes | QuickBooks Account |
3036-
| `eventTypes` | string | Yes | Event Types |
3038+
| `eventTypes_quickbooks_bill_payment_events` | string | Yes | Event Types |
30373039

30383040
#### Output
30393041

@@ -3063,7 +3065,7 @@ Trigger when selected Budget events occur in QuickBooks
30633065
| Parameter | Type | Required | Description |
30643066
| --------- | ---- | -------- | ----------- |
30653067
| `triggerCredentials` | string | Yes | QuickBooks Account |
3066-
| `eventTypes` | string | Yes | Event Types |
3068+
| `eventTypes_quickbooks_budget_events` | string | Yes | Event Types |
30673069

30683070
#### Output
30693071

@@ -3093,7 +3095,7 @@ Trigger when selected Class events occur in QuickBooks
30933095
| Parameter | Type | Required | Description |
30943096
| --------- | ---- | -------- | ----------- |
30953097
| `triggerCredentials` | string | Yes | QuickBooks Account |
3096-
| `eventTypes` | string | Yes | Event Types |
3098+
| `eventTypes_quickbooks_class_events` | string | Yes | Event Types |
30973099

30983100
#### Output
30993101

@@ -3123,7 +3125,7 @@ Trigger when selected Credit Memo events occur in QuickBooks
31233125
| Parameter | Type | Required | Description |
31243126
| --------- | ---- | -------- | ----------- |
31253127
| `triggerCredentials` | string | Yes | QuickBooks Account |
3126-
| `eventTypes` | string | Yes | Event Types |
3128+
| `eventTypes_quickbooks_credit_memo_events` | string | Yes | Event Types |
31273129

31283130
#### Output
31293131

@@ -3153,7 +3155,7 @@ Trigger when selected Currency events occur in QuickBooks
31533155
| Parameter | Type | Required | Description |
31543156
| --------- | ---- | -------- | ----------- |
31553157
| `triggerCredentials` | string | Yes | QuickBooks Account |
3156-
| `eventTypes` | string | Yes | Event Types |
3158+
| `eventTypes_quickbooks_currency_events` | string | Yes | Event Types |
31573159

31583160
#### Output
31593161

@@ -3183,7 +3185,7 @@ Trigger when selected Customer events occur in QuickBooks
31833185
| Parameter | Type | Required | Description |
31843186
| --------- | ---- | -------- | ----------- |
31853187
| `triggerCredentials` | string | Yes | QuickBooks Account |
3186-
| `eventTypes` | string | Yes | Event Types |
3188+
| `eventTypes_quickbooks_customer_events` | string | Yes | Event Types |
31873189

31883190
#### Output
31893191

@@ -3213,7 +3215,7 @@ Trigger when selected Department events occur in QuickBooks
32133215
| Parameter | Type | Required | Description |
32143216
| --------- | ---- | -------- | ----------- |
32153217
| `triggerCredentials` | string | Yes | QuickBooks Account |
3216-
| `eventTypes` | string | Yes | Event Types |
3218+
| `eventTypes_quickbooks_department_events` | string | Yes | Event Types |
32173219

32183220
#### Output
32193221

@@ -3243,7 +3245,7 @@ Trigger when selected Deposit events occur in QuickBooks
32433245
| Parameter | Type | Required | Description |
32443246
| --------- | ---- | -------- | ----------- |
32453247
| `triggerCredentials` | string | Yes | QuickBooks Account |
3246-
| `eventTypes` | string | Yes | Event Types |
3248+
| `eventTypes_quickbooks_deposit_events` | string | Yes | Event Types |
32473249

32483250
#### Output
32493251

@@ -3273,7 +3275,7 @@ Trigger when selected Employee events occur in QuickBooks
32733275
| Parameter | Type | Required | Description |
32743276
| --------- | ---- | -------- | ----------- |
32753277
| `triggerCredentials` | string | Yes | QuickBooks Account |
3276-
| `eventTypes` | string | Yes | Event Types |
3278+
| `eventTypes_quickbooks_employee_events` | string | Yes | Event Types |
32773279

32783280
#### Output
32793281

@@ -3303,7 +3305,7 @@ Trigger when selected Estimate events occur in QuickBooks
33033305
| Parameter | Type | Required | Description |
33043306
| --------- | ---- | -------- | ----------- |
33053307
| `triggerCredentials` | string | Yes | QuickBooks Account |
3306-
| `eventTypes` | string | Yes | Event Types |
3308+
| `eventTypes_quickbooks_estimate_events` | string | Yes | Event Types |
33073309

33083310
#### Output
33093311

@@ -3333,7 +3335,7 @@ Trigger when selected Invoice events occur in QuickBooks
33333335
| Parameter | Type | Required | Description |
33343336
| --------- | ---- | -------- | ----------- |
33353337
| `triggerCredentials` | string | Yes | QuickBooks Account |
3336-
| `eventTypes` | string | Yes | Event Types |
3338+
| `eventTypes_quickbooks_invoice_events` | string | Yes | Event Types |
33373339

33383340
#### Output
33393341

@@ -3363,7 +3365,7 @@ Trigger when selected Item events occur in QuickBooks
33633365
| Parameter | Type | Required | Description |
33643366
| --------- | ---- | -------- | ----------- |
33653367
| `triggerCredentials` | string | Yes | QuickBooks Account |
3366-
| `eventTypes` | string | Yes | Event Types |
3368+
| `eventTypes_quickbooks_item_events` | string | Yes | Event Types |
33673369

33683370
#### Output
33693371

@@ -3393,7 +3395,7 @@ Trigger when selected Journal Code events occur in QuickBooks
33933395
| Parameter | Type | Required | Description |
33943396
| --------- | ---- | -------- | ----------- |
33953397
| `triggerCredentials` | string | Yes | QuickBooks Account |
3396-
| `eventTypes` | string | Yes | Event Types |
3398+
| `eventTypes_quickbooks_journal_code_events` | string | Yes | Event Types |
33973399

33983400
#### Output
33993401

@@ -3423,7 +3425,7 @@ Trigger when selected Journal Entry events occur in QuickBooks
34233425
| Parameter | Type | Required | Description |
34243426
| --------- | ---- | -------- | ----------- |
34253427
| `triggerCredentials` | string | Yes | QuickBooks Account |
3426-
| `eventTypes` | string | Yes | Event Types |
3428+
| `eventTypes_quickbooks_journal_entry_events` | string | Yes | Event Types |
34273429

34283430
#### Output
34293431

@@ -3453,7 +3455,7 @@ Trigger when selected Payment events occur in QuickBooks
34533455
| Parameter | Type | Required | Description |
34543456
| --------- | ---- | -------- | ----------- |
34553457
| `triggerCredentials` | string | Yes | QuickBooks Account |
3456-
| `eventTypes` | string | Yes | Event Types |
3458+
| `eventTypes_quickbooks_payment_events` | string | Yes | Event Types |
34573459

34583460
#### Output
34593461

@@ -3483,7 +3485,7 @@ Trigger when selected Payment Method events occur in QuickBooks
34833485
| Parameter | Type | Required | Description |
34843486
| --------- | ---- | -------- | ----------- |
34853487
| `triggerCredentials` | string | Yes | QuickBooks Account |
3486-
| `eventTypes` | string | Yes | Event Types |
3488+
| `eventTypes_quickbooks_payment_method_events` | string | Yes | Event Types |
34873489

34883490
#### Output
34893491

@@ -3542,7 +3544,7 @@ Trigger when selected Purchase events occur in QuickBooks
35423544
| Parameter | Type | Required | Description |
35433545
| --------- | ---- | -------- | ----------- |
35443546
| `triggerCredentials` | string | Yes | QuickBooks Account |
3545-
| `eventTypes` | string | Yes | Event Types |
3547+
| `eventTypes_quickbooks_purchase_events` | string | Yes | Event Types |
35463548

35473549
#### Output
35483550

@@ -3572,7 +3574,7 @@ Trigger when selected Purchase Order events occur in QuickBooks
35723574
| Parameter | Type | Required | Description |
35733575
| --------- | ---- | -------- | ----------- |
35743576
| `triggerCredentials` | string | Yes | QuickBooks Account |
3575-
| `eventTypes` | string | Yes | Event Types |
3577+
| `eventTypes_quickbooks_purchase_order_events` | string | Yes | Event Types |
35763578

35773579
#### Output
35783580

@@ -3602,7 +3604,7 @@ Trigger when selected Refund Receipt events occur in QuickBooks
36023604
| Parameter | Type | Required | Description |
36033605
| --------- | ---- | -------- | ----------- |
36043606
| `triggerCredentials` | string | Yes | QuickBooks Account |
3605-
| `eventTypes` | string | Yes | Event Types |
3607+
| `eventTypes_quickbooks_refund_receipt_events` | string | Yes | Event Types |
36063608

36073609
#### Output
36083610

@@ -3632,7 +3634,7 @@ Trigger when selected Sales Receipt events occur in QuickBooks
36323634
| Parameter | Type | Required | Description |
36333635
| --------- | ---- | -------- | ----------- |
36343636
| `triggerCredentials` | string | Yes | QuickBooks Account |
3635-
| `eventTypes` | string | Yes | Event Types |
3637+
| `eventTypes_quickbooks_sales_receipt_events` | string | Yes | Event Types |
36363638

36373639
#### Output
36383640

@@ -3662,7 +3664,7 @@ Trigger when selected Tax Agency events occur in QuickBooks
36623664
| Parameter | Type | Required | Description |
36633665
| --------- | ---- | -------- | ----------- |
36643666
| `triggerCredentials` | string | Yes | QuickBooks Account |
3665-
| `eventTypes` | string | Yes | Event Types |
3667+
| `eventTypes_quickbooks_tax_agency_events` | string | Yes | Event Types |
36663668

36673669
#### Output
36683670

@@ -3692,7 +3694,7 @@ Trigger when selected Term events occur in QuickBooks
36923694
| Parameter | Type | Required | Description |
36933695
| --------- | ---- | -------- | ----------- |
36943696
| `triggerCredentials` | string | Yes | QuickBooks Account |
3695-
| `eventTypes` | string | Yes | Event Types |
3697+
| `eventTypes_quickbooks_term_events` | string | Yes | Event Types |
36963698

36973699
#### Output
36983700

@@ -3722,7 +3724,7 @@ Trigger when selected Time Activity events occur in QuickBooks
37223724
| Parameter | Type | Required | Description |
37233725
| --------- | ---- | -------- | ----------- |
37243726
| `triggerCredentials` | string | Yes | QuickBooks Account |
3725-
| `eventTypes` | string | Yes | Event Types |
3727+
| `eventTypes_quickbooks_time_activity_events` | string | Yes | Event Types |
37263728

37273729
#### Output
37283730

@@ -3752,7 +3754,7 @@ Trigger when selected Transfer events occur in QuickBooks
37523754
| Parameter | Type | Required | Description |
37533755
| --------- | ---- | -------- | ----------- |
37543756
| `triggerCredentials` | string | Yes | QuickBooks Account |
3755-
| `eventTypes` | string | Yes | Event Types |
3757+
| `eventTypes_quickbooks_transfer_events` | string | Yes | Event Types |
37563758

37573759
#### Output
37583760

@@ -3782,7 +3784,7 @@ Trigger when selected Vendor Credit events occur in QuickBooks
37823784
| Parameter | Type | Required | Description |
37833785
| --------- | ---- | -------- | ----------- |
37843786
| `triggerCredentials` | string | Yes | QuickBooks Account |
3785-
| `eventTypes` | string | Yes | Event Types |
3787+
| `eventTypes_quickbooks_vendor_credit_events` | string | Yes | Event Types |
37863788

37873789
#### Output
37883790

@@ -3812,7 +3814,7 @@ Trigger when selected Vendor events occur in QuickBooks
38123814
| Parameter | Type | Required | Description |
38133815
| --------- | ---- | -------- | ----------- |
38143816
| `triggerCredentials` | string | Yes | QuickBooks Account |
3815-
| `eventTypes` | string | Yes | Event Types |
3817+
| `eventTypes_quickbooks_vendor_events` | string | Yes | Event Types |
38163818

38173819
#### Output
38183820

apps/docs/openapi-v2-resources.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8012,9 +8012,15 @@
80128012
"type": "string",
80138013
"enum": ["sandbox", "production"],
80148014
"description": "Intuit company environment used for authorization and API requests."
8015+
},
8016+
"webhookVerifierToken": {
8017+
"type": "string",
8018+
"minLength": 1,
8019+
"maxLength": 512,
8020+
"description": "Write-only verifier token for webhook signatures from the caller-managed app."
80158021
}
80168022
},
8017-
"required": ["clientId", "clientSecret", "environment"],
8023+
"required": ["clientId", "clientSecret", "environment", "webhookVerifierToken"],
80188024
"additionalProperties": false
80198025
}
80208026
},
@@ -8056,9 +8062,15 @@
80568062
"type": "string",
80578063
"enum": ["sandbox", "production"],
80588064
"description": "Intuit company environment used for authorization and API requests."
8065+
},
8066+
"webhookVerifierToken": {
8067+
"type": "string",
8068+
"minLength": 1,
8069+
"maxLength": 512,
8070+
"description": "Write-only verifier token for webhook signatures from the caller-managed app."
80598071
}
80608072
},
8061-
"required": ["clientId", "clientSecret", "environment"],
8073+
"required": ["clientId", "clientSecret", "environment", "webhookVerifierToken"],
80628074
"additionalProperties": false
80638075
}
80648076
},

apps/sim/app/api/auth/oauth/token/route.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ describe('OAuth Token API Routes', () => {
108108
accountId: createQuickBooksAccountId(
109109
'123456789',
110110
'intuit-subject-01234567-89ab-4def-8abc-0123456789ab',
111-
'sandbox'
111+
{
112+
clientId: 'client-id',
113+
environment: 'sandbox',
114+
}
112115
),
113116
accessToken: 'test-token',
114117
refreshToken: 'refresh-token',

apps/sim/app/api/auth/oauth2/authorize/route.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ describe('OAuth2 authorize route', () => {
114114
clientId: 'intuit-client-id',
115115
clientSecret: 'intuit-client-secret',
116116
environment: 'sandbox',
117+
webhookVerifierToken: 'verifier-token',
117118
})
118119
mocks.createQuickBooksState.mockReturnValue('signed-state')
119120
})

0 commit comments

Comments
 (0)