0

I am trying to modify a sales order created in QB Desktop. But it gives me XML error

0x80040400: QuickBooks found an error when parsing the provided XML text stream

Here is my XML Request

<?xml version="1.0" encoding="ISO-8859-1"?>
<?qbxml version="11.0"?>
<QBXML>
  <QBXMLMsgsRq onError="stopOnError">
    <SalesOrderModRq>
      <SalesOrderMod>
        <TxnID>1-1672737866</TxnID>
        <EditSequence>1672737866</EditSequence>
        <CustomerRef>
          <FullName>156004 Loose Bee Ln</FullName>
        </CustomerRef>
        <TxnDate>2023-01-03</TxnDate>
        <BillAddress>
          <Addr1>123</Addr1>
          <Addr2></Addr2>
          <City>Gity</City>
          <State>Ritham</State>
          <PostalCode>5555</PostalCode>
          <Country>Universe</Country>
        </BillAddress>
        <PONumber>4444444</PONumber>
        <Other>Southshore Bay</Other>
        <SalesOrderLineMod>
         <TxnID>3-1672737866</TxnID
          <ItemRef>
            <FullName>Single Family - One Story</FullName>
          </ItemRef>
          <Desc>Foundation</Desc>
          <Quantity>1</Quantity>
          <Amount>85.00</Amount>
          <DataExtMod>
            <OwnerID>0</OwnerID>
            <DataExtName>Lot</DataExtName>
            <DataExtValue>8/98</DataExtValue>
          </DataExtMod>
          <DataExtMod>
            <OwnerID>0</OwnerID>
            <DataExtName>Address</DataExtName>
            <DataExtValue>156004 Loose Bee Ln</DataExtValue>
          </DataExtMod>
        </SalesOrderLineMod>
      </SalesOrderMod>
    </SalesOrderModRq>
  </QBXMLMsgsRq>
</QBXML>
desertnaut
  • 57,590
  • 26
  • 140
  • 166
SreRoR
  • 1,151
  • 1
  • 17
  • 44

1 Answers1

1

Whenever you get this error:

0x80040400: QuickBooks found an error when parsing the provided XML text stream

It means you used an XML tag incorrectly, an unsupported XML tag, or an XML tag in the wrong order.

You can refer to the documentation to see what supported tags, their order, etc. are:

At least at first glance, I can see that TxnID inside SalesOrderLineMod is not correct (maybe you meant TxnLineID instead?):

      <SalesOrderLineMod>
         <TxnID>3-1672737866</TxnID

It may also be worth double-checking those DataExtMod tags too.

Keith Palmer Jr.
  • 27,666
  • 16
  • 68
  • 105
  • Thanks @Keith Palmer Jr., The error fixed, even syntax error and xml error also was there ( actually I have to use TxnLineID instead of TxnID), But when I tried with DataExtMod it gives error,. Wthout DataExt XML SO modifications works. But from the above documentation too, I'm troubling to find out exact modify structure for Data Ext. Can you help on that? – SreRoR Jan 04 '23 at 16:54
  • You probably want to do a separate `DataExtMod` request, separate from your `SalesOrderAdd` request. – Keith Palmer Jr. Jan 05 '23 at 20:48
  • @ Keith Palmer Jr. Can I pass both 'SalesOrderMod' ans 'DataExtMod' in same XML request? Or I have to sent two XML structure as separate request? Can you give a sample example for that. – SreRoR Jan 09 '23 at 10:24
  • You can do it in a single request. There's some examples of other folks doing this if you search: https://stackoverflow.com/search?q=qbxml+multiple+requests – Keith Palmer Jr. Jan 11 '23 at 12:01