Go back to the main page

Getting starting with the modern Ruby QuickBooks Online client, the qbo_api gem, Part 1

 

 

Spin up an example app

Ok, I made the arguments why the qbo_api gem is the "modern" Ruby QuickBooks Online API client but what is the best way to get started using it? I'd advise you to spin up the example app included in the library.

  1. Clone the qbo_api gem, switch into the new directory, and bundle
  2.   $ git clone git://github.com/minimul/qbo_api
      $ cd qbo_api
      $ bundle
    
  3. Create a .env file with your QuickBooks Online API app's consumer key & consumer secret
  4. Consumer key and secret? Keep following.
  5. If needed create an account at https://developer.intuit.com
  6. Click "Get started coding"
  7. First screen after creating a new account.
  8. Create an app with both the Accounting & Payments selected.
  9. Although, Payments is not needed for the example it is turned on in the example app "Connect to Intuit" button.
  10. Go to the Development tab and copy and paste the consumer key and secret into the .env file.
  11. Copy the "OAuth Consumer Key" and the "OAuth Consumer Secret"
    # and put'em the .env file (located at the qbo_api root dir) like so
    export QBO_API_CONSUMER_KEY=<Your QuickBooks apps consumer key>
    export QBO_API_CONSUMER_SECRET=<Your QuickBooks apps consumer secret>
    
    This section is at the 5:33 mark.
  12. Start up the example app
  13. $ ruby example/app.rb
    
  14. Goto http://localhost:9393
  15. Simple page with just the "Connect to QuickBooks" button
  16. Use the Connect to QuickBooks button to connect to your QuickBooks sandbox, which you receive when signing up at https://developer.intuit.com.
  17. This section is at the 10:07 mark.
    To launch the sandbox
    Click on "Go to company"
    Here is your sandbox. Note: it is tied to your login and not the created app. Listen to me talk more about sandboxes on the screencast.
  18. Click on "Connect to QuickBooks"
  19. You will be presented with this view if you are already logged into your Intuit developer account. Otherwise, you will get a login screen before this view.
    After authorizing you will be returned to the example app. Your OAuth info will be displayed for convenience, although not needed for this tutorial. The token, token_secret, and realm_id are needed to initialize the qbo_api gem.
  20. Next, goto the address is http://localhost:9393/customer/5
  21. Should get "Dukes Basketball Camp". Check out the code to see how it works.
    Dukes Basketball Camp is a sandbox customer.

Summary

The fastest way to dig into the qbo_api gem is to spin up the example app. After you accomplish that take a look under the hood and you will be ready to integrate your app with QuickBooks Online.