Joels Random Technical and Social thoughts, in this blog you will find things I think will be useful for myself or others to read about, it could be a recipe or how to solve a technical problem in Java or Ruby.
I am a managing partner at solutionstreet.com, hire me by using our contact us page.

Quickbooks

February 07, 2010

So your client wants you to query or post something to their quickbooks online (qboe) account from their rails app, this should be easy right?

Well if you are like me you probably googled "rails" and "quickbooks" and found a few interesting articles out there. What I found was they were mostly focused on quickbooks app (not quickbooks online). So if you are reading this and want to integrate with regular quickbooks, stop reading and go back to google, this is only for quickbooks online (qboe).

Note, this is the easiest way I have found, and not necessarily the best or most secure way, but if you got to get it done, this should work. (the hosted model is more secure, but its a nightmare, my big issue with it is it requires the ip you connect out on to have reverse dns that matches your application, this doesn't work for deamhost.)

Prep Work:

Before we start, you will need a few things:

1.) Create a qboe account or get the login/password for the account you will be integrating with, I would create a trial one for now so you dont risk messing something important up.

2.) Create a IDN account (developer.intuit.com), click "Join IDN", and create a Community Developer membership which is
free.

3.) Download the sdk (you need windows to do this, so fire up parallels or borrow a friends windows machine). Once you install the sdk, copy the files over to your mac. (optional but highly recommended)

3.) Register your application at with IDN at appreg.intuit.com. When you register, choose "qboe", "desktop" and "production" as options. Pick a domain name & application name and make note of these. Submit and you will need to verify via email. If this works, you will be taken to a screen that lists your applications, note your :

AppID: should be a long number

AppLogin: should be something like your domain name with app name in front

Now for the fun part, time to code, this approach uses qbXML, you will send these requests and get xml responses. I am using httparty to send the requests and parse the xml. I am also using erb to templatize the qbXML.

a.) Get httparty : git://github.com/jnunemaker/httparty.git

b.) Create your erb templates for the 3 calls you need to create an invoice: (get the session, get the customer, then create the invoice)

c.) Now create the httparty class that does the work:

qboe setup:

Use the QBOE web interfact to do the following:

- create a client called "test company a"

- create 2 product/services, 1 called "Exterior" and one called "Interior"