Skip to content


Subversion checkout URL

You can clone with
Download ZIP
QBFC-Ruby wraps the QBFC COM object of the QuickBooks SDK, providing ease-of-use improvements, such as lower-case method names. It also provides a class for each QuickBooks entity which supports find, save, delete, void, and create operations.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



QBFC-Ruby provides a wrapper around QuickBooks' QBFC COM object, while
allowing more or less direct access to the actual COM object.

Obviously, test before using on your production data...


QBFC-Ruby supports +find+ queries with options, which utitilize QBFC's Query
Requests. See QBFC::Element.find for details and options.

  QBFC::session do | qb |
    checks = qb.checks.find(:first, :conditions => {:entity => 'ABC Supplies'})


QBFC-Ruby supports loading of related records. These are records
represented by "*Ref" in the QBFC documentation. For example, a Check
has, among others, a PayeeEntityRef and an AccountRef. These can be
accessed via, respectively, <tt>check.payee</tt> and <tt>check.account</tt>.

<tt></tt> returns the name of the payee.

You can also access the *ID and Name fields of referenced records.
Example: for the payee of a Check, <tt>check.payee_id</tt> and

==General Examples

  # A very simple example, finding a single Customer by name
  QBFC::session do | qb |
    puts qb.customer('Customer Name').full_name
  # Find all Customer, then return the first in the Array
  # Next, find the first Customer only
  QBFC::session do | qb |
    customers = qb.customers.find(:all)
    puts customers[0].full_name
    puts qb.customers.find(:first).full_name

  # Same as previous, but not using a block  
  sess =
  customers = QBFC::Customer.find(sess, :all)
  puts customers[0].full_name
  puts QBFC::Customer.find(sess, :first).full_name

  # Use a QBFC::Session object, but access the COM object
  # more directly.
  QBFC::session do | qb |
    request_set = qb.CreateMsgSetRequest("US", 6, 0)
    customer_query = request_set.AppendCustomerQueryRq	
    response = qb.DoRequests(request_set)
    customer_set = response.ResponseList[0]
    first_customer = customer_set.Detail[0]
    puts first_customer.full_name

[QuickBooks for Ruby]

  This is a project with similar goals to QBFC-Ruby. I believe the approach
  is creating Ruby classes that mirror the QuickBooks types and generate / parse
  qbXML. In my opinion, this approach is more stable and flexible than what I'm
  doing with QBFC-Ruby, but at the cost of slower development. (As in, QBFC-Ruby
  was intended as a collection of quick and dirty shortcuts; QuickBooks for Ruby
  seems to be intended as a much more *complete* project)

[QBFC/qbXML COM Objects]
  Using the SDK directly is an option. Unless you need to use QBWC (QuickBooks
  Web Connector) or have some other reason for *wanting* to us qbXML, I suggest
  using QBFC. The SDK documents (see ) are pretty
  easy to use and navigate.

There are some other libraries on rubyforge in early stages which I haven't
really explored.

Copyright (c) 2008 Jared E. Morgan, released under the MIT license
Something went wrong with that request. Please try again.