Import data from two sources into one company in quickbooks - quickbooks

I have two web portals (different domains) but i want to import clients, vendors and invoices from both web portals to my quickbooks using webconnector. What i have tried is creating two qwc files and and configured in the webconnector but whenever i try to import invoice from second company i am getting error of invalid reference.... not found (but the name of client matches exactly like i have on quickbooks with the xml i am creating to run import for invoices ). Below is the error i get when i run import
3140: There is an invalid reference to QuickBooks Term "Client, Test" in the Invoice. QuickBooks error message: Invalid argument. The specified record does not exist in the list.
Below is the xml i use to import invoice
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<InvoiceAddRq requestID="39">
<InvoiceAdd>
<CustomerRef>
<FullName>Client, Test</FullName>
</CustomerRef>
<TxnDate>0000-00-00</TxnDate>
<RefNumber>Zaztest</RefNumber>
<ShipAddress>
<Addr1>6050 Hellyer Ave #100C</Addr1>
<Addr2></Addr2>
<City>San Jose</City>
<State>California</State>
<PostalCode>95136</PostalCode>
<Country></Country>
</ShipAddress>
<PONumber>Client</PONumber>
<TermsRef>
<FullName>Client, Test</FullName>
</TermsRef>
<DueDate>0000-00-00</DueDate>
<InvoiceLineAdd>
<ItemRef>
<FullName>Bill:ZigSig Fee</FullName>
</ItemRef>
<Rate>141</Rate>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>

You say that the client (customer) exists...
" not found (but the name of client matches exactly like i have on quickbooks with the xml"
However, that's not what the error message is telling you. The error message has nothing to do with the customer name. It's about the terms name. The error:
invalid reference to QuickBooks ****Term**** "Client, Test"
(Emphasis on Term mine). The error message isn't about how the customer is named, it's about how the terms are named.
Terms are usually something like Net 30 or Due on Receipt. They should not be the same as the customer name.
TLDR: Fix your qbXML to send a valid TermRef/FullName value:
<TermsRef>
<FullName>Client, Test</FullName>
</TermsRef>

Related

Quickbooks API and detecting deleted items

I'm using the Quickbooks XML API to import salesorders, items, and customers. Everything works great, however I haven't figured out how to handle things that are deleted in Quickbooks. Querying the imported data in my system is not an option because I have 20,000+ salesorders. My question is, does Quickbooks have a query for deleted items?
QuickBooks for Windows:
If you're using QuickBooks for Windows, then you can do a TxnDeletedQueryRq request to get a list of recently deleted transactions.
Example:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="9.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<TxnDeletedQueryRq>
<!-- TxnDelType may have one of the following values: ARRefundCreditCard, Bill, BillPaymentCheck, BillPaymentCreditCard, BuildAssembly, Charge, Check, CreditCardCharge, CreditCardCredit, CreditMemo, Deposit, Estimate, InventoryAdjustment, Invoice, ItemReceipt, JournalEntry, PayrollLiabilityAdjustment [PRIVATE], PayrollPriorPayment [PRIVATE], PayrollYearToDateAdjustment [PRIVATE], PurchaseOrder, ReceivePayment, SalesOrder, SalesReceipt, SalesTaxPaymentCheck, TimeTracking, TransferInventory, VehicleMileage, VendorCredit -->
<TxnDelType>Invoice</TxnDelType>
<TxnDelType>ReceivePayment</TxnDelType>
</TxnDeletedQueryRq>
</QBXMLMsgsRq>
</QBXML>
Example from here:
http://www.consolibyte.com/docs/index.php/QbXML_for_Querying_for_Deleted_Objects
http://www.consolibyte.com/docs/index.php/Example_qbXML_Requests
The full syntax with all options/flags you can set can be found in the QuickBooks OSR:
https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html
QuickBooks Online:
If you're using QuickBooks Online, then you can use the CDC requests to poll for recently changed data, including things that have been deleted.
https://quickbooks.api.intuit.com/v3/company/1234/cdc?entities=Class,Item,Invoice&changedSince=2012-07-20T22:25:51-07:00
Will return something like:
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-04-03T10:36:19.393Z">
<CDCResponse>
<QueryResponse>
<Customer>...
</Customer>
...
Some of which may have a status="Deleted" attribute to let you know it's been deleted.

Enterprise 2014 Bill Payment Query cannot find bill when bill is present in company file

