npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

quickbooks-js

v1.0.0

Published

A SOAP service implemented in Node.js that communicates with QuickBook's Web Connector

Downloads

352

Readme

Build Status Coverage Status
quickbooks-js

A SOAP service implemented in Node.js that communicates with QuickBook's Web Connector.

Usage

The following steps should get you up and running.

Prerequisites

There are a few prerequisites you should have on hand:

  • Access to the desktop running Quickbooks and hosting the Company File.
  • The Quickbooks Company's administrator (user: admin) password
  • Optional: A dedicated username and password for your web-service to interact with the Quickbooks Web Connector (it is not recommended to use the admin username and password!).
  • Optional: The port on which the service should be available. Defaults to 8080.

Set environment (env) variables for the following values (these are the defaults):

QB_USERNAME=username
QB_PASSWORD=password  
QB_COMPANY_FILE=C:\Users\Public\Documents\Intuit\QuickBooks\Sample Company Files\QuickBooks 2014\sample_wholesale-distribution business.qbw  
QB_SOAP_PORT=8000  

Depending on your environemnt, you may need to set QB_COMPNANY_FILE in one of the following ways:

QB_COMPANY_FILE=C:\Users\Public\Documents\Intuit\QuickBooks\Sample Company Files\QuickBooks 2014\sample_wholesale-distribution business.qbw  
QB_COMPANY_FILE='C:\Users\Public\Documents\Intuit\QuickBooks\Sample Company Files\QuickBooks 2014\sample_wholesale-distribution business.qbw'
QB_COMPANY_FILE=C:\\Users\\Public\\Documents\\Intuit\\QuickBooks\\Sample Company Files\\QuickBooks 2014\\sample_wholesale-distribution business.qbw  
QB_COMPANY_FILE='C:\\Users\\Public\\Documents\\Intuit\\QuickBooks\\Sample Company Files\\QuickBooks 2014\\sample_wholesale-distribution business.qbw  '

For easy env variable management checkout the dotenv package.

qbXML Handler

You must addtionally create your own qbXMLHandler that will send the SOAP Server a queue of requests to pass to QBWC. It will addtionally handle the qbXML responses and any errors that may be returned.

There is an example class here.

// Public
module.exports = {

    /**
     * Builds an array of qbXML commands
     * to be run by QBWC.
     *
     * @param callback(err, requestArray)
     */
    fetchRequests: function(callback) {
        return callback(null, []);
    },

    /**
     * Called when a qbXML response
     * is returned from QBWC.
     *
     * @param response - qbXML response
     */
    handleResponse: function(response) {
        console.log(response);
    },

    /**
     * Called when there is an error
     * returned processing qbXML from QBWC.
     *
     * @param error - qbXML error response
     */
    didReceiveError: function(error) {
        console.log(error);
    }
};

SOAP Server Setup

To start the service from the command line simply run:

node bin/run

To start the app from an Express install the package:

npm install quickbooks-js --save  

Then start the service from your app.js with:

var Server = require('quickbooks-js');  
var qbXMLHandler = require('./qbXMLHandler');
var soapServer = new Server();
quickbooksServer.setQBXMLHandler(qbXMLHandler);
soapServer.run();

QBWC Setup

  1. Login to your Quickbooks Company with your admin user.
  2. In the Quickbooks Web Connector, select "Add an Application" and supply it with a .qwc file. There is an example here.
    • You may need to use 0.0.0.0 or a local IP like 10.0.0.156 to run locally
    • <OwnerID> and <FileID>can be any random guid
  3. Quickbooks will prompt you to authorize your new web service.
  4. You may need to enter your password into QBWC once the app is added.

To start the service from the command line simply run:

node test/client.js

To start the app from an Express install the package:

npm install quickbooks-js --save  

Then start the service from your app.js with:

var quickbooks = require('quickbooks-js');  
quickbooks.run();  

Tests

Unit tests are written in mocha.

npm test

Attribution

This project was forked from qbws and originally written by @johnballantyne.
Modified by @MattMorgis at Rappid Development.