Quickbooks Integration with Salesforce

Hello, it’s Atlas Can here! In this blog post we will use QuickBooks, the renowned accounting software used globally across multiple industries, that offers a REST API, thereby enabling developers to create robust integrations from any system that supports coding. 

One such system that can leverage this capability is Salesforce, a leading cloud-based CRM platform, which is also something I happen to know a few things about. 

By using QuickBooks, Salesforce and Declarative Webhooks, you can streamline your business processes with reduced technical debt in a scalable way. In our example, we will sync Accounts in the Salesforce system alongside its invoices and invoice line items when an account is changed to a certain status.

Primer on Quickbooks Accounting Software

Usually used by small to mid sized enterprises, QuickBooks rapidly gained popularity. By 2000, it commanded over 85% of the small business accounting software market. The success of QuickBooks was largely due to its ease of use, affordability, and the growing need among small businesses for a comprehensive, easy-to-understand accounting solution.

In 2004, Intuit pushed innovation further by launching QuickBooks Online, a cloud-based version of the software. This was a significant step, as it allowed users to access their financial data from anywhere with an internet connection, making the product even more convenient and flexible for business owners. Today, QuickBooks Online has millions of users worldwide. Being a very nice tool, it has also made headlines due to recent news

Over the years, QuickBooks has expanded its offerings to cater to various specific business needs and industries, with products like QuickBooks Pro, QuickBooks Premier, and QuickBooks Enterprise. They’ve also added numerous features like payroll management, invoice generation, tax filing, and integration with third-party apps, among others.

Benefits of Integrating Quickbooks and Salesforce

Automating the integration between Salesforce and QuickBooks offers a plethora of advantages, having significant impacts on operational efficiency, data accuracy, customer service, and overall business agility.

The most immediately noticeable benefit of automation is the significant boost in operational efficiency and productivity. Manual data entry and data manipulation can be time-consuming and tedious. By automating the process of creating customers and generating invoices in QuickBooks based on Salesforce activities, these routine tasks are streamlined. This frees up valuable employee time, allowing teams to focus on more strategic, revenue-generating tasks. Automation also eliminates the potential for human errors, such as typos or omissions, which can cause data discrepancies and result in wasted time and effort down the line.

Another crucial advantage of this automated integration is that it guarantees seamless data synchronization between Salesforce and QuickBooks. The systems communicate in real-time, so any changes in Salesforce instantly reflect in QuickBooks, and vice versa. 

This mutual exchange of data ensures that all teams, be it sales, customer service, or accounting, work with the same, most recent data. This alignment prevents confusion or mistakes stemming from outdated or inconsistent information and results in more precise business analytics and reporting, forming a solid foundation for accurate decision-making.

Having updated and accurate customer and invoice data at their fingertips allows the sales and customer service teams to provide a better customer experience. They can promptly answer customers’ queries about their invoices or account status, reducing wait times and frustration. Quick resolution of issues leads to happier customers, which can boost customer loyalty and enhance a company’s reputation.

Automated integrations like this make businesses more responsive and agile. Real-time, automatic triggering of actions, such as invoice creation upon the closure of an opportunity in Salesforce, means that business processes move faster. This speed can provide a competitive advantage, allowing businesses to respond quickly to market changes or customer needs.

Automated integrations also provide scalability. As a business grows and the volume of data increases, manual data management becomes untenable. An automated integration between Salesforce and QuickBooks will effortlessly scale with your business, handling large data volumes without a hitch.

Lastly, the increase in productivity, efficiency, and accuracy from the integration automation translates into substantial cost savings. With less time spent on manual data entry and error correction, staff can use their time more productively. Improved accuracy reduces the risk of costly mistakes, and the increase in customer satisfaction can lead to higher customer retention, reducing the costs associated with customer acquisition.

Real World Quickbooks and Salesforce Integration for Efficiency and Growth

Nurse Registry, a dynamic staffing agency, revolutionized their workflow by integrating QuickBooks and Salesforce through Declarative Webhooks. Prior to the integration, their invoicing and payment processes for 50-80 clients and nurses were laborious and time-consuming, involving manual data entry and taking up to 10-15 hours per week. Seeking a solution to enhance efficiency and scalability, they seamlessly connected their Salesforce and QuickBooks systems.

With Declarative Webhooks handling the integration, Nurse Registry achieved remarkable results. The automation of tasks, such as creating client accounts, nurse vendors, job management, and processing payments and invoices based on Salesforce data and business rules, saved valuable time and resources. Moreover, the integration significantly improved accuracy and record-keeping, eliminating the risk of human errors. As a result, they now save 10-15 hours per week and successfully increased the number of nurse payments processed by 25%. This newfound efficiency allows Nurse Registry to focus on growth and exceptional service delivery to their clients and nursing professionals.

Read the full customer Success Story: Nurse Registry Transforms Staffing Efficiency with Automated Invoicing and Payments through Quickbooks and Salesforce Integration.

How to Integrate Quickbooks and Salesforce

In this comprehensive guide, we will walk you through the process of establishing an integration between Salesforce and QuickBooks. The beauty of this approach lies in its ability to utilize callout templates and sequences, thereby circumventing the need for explicit coding.

Sure this sounds great but how are we going to do it? Don’t worry! We’re here with you at every step and you can reach us anytime for questions and comments.

