Reputation: 552
I am trying to add a sales order to quickbooks using Quickbooks Webconnector. When i add a single order its successfully added, but when i try to add multiple orders in a single qbxml, quickbooks throws the following error.
"message="QuickBooks found an error when parsing the provided XML text stream."
Following is the request QBXML sent
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?qbxml version="8.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<SalesOrderAddRq>
<SalesOrderAdd defMacro="MACROTYPE">
<CustomerRef>
<FullName>Amazon.com.nvdc, Inc</FullName>
</CustomerRef>
<TxnDate>2014-07-29</TxnDate>
<BillAddress>
<Addr1>RNO1</Addr1>
<City>Fernley</City>
<State>NV</State>
<PostalCode>89408-8903</PostalCode>
<Country>US</Country>
</BillAddress>
<PONumber>TST00003</PONumber>
<DueDate>2014-07-29</DueDate>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLU</FullName>
</ItemRef>
<Desc>ES-10BLU</Desc>
<Quantity>3</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUINVALID</FullName>
</ItemRef>
<Desc>ES-10BLUINVALID</Desc>
<Quantity>4</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUDISC</FullName>
</ItemRef>
<Desc>ES-10BLUDISC</Desc>
<Quantity>5</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
</SalesOrderAdd>
<SalesOrderAdd defMacro="MACROTYPE">
<CustomerRef>
<FullName>Amazon.com.nvdc, Inc</FullName>
</CustomerRef>
<TxnDate>2014-07-29</TxnDate>
<BillAddress>
<Addr1>RNO1</Addr1>
<City>Fernley</City>
<State>NV</State>
<PostalCode>89408-8903</PostalCode>
<Country>US</Country>
</BillAddress>
<PONumber>TST00004</PONumber>
<DueDate>2014-07-29</DueDate>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLU</FullName>
</ItemRef>
<Desc>ES-10BLU</Desc>
<Quantity>3</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUINVALID</FullName>
</ItemRef>
<Desc>ES-10BLUINVALID</Desc>
<Quantity>4</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUDISC</FullName>
</ItemRef>
<Desc>ES-10BLUDISC</Desc>
<Quantity>5</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
</SalesOrderAdd>
<SalesOrderAdd defMacro="MACROTYPE">
<CustomerRef>
<FullName>Amazon.com.nvdc, Inc</FullName>
</CustomerRef>
<TxnDate>2014-07-29</TxnDate>
<BillAddress>
<Addr1>RNO1</Addr1>
<City>Fernley</City>
<State>NV</State>
<PostalCode>89408-8903</PostalCode>
<Country>US</Country>
</BillAddress>
<PONumber>TST00005</PONumber>
<DueDate>2014-07-29</DueDate>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLU</FullName>
</ItemRef>
<Desc>ES-10BLU</Desc>
<Quantity>3</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUINVALID</FullName>
</ItemRef>
<Desc>ES-10BLUINVALID</Desc>
<Quantity>4</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUDISC</FullName>
</ItemRef>
<Desc>ES-10BLUDISC</Desc>
<Quantity>5</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
</SalesOrderAdd>
</SalesOrderAddRq>
</QBXMLMsgsRq>
</QBXML>
Does quickbooks support sending multiple sales orders in a single qbxml request or it accepts only one order in 1 request?
Upvotes: 2
Views: 891
Reputation: 27952
Whenever you see this error message:
QuickBooks found an error when parsing the provided XML text stream.
The very first thing you should be doing is running your XML through the XML Validator tool included with the QuickBooks SDK.
If you do that, you'll get this back:
Line: 48
LinePos: 49
Src Text: <SalesOrderAdd defMacro="MACROTYPE">
Reason: Element content is invalid according to the DTD/Schema.
Expecting: IncludeRetElement.
That's basically telling you that this tag:
<SalesOrderAdd
On this line:
Line: 48
Isn't correct.
It isn't correct because you didn't close your </SalesOrderAddRq>
tag before opening a new <SalesOrderAdd>
tag. You should have this around line 48 instead:
</SalesOrderAdd>
</SalesOrderAddRq> <!-- close the first request we're making... -->
<SalesOrderAddRq> <!-- ... before starting our second request -->
<SalesOrderAdd>
Upvotes: 6