Bill payment add cannot find matching bill in Enteprise 14 and the bill does exist for the customer. Could it have something to do with the length of the bill number? Please see XML below.
<OUTGOING>
<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE QBXML PUBLIC '-//INTUIT//DTD QBXML QBD 12.0//EN' ><QBXML><QBXMLMsgsRq onError = "continueOnError"><BillQueryRq><RefNumberRangeFilter><FromRefNumber>February Publisher P</FromRefNumber><ToRefNumber>February Publisher P</ToRefNumber></RefNumberRangeFilter><PaidStatus>NotPaidOnly</PaidStatus></BillQueryRq></QBXMLMsgsRq></QBXML>
</OUTGOING>
<RETURNS>
<QBXML>
<QBXMLMsgsRs>
<BillQueryRs statusCode="1" statusSeverity="Info" statusMessage="A query request did not find a matching object in QuickBooks" />
</QBXMLMsgsRs>
</QBXML>
</RETURNS>
I can't get this to work either. It appears to be a bug in the Bill Query ref number range filter. The query works OK if the ref number range filter is removed.
The filter also works if you use (SOF cuts of part of the answer)
StartsWithFebruary Publisher P

How to add other data to Quickbook with qbXML

I try this code it's work.(now, I can add Name : TestCustomer3)
And I want to add other data to Quickbook.
Can you Help me about qbXML Language.
Example : I want to add "Company Name", "Full Name", "Bill To"
Example Code
string input = #"<?xml version=""1.0"" encoding=""utf-8""?>
<?qbxml version=""2.0""?>
<QBXML>
<QBXMLMsgsRq onError=""stopOnError"">
<CustomerAddRq requestID=""15"">
<CustomerAdd>
<Name>TestCustomer3</Name> <!-- required -->
</CustomerAdd>
</CustomerAddRq>
</QBXMLMsgsRq>
</QBXML>";
The appropriate place to find this information is in the QuickBooks OSR:
https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html
To use the un-Intuit-ive QuickBooks OSR (pun intended) you should:
Use the "Select Message" drop-down box from the top of the screen to choose a command/request type
Click the "XML Ops" tab to view the XML request and response
Note that the XML request/response will be jumbled together a little, so make sure you look at the XML carefully to determine where the request ends, and the response starts.
We also have some other QuickBooks qbXML examples on our QuickBooks integration wiki.
The info can be found by reviewing the on screen reference for QBXML
https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html
thanks

Is there any service returning ZIP Codes on given city/satate?

is there any server available that i can use for getting zip codes on the basis on city/state ?
Thanks
You can use geonames postal code search. For example:
http://ws.geonames.org/postalCodeSearch?adminCode1=CA&placename=San+Francisco&maxRows=3
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<geonames>
<totalResultsCount>76</totalResultsCount>
<code>
<postalcode>94102</postalcode>
<name>San Francisco</name>
<countryCode>US</countryCode>
<lat>37.781334</lat>
<lng>-122.416728</lng>
<adminCode1>CA</adminCode1>
<adminName1>California</adminName1>
<adminCode2>075</adminCode2>
<adminName2>San Francisco</adminName2>
<adminCode3/>
<adminName3/>
</code>
<code>
<postalcode>94103</postalcode>
<name>San Francisco</name>
<countryCode>US</countryCode>
<lat>37.77254</lat>
<lng>-122.414664</lng>
<adminCode1>CA</adminCode1>
<adminName1>California</adminName1>
<adminCode2>075</adminCode2>
<adminName2>San Francisco</adminName2>
<adminCode3/>
<adminName3/>
</code>
<code>
<postalcode>94107</postalcode>
<name>San Francisco</name>
<countryCode>US</countryCode>
<lat>37.762147</lat>
<lng>-122.397099</lng>
<adminCode1>CA</adminCode1>
<adminName1>California</adminName1>
<adminCode2>075</adminCode2>
<adminName2>San Francisco</adminName2>
<adminCode3/>
<adminName3/>
</code>
</geonames>
You can use the US Postal Service HTTP/XML API
According to this page on the US Postal Service website which documents their XML based web API, specifically Section 3.0 (page 13) of this PDF document, they have a URL where you can send an XML request containing an address minus the Zip Code and they will respond with an XML document containing the complete address.
You can't do a lookup with just a city and state though, because a single city can contain multiple ZIP codes, so you need to pass the street address as well.
According to their documentation, this is what your request would look like:
GET http://SERVERNAME/ShippingAPITest.dll?API=ZipCodeLookup&XML=<ZipCodeLookupRequest%20USERID="xxxxxxx"><Address ID="0"><Address1></Address1> <Address2>6406 Ivy Lane</Address2><City>Greenbelt</City><State>MD</State></Address></ZipCodeLookupRequest>
And here's what you would receive back:
<?xml version="1.0"?>
<ZipCodeLookupResponse>
<Address ID="0">
<Address2>6406 IVY LN</Address2>
<City>GREENBELT</City>
<State>MD</State>
<Zip5>20770</Zip5>
<Zip4>1441</Zip4>
</Address>
</ZipCodeLookupResponse>
USPS does require that you register with them before you can use the API, but, as far as I could tell, there is no charge for access. By the way, their API has some other features: you can do Address Standardization and Zip Code Lookup, as well as the whole suite of tracking, shipping, labels, etc.

