当尝试使用字段InventorySiteRef添加发票时,Quickbooks Web连接器会出现解析错误。
0x80040400:QuickBooks在解析提供的XML文本流时发现错误。
以下是我的XML流。
<?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>
我也只尝试过
<InventorySiteRef>
<FullName>Odessa</FullName>
</InventorySiteRef>
并且只尝试了
<InventorySiteLocationRef>
<FullName>Odessa</FullName>
</InventorySiteLocationRef>
当我尝试添加没有InventorySiteRef和InventorySiteLocationRef标签的发票成功创建的发票时
我认为InventorySiteRef没有定义,在QuickBooks的某处可以使用PHP DevKit。
答案 0 :(得分:0)
启用详细日志记录并查看实际生成的QBXML。 QBXML将在日志文件中。 https://help.developer.intuit.com/s/article/QBD-QBSDK-Logging
生成QBXML并通过QBXML SDK附带的验证程序运行它。
确保您的标签顺序正确并且与“屏幕参考指南”相符。 https://developer-static.intuit.com/qbsdk-current/common/newosr/index.html