0

Quickbooks web connector give parsing error when trying to add invoice with field InventorySiteRef.

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

Below is my XML stream.

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
    <QBXMLMsgsRq onError="continueOnError">
    <InvoiceAddRq requestID="' . $requestID . '">
        <InvoiceAdd>
            <CustomerRef>
                <ListID>' . $invoice['customer_id'] . '</ListID>
            </CustomerRef>
            <RefNumber>' . $invoice['ref_number'] . '</RefNumber>
            <BillAddress>
                <Addr1>' . $invoice['bill_addr1'] . '</Addr1>
                <Addr2>' . $invoice['bill_addr2'] . '</Addr2>
                <Addr3>' . $invoice['bill_addr3'] . '</Addr3>
                <Addr4>' . $invoice['bill_city'] . '</Addr4>
                <State>' . $invoice['bill_state'] . '</State>
                <PostalCode>' . $invoice['bill_postalcode'] . '</PostalCode>
            </BillAddress>
            <ShipAddress>
                <Addr1>' . $invoice['ship_addr1'] . '</Addr1>
                <Addr2>' . $invoice['ship_addr2'] . '</Addr2>
                <Addr3>' . $invoice['ship_addr3'] . '</Addr3>
                <Addr4>' . $invoice['ship_city'] . '</Addr4>
                <State>' . $invoice['ship_state'] . '</State>
                <PostalCode>' . $invoice['ship_postalcode'] . '</PostalCode>
            </ShipAddress>
            <PONumber>' . $invoice['po_number'] . '</PONumber>
            <DueDate>' . $invoice['due_date'] . '</DueDate>
            <ShipDate>' . $invoice['ship_date'] . '</ShipDate>
            <Memo>' . $invoice['memo'] . '</Memo>
            <InvoiceLineAdd>
                <ItemRef>
                    <FullName>'.$line['item_name'].'</FullName>
                </ItemRef>
                <Quantity>'.$line['quantity'].'</Quantity>
                <Rate>'.$line['rate'].'</Rate>
                <Amount>'.$line['amount'].'</Amount>
                <InventorySiteRef>
                    <FullName>Odessa</FullName>
                </InventorySiteRef>
                <InventorySiteLocationRef>
                    <FullName>Odessa</FullName>
                </InventorySiteLocationRef>
            </InvoiceLineAdd>
        </InvoiceAdd>
    </InvoiceAddRq>
</QBXMLMsgsRq>

I also tried with only

<InventorySiteRef>
    <FullName>Odessa</FullName>
</InventorySiteRef>

And also tried with only

<InventorySiteLocationRef>
    <FullName>Odessa</FullName>
</InventorySiteLocationRef>

When I tried to add an invoice without InventorySiteRef and InventorySiteLocationRef Tag's Invoice created successfully

I think InventorySiteRef is not define, somewhere in QuickBooks consolibyte PHP DevKit.

  • Possible duplicate of [Quickbooks WebConnector How I can add invoice with Item Location/Site](http://stackoverflow.com/questions/43679481/quickbooks-webconnector-how-i-can-add-invoice-with-item-location-site) – Keith Palmer Jr. May 02 '17 at 14:01
  • No It's not duplicate, it's some how match. but using xml tag InventorySiteRef it gives xml parsing error – Mohsan Azad May 03 '17 at 07:46
  • It's the exact same request, and my answer included information specifically on how to troubleshoot this exact specific issue. If you read my answer, it tells you exactly how to troubleshoot and fix this. – Keith Palmer Jr. May 03 '17 at 09:57
  • Thank you @KeithPalmerJr. QBXML SDK Validate Program solved my issue – Mohsan Azad May 03 '17 at 14:04

1 Answers1

0

Enable verbose logging and look at what QBXML is actually being generated. The QBXML will be in the log file. https://help.developer.intuit.com/s/article/QBD-QBSDK-Logging

Take the QBXML being generated and run that through the validator program included with the QBXML SDK.

Make sure you have the order of the tags correct and that it matches the Onscreen Reference Guide. https://developer-static.intuit.com/qbsdk-current/common/newosr/index.html

William Lorfing
  • 2,656
  • 10
  • 7