QuickBooks invoice modify has different address behavior than create, how to compensate?

I'm writting a function to take an invoice file in a defined format and import it into QuickBooks via qbXML. One of the requrements is that it be possible to reimport the same invoice number than that the existing invoice be modified rather than create a new one with the same number.
The problem I have is with how QuickBooks handles addresses. The addresses I'm getting can be in any format (In 6 different contenents), without any guarantee of adherence to a proper address format for that locale.
So creating the invoice is simple enough, I specify in the xml tag the billing address addr1 through addr5, and QuickBooks takes it no problem. HOWEVER it doesn't store the address as raw text, it attempts to parse out the city, state postal code and country.
Invoice modify, given the same address information, will not parse out the city state and zip, but rather leave the address line intact, and leave the city state and zip untouched, creating a duplicate line on the invoice, one of free form text, the other of the composite of city, state and postal code. The workaround for that was to explicity set city state zip country and note to blank on invoice modify. However, that hasn't fully solved the problem.
Sometimes QuickBooks will correctly parse the address and add a random number on the next line (internally represented on the note tab).
And sometimes QuickBooks will reject the address, even thought it accepted it on create. I assume because it is trying to parse a 5 line address and on modify since the city state and postal code have no where to go, it has no place to store them.
Right now my only solution is to simply leave the address untouched, and tell the user that due to QuickBooks limitations there is no way to modify the address on reimport of the invoice, only invoice lines.
Has anyone run into this before, and if so, do you have a better work around? Do you know of an address parser that can reasonably approximate what quickbooks does so I can send it city state and postal code on create in a consistent manner?
Now, to some degree (except for that last one) QuickBooks is giving me a response that tells me what it parsed on create, so I could theoretically store that to know what I am dealing with, but short of writing some time consuming address parsing routines is there any solution to get quickbooks to re parse the address from new.
Here is the request and the response. Note that the invoice create was identical, and that I removed some identifying information, but kept the field lengths the same.
Request:
<?xml version="1.0" encoding="UTF-8"?> <?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq newMessageSetID="243f42acf4011139b7a" onError="stopOnError">
<InvoiceModRq>
<InvoiceMod>
<TxnID>4E64-1242411202</TxnID>
<EditSequence>1242411202</EditSequence>
<CustomerRef>
<ListID>80000012-1242156814</ListID>
</CustomerRef>
<ARAccountRef>
<FullName>Accounts Receivable</FullName>
</ARAccountRef>
<TxnDate>2009-04-01</TxnDate>
<RefNumber>M-053491</RefNumber>
<BillAddress>
<Addr1>S & S ACME CO., INC.</Addr1>
<Addr2>MR. ABC ABCDEF</Addr2>
<Addr3>981 ABCD 761 ST</Addr3>
<Addr4>ABABC, AA 99999-3584</Addr4>
<Addr5>USA</Addr5>
<City/>
<State/>
<PostalCode/>
<Country/>
<Note/>
</BillAddress>
<TermsRef>
<FullName>NET 30</FullName>
</TermsRef>
<DueDate>2009-05-01</DueDate>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>ABCDEFG ABC $3,000.00 *</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>FOR:</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<ItemRef>
<FullName>ANFEE</FullName>
</ItemRef>
<Desc>1 . #9999 S & S ABCD CO., INC., ABCDE, AA *</Desc>
<Amount>123456.72</Amount>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>PLEASE NOTE: Blahh Someone sellificant repeats on July 31st, 2009.</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>Sellifcan of your Someone Ssellificant to Jan. 31st, 2011 is contingent upon</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>your satisfying all open invoices and all other/different issues.</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>* PLUS expenses for some amount of service described here.</Desc>
</InvoiceLineMod>
</InvoiceMod>
</InvoiceModRq>
</QBXMLMsgsRq>
</QBXML>
Response:
<?xml version="1.0" ?> <QBXML>
<QBXMLMsgsRs newMessageSetID="243f42acf4011139b7a">
<InvoiceModRs statusCode="3210" statusSeverity="Error"
statusMessage="The "address" field has an invalid value "". QuickBooks error message: The parameter is incorrect. "/>
</QBXMLMsgsRs>
</QBXML>
Another potential workaround here is to double-update the invoice. First blank out the address. Second is send the five lines without any mention of the city state zip, etc., as was done on create.
I didn't test this (the users accepted that the address won't change, so I'm not going to try it), but I'm putting this here as an idea so if someone has a similar problem they can try it and perhaps comment here if it works.

Resources