Skip to main content
The onboarding page for My App Dev: step 1, Get QuickBooks ready, done, and step 2, Add My App Dev to the Web Connector, open with Download setup file and the Web Connector's two prompts, each a screenshot beside the answer to give

The onboarding page your customer sees, with your app's name.

Add the “Connect to QuickBooks” button

1

Create the connection

When your customer clicks the button, create a connection for them. Name it after their company, and pass the webhook_url QuBe Sync tells when they’re connected.Store the connection’s id against the customer’s account. You’ll use it for every request. Until it’s connected, show the account as waiting for QuickBooks. In a production app, the call is refused with 402 billing_required until your organization has billing (Going live).
Pass type when you create the connection:If your app runs workflows, create its connections with "type": "realtime": a workflow run on a standard connection is refused with realtime_required (see Workflows run on realtime connections), and the API can’t change a connection’s type afterwards.Realtime connections are billed at a higher rate; see pricing.Every connection’s Web Connector is set to run every 10 seconds, and QuBe Sync tells a standard connection’s to wait, so its Last Result often reads “Update postponed by application”. That’s normal. Your customer shouldn’t change the “Every Min” field (leave it blank) in the Web Connector, no matter which type is chosen. This also lets you switch a connection’s type later without installing a new QWC file.
2

Send them to onboarding

Redirect the browser to the connection’s links.onboarding. Ask your customer to do this on the Windows computer where QuickBooks is installed. If they use a QuickBooks server, that machine is best.If they open it somewhere else, like a phone, a Mac or another PC, the page shows them a short code. They enter it at qubesync.com/go on the QuickBooks computer and carry on there, so your app doesn’t need to handle that case.
A card headed Open this on the QuickBooks computer: on that computer, go to qubesync.com/go and enter this code, an eight-character code in large type, good for 15 minutes and works once, and a Share link for setting it up later or for someone else

Opened on the wrong computer, the page shows a code to enter on the QuickBooks computer.

3

Know when they're connected

When the Web Connector checks in for the first time, QuBe Sync POSTs connection.connected to the connection’s webhook_url. That’s your signal to mark the account connected and start syncing.
connection.connected
Find the account by connection.id, the id you saved. The same URL hears the rest of the connection’s events (Connection events has them all):The setup ends on the QuickBooks computer, which usually isn’t signed in to your app, and with a setup code it isn’t even the computer where they clicked Connect. So the onboarding page doesn’t send them back to your app: when it’s done, it tells them QuickBooks is connected and that they can close it. The webhook is how your app knows. Nothing has to wait for it: runs you start before the Web Connector connects wait in the queue.An onboarding link lasts 48 hours. One opened after that tells your customer to start again from your app, which regenerates the link when they click the button. A simulated connection is connected as it’s made, so its connection.connected comes as soon as POST /connections returns: test your handler with one.
In code, using the small API helper from Making requests:

Keep an eye on the connection

Showing your customer their connection status can help them self-diagnose why they’re still waiting on a request. When their web connector hasn’t been heard from, the connection’s webhook_url receives connection.stalled (and connection.resumed once it’s polling again; see Connection events). Its connection.stall_reason tells you what to tell your customer. not_checking_in means the Web Connector hasn’t checked in when it was due (by the longer of 15 minutes and twice its schedule), so turn on the QuickBooks computer and check the Web Connector. quickbooks_unavailable means it is checking in but can’t reach QuickBooks (when the app was allowed to run with QuickBooks closed, the Web Connector opens it itself, so this usually means a dialog or the wrong company file), so open QuickBooks with the correct company file.

Setting a connection up again

If QuickBooks moves to another computer, or your customer’s Web Connector entry was removed, send them to the connection’s onboarding link again (regenerate it if it’s more than 48 hours old). The page tells them the connection is already set up, and offers Set up again. Choosing it changes the connection’s password at once, so the old Web Connector entry is turned away (“Invalid password for username”). Until the new setup is done, requests wait and last_connected_at stays at the old entry’s last check-in. When the new entry checks in, the webhook_url hears connection.connected again, with connection.setup set to again.

Using a different company file

A connection stays with the first company file the Web Connector opens for it: a request from another file waits as retryable, with a user_message saying so. When your customer really is moving to another file (a new file after a year-end rebuild, a restored copy, a file renamed or moved, or the wrong file picked at setup), the same onboarding link offers Use a different company file beside Set up again. The connection’s links.company_file opens that page directly. It carries the onboarding link’s token, so it expires with it, and regenerating the onboarding URL renews both. It’s null for a simulated connection. The page shows any pending work on the old company file and lets them wait for it to finish or switch immediately. Make sure your connection has a webhook_url so it will be notified about the changes. Switching does what Set up again does, and the connection also forgets its company file: the first request after the new setup learns the one that’s open. It:
  • sends connection.company_file_changed to the connection’s webhook_url. The QuickBooks ids you stored for the connection (list_id, txn_id, edit_sequence) are the old file’s, so stop using them. The new file is often the same company, renamed, moved or copied, and keeps most of them: once the connection is connected again, query the new file by those ids, keep each it finds under the same name (with its new edit_sequence), ask your customer about each it finds under another name, and treat the rest as not in QuickBooks;
  • ends your requests still waiting with error, each with its webhook, and cancels the connection’s live workflow runs (workflow_run.cancelled). They were written for the old file. Requests the Web Connector had already taken finish there if it sends them; any it stops without sending end with error too;
  • sends connection.connected, with connection.setup set to again, once the new setup checks in.

When a customer leaves

Delete the connection and ask your customer to remove your app from their Web Connector (select it, then Remove). Until your app is removed, the Web Connector keeps checking in on its own.

Build your own onboarding

If you’d rather keep your customer inside your app, skip links.onboarding and give them the two things the Web Connector needs yourself:
1

The QWC file

POST /connections/{id}/qwc returns it. Offer it as a download. QuickBooks has to be open with the company file when they add it. A company file takes a connection’s setup file once: adding one again is refused with QBWC1039 until the first is cleared, so beside the download, link Common problems for the customer who sees that.
2

A password

POST /connections/{id}/password generates one, or sets one you choose. They paste it into the Web Connector after adding the QWC file.
Tell them to leave Auto-Run ticked and not to change the schedule (the Every Min column, which is blank for a QuBe Sync entry). QuBe Sync decides how often a connection checks in, so editing it only breaks that. The connection is live when its webhook_url hears connection.connected, the moment last_connected_at is set.