Skip to content
Pages · Set up

Connect to QuickBooks

The first time you open the QB Bridge Settings tab without a connection, a Welcome to QB Bridge window lists these steps. Click Got it to close it.

sequenceDiagram
  participant A as You, the administrator
  participant SF as Salesforce
  participant I as Intuit
  participant QB as QuickBooks Online
  A->>I: Step 1, copy the app keys (Client ID, Client Secret)
  A->>SF: Step 2, create the Auth Provider with those keys
  A->>SF: Step 3, create the Named Credential QuickBooksAPI and save
  SF->>I: Opens the Intuit sign-in
  A->>I: Sign in, choose the company, approve
  I-->>SF: Tokens, kept and refreshed by Salesforce
  A->>SF: Step 4, save the Realm ID on the QB Bridge Settings tab
  SF->>QB: QB Bridge calls QuickBooks through QuickBooksAPI

Step 1: Copy your Intuit app keys#

  1. Sign in to the Intuit Developer Portal and open My Hub, then App Dashboard.
  2. Open your app, or create a QuickBooks Online and Payments app.
  3. Open Keys & credentials for the environment you are connecting: Development for a sandbox company, Production for your live company.
  4. Copy the Client ID and Client Secret. Keep this tab open; you come back in step 2.

Keys and credentials in the Intuit Developer Portal. Pick Development or Production, then switch on Show credentials to see the Client ID and Client Secret.

Step 2: Create the Auth Provider#

  1. In Salesforce Setup, open Auth. Providers and click New.
  2. Fill in the values from the table below and click Save.
  3. At the bottom of the saved page, under Salesforce Configuration, copy the Callback URL.
  4. Add the Callback URL to your Intuit app, as shown in Add the Callback URL to Intuit below.
FieldValue
Provider TypeOpen ID Connect
NameQuickBooks Auth
URL SuffixQuickBooks_Auth
Consumer KeyThe Intuit Client ID
Consumer SecretThe Intuit Client Secret
Authorize Endpoint URLhttps://appcenter.intuit.com/connect/oauth2
Token Endpoint URLhttps://oauth.platform.intuit.com/oauth2/v1/tokens/bearer
Default Scopescom.intuit.quickbooks.accounting com.intuit.quickbooks.payment openid profile email phone address
Use Proof Key for Code Exchange (PKCE) ExtensionChecked
Send access token in headerChecked
Send client credentials in headerChecked
Everything elseLeave as it is

The bottom of the saved Auth Provider: copy the Callback URL (marked) into your Intuit app. Your own Salesforce domain appears here.

Add the Callback URL to Intuit#

  1. In your Intuit app, open Settings in the left menu.
  2. Open the Redirect URIs tab.
  3. Choose the same environment as your keys: Development for a sandbox company, Production for your live company.
  4. Click Add URI.
  5. Paste the Callback URL into the new box.
  6. Click Save.

Redirect URIs in the Intuit Developer Portal: 1 Settings, 2 Redirect URIs, 3 Development (or Production), 4 Add URI, 5 the pasted Callback URL, 6 Save. Your own Salesforce domain appears in the URL.

Step 3: Create the Named Credential QuickBooksAPI#

  1. In Setup, open Named Credentials. Open the menu next to New and choose New Legacy.
  2. Fill in the values from the table below. The Name must be exactly QuickBooksAPI: QB Bridge looks the credential up by this name.
  3. Leave Start Authentication Flow on Save checked and click Save.
  4. Intuit opens. Sign in, choose the QuickBooks company, and approve the connection.
  5. Back in Salesforce, Authentication Status reads Authenticated.
Sandbox company

URL: https://sandbox-quickbooks.api.intuit.com

Live company

URL: https://quickbooks.api.intuit.com

FieldValue
Label and NameQuickBooksAPI
URLFrom the tabs above
Identity TypeNamed Principal
Authentication ProtocolOAuth 2.0
Authentication ProviderQuickBooks Auth
ScopeThe same scopes as the Auth Provider
Generate Authorization HeaderChecked
Allow Merge Fields in HTTP Header / BodyUnchecked

The Named Credential QuickBooksAPI after sign-in: Authentication Status Authenticated.

Step 4: Save your Realm ID#

The Realm ID, which QuickBooks calls the Company ID, tells QB Bridge which QuickBooks company to use.

  1. Find it. Sandbox company: Intuit Developer Portal, My Hub, Sandboxes. Live company: in QuickBooks, the gear icon, Account and settings, Billing & subscription.
  2. In Salesforce, open the QB Bridge app and the QB Bridge Settings tab.
  3. Under Global Configuration, click Edit and enter it in QuickBooks Realm ID (Company ID).
  4. Click Test Connection. This checks the ID without saving it.
  5. Click Save. QB Bridge saves only an ID that connects; otherwise you see "Unable to connect with this Realm ID. Please resolve errors before saving."

The QB Bridge Settings tab after step 4: 1 Status: Connected, with the company name; 2 Test Connection. The Realm ID is hidden in this picture.

Moving from a sandbox company to your live company
  1. Use the Production keys of your Intuit app in the Auth Provider, and add its Callback URL to the Production Redirect URIs.
  2. Change the Named Credential URL to https://quickbooks.api.intuit.com, save, and sign in with the live company.
  3. Save the live company's Realm ID on the QB Bridge Settings tab.

Your mappings and rules stay as they are. QB records and reference data belong to the company they came from, and QuickBooks IDs repeat between companies. So saving a different Realm ID pauses the background jobs and logs a warning: "The QuickBooks company changed from … to …. Background jobs were paused; records linked to the previous company are not updated in the new one…"

Before you restart the jobs on the Settings tab, archive or delete the previous company's QB Customers, QB Vendors, QB Invoices and QB Bills, and clear the QuickBooks IDs stored on your own records. Otherwise a record could be matched to the wrong QuickBooks record.

What the connection statuses mean#

StatusMeaning
CheckingThe page is testing the connection.
ConnectedQuickBooks answered for the saved Realm ID.
Authenticated but Not ConnectedThe Named Credential is signed in, but there is no working company: no Realm ID saved yet ("QuickBooks Realm ID is missing."), a wrong Realm ID, or a sandbox URL with a live company (or the other way round).
DisconnectedNo working connection. The box under the status says why.
Where your QuickBooks sign-in is kept

Nowhere in QB Bridge. You sign in on Intuit's own page, and Salesforce keeps and refreshes the OAuth tokens inside the Named Credential. QB Bridge only calls QuickBooks through QuickBooksAPI, so it needs no Remote Site Settings and talks to no other service. The Auth Provider and Named Credential belong to your org, not the package, which is why you create them yourself.

Something's off?#

You seeDo this
Intuit shows a redirect_uri error after you save the Named CredentialThe Callback URL is missing from your Intuit app's Redirect URIs, or was added to the other environment. Add it and save the Named Credential again.
"Named credential not found."Create the Named Credential, or correct its Name (not Label) to exactly QuickBooksAPI.
"Unable to connect with this Realm ID. Please resolve errors before saving."The ID does not belong to the company you signed in with, or the URL is for the other environment.
It worked before and now says DisconnectedThe sign-in expired or was revoked. Edit the Named Credential, Save, sign in again, then Test Connection. Records wait in the queue meanwhile and go once the connection is back.

Where to next#