Question

I have integrated quickbook on my website. I am sending request through XML For Adding Invoice in Quickbook.

Its working fine from long time. now i want to check for duplicate invoice through Quickbook API as sometime we couldn't get response from quickbook for adding invoice so we again send request to add invoice so it gets duplicate invoice so if any api of quickbook which helps in checking duplicate invoice before adding any invoice through api.

I couln't find any api on quickbook documentation for checking duplicate invoice.

Thanks

Was it helpful?

Solution

If you don't have the TxnID, there really isn't a way to detect a "duplicate" invoice in QuickBooks.

The closest you can get is querying by RefNumber (QuickBooks qbXML for querying by RefNumber), but because QuickBooks allows duplicate RefNumbers (i.e. it's perfectly valid in QuickBooks to have two or more Invoice #1234s) there's no guarantee that the invoice that you get back from that query is the invoice that you created.

With all of that said, it sounds like you're trying to solve the wrong problem. You're trying to solve this:

now i want to check for duplicate invoice through Quickbook API

When you should be trying to solve this:

sometime we couldn't get response from quickbook for adding invoice

If you're talking about QuickBooks Online

You should always get some sort of HTTP response back from the QuickBooks Online servers. If you don't get something back, it's likely that you're not waiting long enough for the response, or that you have an error in your code which isn't processing the response correctly.

Can you post your cURL curl_getinfo($curl) output, and the result of ->lastRequest() and ->lastResponse() from your code?

If you're talking about QuickBooks for Windows

It's important to recognize that QuickBooks and the Web Connector will ALWAYS try to send a response to you (QuickBooks Web Connector documentation). ALWAYS. The only way you can miss a response completely is if you lose your internet connection, and even then you should at the very least know whether or not the request was sent to QuickBooks and thus know not to send it again.

If you're not getting a response, then there is a 99.9% chance that you are doing something incorrect which is causing you to not get the response.

The bottom line:

You should focus on why you're not getting the responses in your program and fix the source of this problem, rather than trying to fix a symptom.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top