I am having trouble understanding the short documentation for quickbooks-js https://github.com/RappidDevelopment/quickbooks-js/blob/master/README.md
In the qbXMLHandler where do the queries need to placed? For example I need all the information returned from a invoice and sent to a React application in JSON.
The goal is to pull data from the desktop quickbooks application and send it to the React application using Node.
const convert = data2xml({
xmlHeader:
'<?xml version="1.0" encoding="utf-8"?>\n<?qbxml version="13.0"?>\n',
});
module.exports = {
/**
* Builds an array of qbXML commands
* to be run by QBWC.
*
* @param callback(err, requestArray)
*/
fetchRequests: function (callback) {
buildRequests(callback);
console.log(buildRequests(callback));
},
/**
* 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);
},
};
function buildRequests(callback) {
let requests = new Array();
let xml = convert("QBXML", {
QBXMLMsgsRq: {
_attr: { onError: "stopOnError" },
ItemInventoryQueryRq: {
MaxReturned: 1000,
},
},
});
requests.push(xml);
return callback(null, requests);
}