Getting started with Nodejs and QuickBooks Online Part 2

This article is over 2 years old. Proceed with caution.

Regards ♨ – Minimul

Continuing from Part 1

In part 1 we just did the bare minimum. Now, in part 2 we are going to go a bit further by creating a customer route where we will pass in an id and then retrieve the associated customer from the developer sandbox and output their "DisplayName" value.

Let's start by making that new route right below the /start route in app.js.

Next, we are going implement basic persistence with the cookie-session NPM package

Minimul says —

We need to persist the OAuth token, secret, and Intuit's realmId (now referred as the "company id") to make repeated API calls. In a real app you would use a data store like Postgres, Redis, etc. Here we will use sessions, however, the express-session only persists for a short duration and is meant for data stores. Therefore, let's use the cookie-session package to get some basic persistence.