2
votes

I am using Quickbooks SDK (qbxml) for desktop for modifying an invoice and I am getting an error "QuickBooks found an error when parsing the provided XML text stream." I am using C# as the development language. I am using the "Other" and "FOB" fields for showing the UPS shipping details.

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
 <QBXMLMsgsRq onError="stopOnError">
  <InvoiceModRq requestID="2">
   <InvoiceMod>
    <TxnID>18D23-1422298930</TxnID>
    <EditSequence>1423512371</EditSequence>
    <Other>1ZAV49630440508209</Other>
    <ShipDate>2015-02-03</ShipDate>
    <FOB>2015-02-04</FOB>
   </InvoiceMod>
  </InvoiceModRq>
 </QBXMLMsgsRq>
</QBXML>

Whats wrong in this?

1
Just a wild guess but since the Xml looks fine at a first glance maybe the parser chokes on the date string formats because it expects <FOB>02/03/2015</FOB> instead of <FOB>2015-02-03</FOB>Filburt
Hi Filburt, it didnt work. Also, when I modify one field at a time, its working fine. for example, if I take off "Other" and "ShipDate" and retain "FOB" it will update successfully.sony
Admittedly I'm not familiar with the QuickBooks SDK so I'll have to leave it to the real pros here.Filburt

1 Answers

1
votes

The order of the elements in qbXML is important.

If you refer to the documentation:

Or some FAQs out there:

You'll notice that it specifies this order (FOB, then ShipDate):

...
<FOB >STRTYPE</FOB> <!-- optional -->
<ShipDate >DATETYPE</ShipDate> <!-- optional -->
...

While you specify this order (ShipDate, then FOB):

...
<ShipDate>2015-02-03</ShipDate>
<FOB>2015-02-04</FOB>
...

Fix the order of your XML elements, and you'll be all set.