quickbooksqbxmlqbwc

XML Error while Modifying Sales Order in QB Desktop


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>

Solution

  • 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.