QBXML for Bill Add request

473 Views Asked by At

I need some help in my current implementation of automating the Bills flow from our system to QB. I have done all necessary changes that will pass the Bills related information from our system to QB and expect to save it under Bill on QB . Below is sample qbxml i am requesting. But i am getting below error message from QB. Please guide me if any change needed in the xml request.

Error message from QB:

20200325.16:57:30 UTC   : QBWebConnector.SOAPWebService.do_sendRequestXML() : Request xml received.
20200325.16:57:30 UTC   : QBWebConnector.SOAPWebService.ProcessRequestXML() : Processing request #2
20200325.16:57:30 UTC   : QBWebConnector.SOAPWebService.ProcessRequestXML() : REQUEST: received from pplication: size (bytes) = 711
20200325.16:57:30 UTC   : QBWebConnector.SOAPWebService.ProcessRequestXML() : Sending request to uickBooks.
20200325.16:57:30 UTC   : QBWebConnector.SOAPWebService.ProcessRequestXML() : Sending error message back to application:
HRESULT = 0x80040400
**Message: QuickBooks found an error when parsing the provided XML text stream.**
20200325.16:57:30 UTC   : QBWebConnector.SOAPWebService.ProcessRequestXML() : XML dump follows: -

Request that failed:

<?xml version="1.0" encoding="ASCII"?><?qbxml versi......**

QBXML request:

<?xml version="1.0" encoding="ASCII"?>
<?qbxml version="13.0"?>
<QBXML>
    <QBXMLMsgsRq onError="continueOnError">
        <BillAddRq requestID="9240">
            <BillAdd>
                <VendorRef>
                    <FullName>ALERNER</FullName>
                </VendorRef>
                <TxnDate>2020-03-25</TxnDate>
                <DueDate>2020-03-24</DueDate>
                <RefNumber>100</RefNumber>
                <TermsRef>
                    <FullName>Net 30 Days</FullName>
                </TermsRef>
                <Memo>via access</Memo>
                <Address>
                    <Adr1>1060 N Kings Hway Suite 220</Adr1>
                    <City>Cherry Hill</City>
                    <State>NJ</State>
                    <PostalCode>08034</PostalCode>
                    <Country></Country>
                </Address>
                <ItemLineAdd>
                    <ItemRef>
                        <ListID>430001 - 1197741385</ListID>
                    </ItemRef>
                    <Desc>1 cubed mice</Desc>
                    <Quantity>10</Quantity>
                    <Cost>5</Cost>
                    <Amount>6</Amount>
                </ItemLineAdd>
            </BillAdd>
        </BillAddRq>
    </QBXMLMsgsRq>
</QBXML>
1

There are 1 best solutions below

0
On

Anytime you see this:

QuickBooks found an error when parsing the provided XML text stream.

It means your XML either isn't valid, or doesn't match the XSD Intuit has defined to validate against required fields / data types / etc.

The very first thing you should do when you run into this is use the XML Validator tool that is included with the QuickBooks SDK. Don't go use one online, use the one included with the QuickBooks SDK because it not only validates the XML structure itself, but validates data types, field lengths, element ordering, etc. against the XSDs.

In this case, your issue is that Address is not a valid element at all (you're probably looking for VendorAddress).

You can also refer to Intuit's documentation:

Edit: OSR link has been updated for some reason use the following link https://static.developer.intuit.com/qbSDK-current/common/newosr/index.html