A SOAP service implemented in Node.js that communicates with QuickBook's Web Connector.
The following steps should get you up and running.
There are a few prerequisites you should have on hand:
admin
) password 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.
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);
}
};
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();
soapServer.setQBXMLHandler(qbXMLHandler);
soapServer.run();
admin
user..qwc
file. There is an example here.
0.0.0.0
or a local IP like 10.0.0.156
to run locally<OwnerID>
and <FileID>
can be any random guid
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();
Unit tests are written in mocha.
npm test
This project was forked from qbws
and originally written by @johnballantyne.
Modified by @MattMorgis at Rappid Development.