Action Queue

Most developers find it difficult at first to know how exactly the Web Connector and your web service are supposed to communicate. Questions in the forums always seem to start with, "How do I send x to QuickBooks from my e-commerce site?" Well, you have to realize that your web service will never initiate any action to send data.

People wrongly assume that applications can connect to the Web Connector to send data to QuickBooks.

You need to realize that the Web Connector connects to your web server to fetch data to pass on to QuickBooks.

So... you're developing a server to which clients (users of the Web Connector) connect to retrieve waiting data. The best way we developed to store and transmit the appropriate data was with what we call the action queue. It's simple enough... every piece of data or data request message we want to pass to QuickBooks is stored in the database as an action with its request type and data. Our sales people and accountants can populate this queue as they wish, either in the morning for the previous day's sales or as an order is being processed to generate purchase orders. When the Web Connector connects to our server (as you can see in the sample server code), the server starts at the top of the queue and starts sending qbXML requests on to QuickBooks.

We decided against storing the full qbXML in the database and only stored the necessary arguments in an array that was then used to construct the qbXML at the time of import. Also, you must ensure as you populate your queue that customers and items are being imported to QuickBooks before their corresponding invoices and purchase orders. Because of the limitations on QuickBooks items in the various versions, we decided against importing the full product catalog and only importing the items as we sold them. This isn't a major deal... it's simple to store what you've imported in the past (using the unique QuickBooks full name or ListID) and check those tables when you're importing new invoices and purchase orders. If you find you haven't yet imported the appropriate customer or item, go ahead and add those actions to the queue before the invoice or PO.

Feel free to post questions about the process in the forums.