QuickBooks API Integration 1: The Basics

header-qb

Have you ever wished that you could make certain things happen in QuickBooks (QB) without having to log in and do them yourself?  For example:

  • An order comes into your online store. It would be awesome if it would just appear in QB without you (or anyone on your staff) manually typing it in.
  • You create a new customer in your customer relationship management (CRM) system (i.e. SalesForce or SugarCRM). It might be very nice if that customer info was automatically entered into QB.
  • Your development team is creating a new time tracking app that fits your workflow. Using the time tracked in your app to create time entries and invoices in QB would magical.
  • Maybe none of the reports in QB fulfill a certain need, and you’d like to just automatically pull certain data out of QB and put it into, say, a Google Sheet.

And the list goes on, from simple tasks to complex.  Tools like IFTT and Zapier provide ways to do things like this, but if you’ve used either, you know that anything that deviates from a fairly simple use case won’t fit into their point-and-click systems.

Well, let’s talk about how to do darn near anything in QB using a script of your own devise that you could log in and manually do.

The Plan

This first article will give you a Big Picture view of what we’re going to do. We will tip toe through a little overview of what you need in order to accomplish the magic promised above, learn how to get you a QB developer’s account, and provide a 30,000 foot overview of how it’ll get done. Subsequent articles will chip away at the nitty gritty aspects of each of the details required to build a basic, working example.

The Big Picture

API stands for Application Program Interface, words so vague and lacking in accessible meaning that most people will have started to get groggy somewhere around that last comma.  But the reality is that APIs allow you to do some pretty exciting stuff by letting you write a program to do many of the dullest aspects of your job.

Here’s an illustration of how you usually get things done in QB:

You in the Middle
Most businesses start out this way.

And here’s what we want to achieve:

QB How It Should Be
Make a computer do the tedious work, you do the fun stuff.

This series won’t discuss the details of getting information out of all those other systems, but doing that is usually going to be something along the lines of what we’re discussing here, tailored for the way each specific product’s API works (and assuming you avoid tools that don’t bother to provide an API).

What You’ll Need

The list is fairly straightforward:

  • A computer to try this stuff out on.  I prefer Mac or Linux systems for any development, but any system will do the trick as long as you’re comfortable doing development work on it.
  • An Intuit Developer Account, which is easy to get and described below.
  • A QuickBooks Online Sandbox, which, you guessed it, comes with your developer account.
  • The intestinal fortitude of a champion developer.  Well, really, that’s not necessary, because this should be pretty easy if you follow along. But it always helps.

Concepts: Apps, QB Accounts, Code

Here’s a conceptual sketch of a QB app to help you get a feel for where everything lives:

The basic QB / Intuit development flow.
The basic QB / Intuit development flow.

And here are some words to describe what’s going on above:

  1. You first create “Apps” in your Intuit Developer Account (covered in the next section). Each App you create comes with a few things, including the keys your code will use to authenticate and associate itself with that app (app token, oauth consumer key, oauth consumer secret), and a complete QB sandbox for you to muck around in.
  2. For each App, you write some code that uses the QB APIs to actually do your bidding.  This code lives on the server of your choosing, and can be written in any language that you feel comfortable using.  The examples provided by Intuit include Java, .NET, Ruby and PHP samples, but you can really use anything that lets you make JSON-based REST calls. They also provide SDKs (software development kits) for the same languages that add a layer of ease and abstraction to your programming if you’d like to use these instead of interacting directly with the API’s REST endpoints.
  3. Each QB account that wants to make use of your app must give your app permission to connect to it.  We’ll cover how to do this in a future article within this series.

Your Developer Account

Intuit, the developer of QuickBooks, makes it very easy to start developing. They offer a free and easily acquired developer account, lots of code examples and documentation, and a QuickBooks Online sandbox that lets you test your work without fear of blowing up your company’s real QB data.

Getting an account is easy. Head to developer.intuit.com, click “Sign In,” click “Create an account” and there you go:

Getting an Intuit Developer account is quick and easy.
Getting an Intuit Developer account is quick and easy.

Once you’ve created an account and logged in, you will create an App by clicking on “My Apps.”  From there you can play around with sample apps, or just create an app from scratch.  For the purposes of this tutorial, create an app from scratch (but feel free to play with the samples, too), and choose the Accounting API.

Once you’ve done that, have a look around at the App screen’s tabs, and see what you can learn about your sweet new QB sandbox, your app’s keys, and the various other goodies you got with a few quick mouse clicks.

What Next?

Armed with a solid overview, we’re ready to start building the code to implement our App. The first thing your code will have to do is get a QB user’s permission to access their QB account, so we’ll start there.  In my opinion, this stage of the process is probably the most confusing, but once you get it, it’s easy.  And, once it’s done, using the REST API itself is smooth sailing.

Learn how to get a user’s permission in the second article in this series on OAuth and the QuickBooks API.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *