Search code examples
phpsoapquickbooks

QuickBooks Web Connector Sending Multiple Requests But Only 1 Response


We have been syncing data from our SaaS to QuickBooks via the web connector for years but recently 2 customers started seeing duplicate invoices and payments occasionally.

We've confirmed we are not queuing the invoices or payments more than once. We log when the web connector makes a request to our SOAP server, the QBXML we send back, and the response from the web connector for that QBXML.

What we are seeing is sometimes 2, 3, or even 4 requests come from the web connector at the same time or a millisecond a part but only 1 response comes back. Our queue deletes the jobs when it receives the response from the web connector so when this happens the QBXML for the same invoice or payment gets sent 2, 3, or 4 times, resulting in duplicates in QB, and the response is always for the last request.

We have confirmed our customers only have the web connector on 1 computer but they have the company file on a file server being accessed by multiple users. Could network issues be causing this behavior? Is there a way to handle this?

Any advice or insight is greatly appreciated.


Solution

  • In the programmer's guide for QBWC, there is a section about "unexpected state". There are 2 small paragraphs that somewhat address what you're experiencing.

    If you just sent in some queries, you can simply resend them. But if you sent requests that wrote data to QuickBooks, you don’t want to blindly just send those same data-writing requests again. How do you know whether the requests you sent actually made it into QuickBooks, or whether the failure occurred before this happened?

    To determine this, use the error-recovery capabilities provided in the QB SDK, as documented in the QB SDK Programmer’s Guide, using the oldMessageSetID and newMessageSetID attributes as described in that document.