A *primitive* Ruby implementation of the QuickBooks API (QBXML). The mature version is for sale at http://behindlogic.com.
Switch branches/tags
Nothing to show
Pull request Compare This branch is 18 commits ahead of dcparker:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



This is an early version of the QuickBooks RubyGem, and has since been completely rewritten from the ground up. The new, actually good version is located at http://behindlogic.com, and is generated from QuickBooks’ QBXML DTDs, and therefore comprehensively covers the entire QuickBooks API. To read more, head over to http://behindlogic.com or contact gems [at] behindlogic.com.

Welcome to QuickBooks for Ruby

The purpose of this gem is to perform connectivity and communication with Quickbooks, providing the user with access to quickbooks data as everyday ruby objects. This could be understood to be somewhat like an ORM, but it is different in that its models are predefined by the Quickbooks API.

In releases prior to 0.1.0, some knowledge of the Quickbooks API may be required. In releases beyond 0.1.0, the Quickbooks API should be fully hidden from your view.

Enjoy and PLEASE contribute either by suggestion or by submitting patches, etc. Or if development seems slow, please feel free to join! My work on this project has been solely for my own use of the gem, while opening up its achievements for others to use as well. Development may slow down considerably when I find it is at a stable and usable point for my needs. You’ve been warned! ;)



This library is a work in progress. This package is separated into two distinct components: Qbxml and Quickbooks (models). The Qbxml represents most of the work of complying to the Quickbooks SDK, and is useful separate from the Quickbooks portion, for use with the QB Web Connector or QB Online Edition (as this gem does not support these connection types yet). For now, The Web Connector is NOT in plans to be supported as it requires additional logic of a different kind in asynchronous network communication.

Furthermore, as of version 0.1.0, the Customer model is the only model fleshed out and in working condition. It is rather stable, but please report any bugs you find. I have attempted to make the Quickbooks family of models to work much like DataMapper models, with their finder methods and such. It may be possible to make this gem into a DataMapper adapter.


Simply include this gem in your project:
require ‘rubygems’
require ‘quickbooks’

Without any configuration, you should be able to talk to Quickbooks immediately if it and a company file is open on the same computer:

  # setting unattended_mode to true and personal_data to not_needed has a nice
  # side effect...it reduces the UI controls in the QB confirmation screen
  # to a simple Yes/No radio selection
    :support_simple_start => true,
    :unattended_mode      => true,
    :personal_data        => :not_needed
  c = Quickbooks::Customer.first
  c.phone = '(123) 456-7890'
  c.first_name = 'Joey'
  c.last_name = 'Smith'

Read further in Qbxml::Request and Qbxml::Response in order to get a better understanding of the kinds of options you can use. The Quickbooks::Base – inherited models also hold a lot of logic that is specific to each data type.

Again, until a later version, you will need to be running Quickbooks on the same computer and have quickbooks open to the company file you need. The first time you run your script, you will need to authorize access to your script when Quickbooks asks you to.

Caution about *_after and *_before filters

When using time-based filtering, like this…

  Quickbooks::Customer.all(:created_after => Time.now)

…be careful! QuickBooks stores the dates in the local time zone, but IGNORES Daylight Saving (http://goo.gl/UKirY).

So, you’ll need to do something like this instead…

  timestamp = Time.now
  timestamp += 3600 if timestamp.dst?
  Quickbooks::Customer.all(:created_after => timestamp)

Nice, eh?


  • Chris Bruce (mailto:chrisabruce@yahoo.com)
  • Daniel Parker (mailto:gems@behindlogic.com)
  • two-bit-fool

This library is released under the terms of the MIT License.