I am using consobyte PHP SDK for QuickBooks Desktop and when I try to add Non Inventory Item, it throws the error-0x80040400: QuickBooks found an error when parsing the provided XML text stream.
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<ItemNonInventoryAddRq requestID="38">
<ItemNonInventoryAdd>
<Name>46428</Name>
<SalesAndPurchase>
<SalesDesc>Apple Watch (not Sport)</SalesDesc>
<SalesPrice>50.00</SalesPrice>
<IncomeAccountRef>
<FullName>Merchandise Sales</FullName>
</IncomeAccountRef>
<PurchaseDesc>Apple Watch (not Sport)</PurchaseDesc>
<PurchaseDesc>50.00</PurchaseDesc>
<ExpenseAccountRef>
<FullName>Repairs and Maintenance</FullName>
</ExpenseAccountRef>
</SalesAndPurchase>
</ItemNonInventoryAdd>
</ItemNonInventoryAddRq>
</QBXMLMsgsRq>
</QBXML>
Fix this:
Anytime you get this error message:
The first thing you should do is look at your XML closely. And then run it through the
XML Validator
tool included with the QuickBooks SDK. It tells you exactly what's wrong: