Skip to content

Commit b1be51d

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
docs(quickbooks): add webhook setup guidance
1 parent 3f58594 commit b1be51d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

apps/sim/triggers/quickbooks/utils.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ export function isQuickBooksEventMatch(
115115
return Array.isArray(selectedActions) && selectedActions.includes(parsed.action)
116116
}
117117

118+
function quickBooksSetupInstructions(entityLabel: string): string {
119+
const instructions = [
120+
'<strong>App setup:</strong> A Sim operator must register <code>https://&lt;your-sim-domain&gt;/api/webhooks/quickbooks</code> as the app-level endpoint in the Intuit Developer Portal and configure the server-only <code>QUICKBOOKS_WEBHOOK_VERIFIER_TOKEN</code>.',
121+
'Connect the <strong>QuickBooks account</strong> whose company should receive these events.',
122+
`Select the <strong>${entityLabel}</strong> actions this workflow should handle.`,
123+
'<strong>Deploy</strong> the workflow to activate the trigger.',
124+
]
125+
126+
return instructions
127+
.map(
128+
(instruction, index) =>
129+
`<div class="mb-3">${index === 0 ? instruction : `<strong>${index}.</strong> ${instruction}`}</div>`
130+
)
131+
.join('')
132+
}
133+
118134
export function buildQuickBooksTriggerSubBlocks(triggerId: string): SubBlockConfig[] {
119135
const definition = getQuickBooksTriggerDefinition(triggerId)
120136
if (!definition) throw new Error(`Unknown QuickBooks trigger: ${triggerId}`)
@@ -143,6 +159,15 @@ export function buildQuickBooksTriggerSubBlocks(triggerId: string): SubBlockConf
143159
required: true,
144160
condition: { field: 'selectedTriggerId', value: triggerId },
145161
},
162+
{
163+
id: 'triggerInstructions',
164+
title: 'Setup Instructions',
165+
hideFromPreview: true,
166+
type: 'text',
167+
defaultValue: quickBooksSetupInstructions(definition.label),
168+
mode: 'trigger',
169+
condition: { field: 'selectedTriggerId', value: triggerId },
170+
},
146171
]
147172
}
148173

0 commit comments

Comments
 (0)