QuickBooks Query/Add vendor with Web Connector

1.4k views Asked by At

I have QuickBooks Web Connector up and running and can successfully run the SDK web service example. I am now trying to query for a vendor and add if it doesn't exist.

However, I am getting the following error on my initial query:

QuickBooks found an error when parsing the provided XML text stream

There are no illegal characters in the XML. What I am sending:

<?xml version="1.0"?>
<?qbxml version="4.0"?>
<QBXML>
    <QBXMLMsgsRq onError="stopOnError">
        <VendorQueryRq requestID="1">
            <FullName>My Vendor</FullName>
            <MaxReturned>1</MaxReturned>
        </VendorQueryRq>
    </QBXMLMsgsRq>
</QBXML>

I'm looking for a vendor query and add example and an XSD if possible.

1

There are 1 answers

2
Keith Palmer Jr. On BEST ANSWER

Since you're querying by FullName, and FullName is a unique key in QuickBooks, you can't also use MaxReturned (since it's a unique key, you can always only get a maximum of 1 result back).

<?xml version="1.0"?>
<?qbxml version="4.0"?>
<QBXML>
    <QBXMLMsgsRq onError="stopOnError">
        <VendorQueryRq requestID="1">
            <FullName>My Vendor</FullName>
        </VendorQueryRq>
    </QBXMLMsgsRq>
</QBXML>

The OSR is always the best source for qbXML:

We also have a wiki with some example requests on it over here: