Create test workspace

Connection status

QuickBooks Desktop answers only while the customer’s Windows computer runs Web Connector. Use the health check to learn why a company is unavailable, and show the customer a plain-language fix.

What an offline company looks like

Every request waits in its company’s queue for Web Connector. If Web Connector doesn’t check in before the deadline (Conductor-Timeout-Seconds, 90 by default), the request fails with 504 QBD_REQUEST_EXPIRED. QuickBooks never saw it, so it is safe to send again later. A company whose setup link was never opened fails at once with 502 INTEGRATION_CONNECTION_NOT_SET_UP.

Neither error says why the company is unavailable. The health check does.

The health check

GET /v1/quickbooks-desktop/health-check answers at once when Crossblade already knows the company is unavailable. Otherwise it asks QuickBooks for the company’s details, and a 200 means QuickBooks answered just now.

cURL
curl "https://crossblade.dev/v1/quickbooks-desktop/health-check" \
  -H "Authorization: Bearer $CROSSBLADE_SECRET_KEY" \
  -H "Conductor-End-User-Id: $CROSSBLADE_END_USER_ID"

# 200 OK
{ "status": "ok", "duration": 812 }

A healthy check waits for Web Connector’s next check-in, about once a minute, and takes a turn in the company’s queue. Use it during setup, for status badges and after a failed request, not before every request.

What the health check returns

ResultMeaningSend the customer to
200 okQuickBooks answered just now.Nothing to do.
INTEGRATION_CONNECTION_NOT_SET_UPSetup hasn’t finished: the setup link was never opened, or Web Connector has never checked in.A new setup link for the same end-user. See Hosted setup flow.
INTEGRATION_CONNECTION_NOT_ACTIVEWeb Connector hasn’t checked in for more than three minutes./help/connection-not-active
QBD_CONNECTION_ERRORWeb Connector checked in but couldn’t work with QuickBooks./help/cannot-connect-to-quickbooks
QBD_COMPANY_FILE_MISMATCHQuickBooks has a different company file open than the one connected at setup. Nothing was sent./help/different-company-file-open
QBD_INVALID_COMPANY_RESPONSEQuickBooks answered without company details./help/cannot-connect-to-quickbooks
QBD_REQUEST_EXPIRED, QBD_REQUEST_TIMED_OUTWeb Connector was seen recently but didn’t run the check before the deadline./help/connection-not-active

Every error here has type: "INTEGRATION_CONNECTION_ERROR" and HTTP 502 or 504. See the full error code reference.

Show userFacingMessage

Every error carries error.userFacingMessage: one plain sentence written for the person who runs QuickBooks. Show it as it is, next to a link to the matching help guide. Keep error.message and requestId for your logs and support.

TypeScript
import { CrossbladeError } from "@crossblade/sdk";

const helpGuide: Record<string, string> = {
  INTEGRATION_CONNECTION_NOT_ACTIVE: "/help/connection-not-active",
  QBD_CONNECTION_ERROR: "/help/cannot-connect-to-quickbooks",
  QBD_COMPANY_FILE_MISMATCH: "/help/different-company-file-open",
  QBD_INVALID_COMPANY_RESPONSE: "/help/cannot-connect-to-quickbooks",
  QBD_REQUEST_EXPIRED: "/help/connection-not-active",
};

export async function quickBooksStatus(endUserId: string) {
  try {
    await client.qbd.healthCheck({ conductorEndUserId: endUserId }, { quickBooksTimeoutSeconds: 75 });
    return { state: "online" as const };
  } catch (error) {
    if (!(error instanceof CrossbladeError)) throw error;
    return {
      state: error.code === "INTEGRATION_CONNECTION_NOT_SET_UP" ? "not_set_up" as const : "attention" as const,
      message: error.userFacingMessage ?? "QuickBooks Desktop is not available right now.",
      helpUrl: helpGuide[error.code] ? `https://crossblade.dev${helpGuide[error.code]}` : undefined,
      requestId: error.requestId, // for your support team
    };
  }
}

When to check

  • During setup: while your customer is on a “waiting for QuickBooks” screen, run the health check every 30 to 60 seconds. Stop after a 200, or when the setup link expires.
  • Status badges: keep the result for at least five minutes per company. Refresh it when someone opens your integration settings.
  • Normal traffic: send the request itself. If it fails with QBD_REQUEST_EXPIRED or INTEGRATION_CONNECTION_NOT_SET_UP, run the health check once to find out why.
  • Background sync: when a company is offline, back off, for example 5, 15, then 60 minutes, and tell the customer once, not on every attempt.
No webhooks yet

Crossblade does not send connection-status webhooks, so check as above. GET /v1/end-users/{id} also returns integrationConnections[].lastRequestAt and lastSuccessfulRequestAt, which need no QuickBooks round trip.

Setup states in the dashboard

The dashboard and the hosted setup page use one set of states for where setup stands:

setupStateMeaningNext step
awaiting_web_connectorWeb Connector hasn’t signed in yet.The customer adds the connection file and saves the connection password in Web Connector.
web_connector_signed_inThe connection password worked in the last few minutes.The customer opens the company file in QuickBooks.
company_file_openWeb Connector is checking in from the company file.Crossblade is confirming the company’s details.
verifiedQuickBooks returned the company’s details for this setup.Start sending requests.
wrong_company_fileQuickBooks has a different company file open.Open the original file
password_rejectedWeb Connector signed in with the wrong connection password.Paste the password again
connector_errorWeb Connector reported an error reaching QuickBooks.Fix the connection
expiredThe setup link expired before setup finished.Create a new setup link for the same end-user.

A check-in only proves that Web Connector reached Crossblade. Only verified, or a 200 from the health check, proves that QuickBooks answered.