Setting up the QuickBooks API Connection

To start the process, we need to establish an authenticated connection with QuickBooks to enable API calls to QuickBooks’ REST API. The QuickBooks API employs OAuth for authentication, and thus we use Salesforce’s Custom Metadata functionality and Apex Class in tandem with a custom Authentication Provider. Here are the two options to set up this connection:

Write an AuthProviderPluginClass class yourself. You can do this using the QuickBooks API documentation and Salesforce’s authentication provider documentation found here.

Alternatively, you can install the connection from the Declarative Webhooks code library. This approach will install the AuthProviderPluginClass and associated custom metadata, which can then be used to configure the Authentication Provider and Named Credentials.

There’s also configuration that needs to be done on QuickBooks side, first sign up for a developer account here.

After signing up, we need to create an app on QuickBooks. Go to Dashboard > Create an App. On this page, select a scope – we are using Accounting (com.intuit.quickbooks.accounting) scope for this example. 

After creating the app, you can find the Client ID and Client Secret which will be used in the Salesforce side to make the authentication in quickbooks.

As mentioned earlier, the Auth Provider needs to have an Apex Class, Named Credential and a Custom Metadata to make the authentication. Feel free to reach out to us for support.

Here’s what it should look like for our example after configuration:

Setup QuickBooks REST API Callout Templates in Salesforce

At the heart of the Declarative Webhooks application are Callout Templates. A Callout Template defines a REST API call, setting the target of the call, the action to be performed, and the data to be transmitted. For this integration, we require two Callout Templates.

Creating a QuickBooks Customer from Salesforce

This template utilizes the POST call to /v3/company/{realm or companyId}/customer in the QuickBooks REST API to create a new customer. Given we are using Named Credentials for authentication, the template URL will be formatted as follows: callout:QuickBooks/v3/company/{realm or companyId}/customer

We set the Main Object of this template to Account, corresponding to our Salesforce Account. Here’s what it should look like:

The body of the callout should map the crucial Account information into the request body, as demonstrated below:

After defining the callout body and a response template, we need to specify a response action. In this case, our objective is to store the QuickBooks Customer ID in Salesforce for future reference. Here’s how the response body should look like.

This is the important point where we choose to update the primary Salesforce record (Account), mapping the Customer ID from the API response to a custom field on the Account.

Generating a QuickBooks Invoice from Salesforce

The second Callout Template is geared towards creating an invoice based on the details of the Salesforce Account. This template uses the /v3/company/{realm or companyId}/invoice 

POST call from the QuickBooks REST API.

Just like in the first template, the URL is formatted as callout:QuickBooks/v3/company/{realm or companyId}/invoice, and the main object of this template is the Account. 

The request body for this API call is a bit more intricate, as we map not only the Invoice details, Invoice’s Account object’s QuickBooks Id but also the invoice line items:

In the response body mapping which you can see below and at the response actions we aim to save the QuickBooks Invoice ID and status back into Salesforce.

Automating Salesforce to make API Calls to QuickBooks

Now that our Callout Templates are created and activated, we need to automate the callout process.

Let’s refresh our memory, in our scenario we are sending an account to QuickBooks and sending all of its invoices. We’re making some assumptions here that an Account has to have invoices before being sent over to QuickBooks and we will only send the account if it doesn’t exist in QuickBooks.

We will use the Callout Sequence feature of Declarative Webhooks so we can create a Customer first and send all of its Invoice records (alongside Invoice Line Items, in our example we’re using a custom object but this can also be done with standard objects). 

Let’s create a callout sequence called QB Integration and pick the Main Object as Account.

In the next screen we will add an element, this will be the Create Customer Callout template that will run only if the QuickBooks Id field is not populated. Here’s how it should look like.

In the next step, we will create the invoices, but only if the first callout is successful, API requires we have an account ID as a reference. 

Now save and close the Sequence page and head over to flows. We are going to create a record triggered flow to trigger this callout sequence. This is similar to our earlier exercises but we will call a Callout Sequence instead of a Callout Template.

Create a record triggered flow on Account object with these entry conditions. We’re handling other entry logic in Callout Sequence for less complexity.

Next, create an Apex action element and enter our sequence developer name, QBIntegration for our example. Now let’s activate our templates, activate our flow and these addresses to our remote site settings.

In Summary

Our integration is now complete! Whenever an Account’s path status in Salesforce shifts to ‘Send to QuickBooks, our flow initiates the callout sequence. This, in turn, uses the ‘Create Customer’ callout template, followed by the ‘Create Invoice’ callout template. The entire process is automated, improving efficiency and reducing the scope for manual errors.

In conclusion, by leveraging the flexibility of the Declarative Webhooks application and the REST API of QuickBooks, we have managed to establish a powerful integration between Salesforce and QuickBooks. The approach illustrated here can be readily adapted for different integration scenarios, effectively extending the capabilities of both Salesforce and QuickBooks.

Declarative Webhooks is free to install and use for an unlimited time in a Salesforce sandbox. In a Salesforce production org or developer org, there is a one month trial after which a license needs to be purchased for continued use of the application​.

Thank you for reading and I will see you in the next post!

If you want to learn more about Declarative Webhooks, please follow the links below: