1

I am sending a QBXML to quickbooks for adding a sales order. Everything runs fine but when i add the tag for InventoryRef as below i get XML not valid error.

<SalesOrderLineAdd>
    <InventorySiteRef>
        <FullName>Austin</FullName>
    </InventorySiteRef>
    <ItemRef>
        <FullName>ES-10BLU</FullName>
    </ItemRef>
    <Desc>BS10ELU</Desc>
    <Quantity>3</Quantity>
    <Rate>100.0</Rate>
</SalesOrderLineAdd>

http://www.consolibyte.com/docs/index.php/QbXML_for_Adding_a_Sales_Order

the above link does not have InventorySiteRef as a valid add tag, but the on screen reference on intuit( https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html ) has this field as a valid tag in add request.

Please let me know why i get invalid XML error when i send InventorySiteRef tag as mentioned in OSR?

UPDATE:

<?xml version="1.0" ?>
<?qbxml version="8.0"?>
<QBXML>
    <QBXMLMsgsRq onError="stopOnError">
        <SalesOrderAddRq>
            <SalesOrderAdd defMacro="MACROTYPE">
                <CustomerRef>
                    <FullName>Amazon.com.nvdc, Inc</FullName>
                </CustomerRef>
                <TxnDate>2014-08-11</TxnDate>
                <RefNumber>TST00002H</RefNumber>
                <BillAddress>
                    <Addr1>1600 East Newlands Drive</Addr1>
                    <City>Fernley</City>
                    <State>NV</State>
                    <PostalCode>89408-8903</PostalCode>
                    <Country>US</Country>
                </BillAddress>
                <ShipAddress>
                    <Addr1>1600 East Newlands Drive</Addr1>
                    <City>Fernley</City>
                    <State>NV</State>
                    <PostalCode>89408-8903</PostalCode>
                    <Country>US</Country>
                </ShipAddress>              
                <SalesOrderLineAdd>
                    <ItemRef>
                        <FullName>ES-10BLU</FullName>
                    </ItemRef>
                    <Desc>BS10ELU</Desc>
                    <Quantity>3</Quantity>
                    <Rate>100.0</Rate>
                    <InventorySiteRef>
                        <FullName>Austin</FullName>
                    </InventorySiteRef>
                </SalesOrderLineAdd>
            </SalesOrderAdd>
        </SalesOrderAddRq>
    </QBXMLMsgsRq>
</QBXML>

The above is the request XML which i am sending. I tested it with Quickbooks SDK and it gives me the following error

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

The error occurs only when InventorySiteRef is added. Otherwise it is processed though the OSR shows this tag in request

Raghav
  • 552
  • 1
  • 9
  • 34

2 Answers2

2

I have resolved this issue. The qbxml version was the issue. I was using 8.0 which didn't support InventorySiteRef tag in sales order add. I changed it to 12 which supports this tag and it worked like a charm.

Hope it helps someone facing such issue. :)

Raghav
  • 552
  • 1
  • 9
  • 34
0

You should use the Validator program included with the QBXML SDK to see what line is in error.

In this case, InventorySiteRef is not in the correct order. Order does matter and this should be at the end of the SalesOrderLineAdd and not the beginning.

William Lorfing
  • 2,656
  • 10
  • 7
  • I tried your suggestion to add InventorySiteRef at the end and tested it in SDK but still getting error(Error updated in question). Please suggest if this tag is supported or its not and the OSR might be incorrect? – Raghav Aug 22 '14 at 05:32