Hosted setup flow
Create an end-user, create a setup link, and send it to the person who runs QuickBooks. Crossblade’s hosted page walks them through Web Connector on Windows and confirms the company file by itself.
Step 1: Create an end-user
Create one end-user per company file, with a read + write key. Use your own customer or workspace ID as sourceId; it must be unique in the project.
const endUser = await client.endUsers.create({
companyName: "Blue Sky Distribution",
sourceId: "customer_842",
email: "[email protected]",
});
// Store endUser.id with your customer record.
Step 2: Create a setup link
The API calls a setup link an auth session. It needs your project’s publishable key. linkExpiryMins accepts 15 to 10080 (seven days); the default is 30. redirectUrl is optional.
const session = await client.authSessions.create({
publishableKey: process.env.CROSSBLADE_PUBLISHABLE_KEY!,
endUserId: endUser.id,
linkExpiryMins: 1440, // 24 hours for an emailed link
redirectUrl: "https://app.example.com/settings/quickbooks?company=customer_842",
});
session.authFlowUrl; // the setup link: send it to whoever runs QuickBooks
session.expiresAt; // ISO timestamp
Step 3: Send the link
- In your app: show a “Connect QuickBooks Desktop” button that opens
authFlowUrlin a new tab. Say that it must be opened on the Windows computer that runs QuickBooks; the hosted page spots other devices and offers to send the link on. - By email: many of your users will pass the task to a bookkeeper or IT person. Use a longer
linkExpiryMins, for example 1440 to 4320, and link to the setup guide in your email. - From the dashboard: for manual onboarding, create the link in Connections and copy it or email it from there.
The link contains a secret and can show this company’s connection password. Do not log it, put it in analytics, or send it to anyone except the person who runs QuickBooks for that company.
Step 4: Your customer finishes setup on Windows
The hosted page has five steps: Before you start, Download the connection file, Approve access in QuickBooks, Enter the connection password and Connecting. On a Mac or phone it first offers to send the link to the Windows computer. It watches for Web Connector to sign in, then confirms access by reading the company’s details from QuickBooks. That check appears in your request log as SETUP /setup/verify-company.
The customer-facing walkthrough is Connect QuickBooks Desktop to Crossblade. Link to the help center from your own UI as well.
Step 5: Redirect and confirm
After verification, the success screen shows a Return to … button, named after the host of redirectUrl, that links to redirectUrl exactly as you supplied it. Put your own context in that URL. The redirect is navigation only; do not treat it as proof of success.
When the user lands back in your app, confirm with the health check, then start syncing. See Connection status.
await client.qbd.healthCheck({ conductorEndUserId: endUser.id });
// 200: QuickBooks answered. Mark the integration connected.
Step 6: Expiry and re-issuing
- An expired link cannot be reopened. Create a new setup link for the same end-user. Never create a second end-user for the same company file; that creates a separate connection and a second Web Connector row.
- Link expiry does not affect a connection that already works. Links are only for setup and repair.
- A new link for an existing connection lets the customer reinstall the same connection file and see its password again until that link is verified.
- If the company file moved permanently, replace the connection deliberately after reconciling in-flight work; a new link does not change the pinned file.