How to modify an invoice in quickbooks using qbxml and qbsdk13?

假装没事ソ 提交于 2019-12-08 08:51:00

问题


This is my QBXML request

<?xml version="1.0" ?>
<?qbxml version="6.0"?>
<QBXML>
    <QBXMLMsgsRq onError="stopOnError">
        <InvoiceModRq requestID="1">
            <InvoiceMod>
                <TxnID>85-1442639879</TxnID>
                <EditSequence>1442639879</EditSequence>
                <CustomerRef>
                    <ListID>80000005-1442639850</ListID>
                    <FullName>Bruce Banner</FullName>
                </CustomerRef>
                <TxnDate>2015-09-19</TxnDate>
                <RefNumber>5462</RefNumber>
                <InvoiceLineMod>
                    <ItemRef>
                        <ListID>8000000A-1442469770</ListID>
                        <FullName>Item 1</FullName>
                    </ItemRef>
                    <Quantity>1</Quantity>
                    <Rate>1100.00</Rate>
                </InvoiceLineMod>
            </InvoiceMod>
        </InvoiceModRq>
    </QBXMLMsgsRq>
</QBXML>

I am getting an error QuickBooks found an error when parsing the provided XML text stream.

please help


回答1:


If you refer to the QuickBooks OSR:

  • https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html

You'll notice that within the <InvoiceLineMod> element, this node is required:

  • <TxnLineID>

The OSR gives you a bit more information too:

TxnLineID

Identification number of the transaction line. (TxnLineID is supported as of v2.0 of the SDK. With qbXML v1.0 and v1.1, TxnLineID is always returned as zero.)

If you need to add a new transaction line in a transaction Mod request, you can do so by setting the TxnLineID to -1.

So, you'll need to add in a <TxnLineID> node. If it's a new line item, put -1 for the content within the node. If it's an existing line you're trying to update, put the TxnLineID value of the existing line in there.

Example:

...
<InvoiceLineMod>
    <TxnLineID>-1</TxnLineID>
    <ItemRef>
        <ListID>8000000A-1442469770</ListID>
        <FullName>Item 1</FullName>
    </ItemRef>
    <Quantity>1</Quantity>
    <Rate>1100.00</Rate>
</InvoiceLineMod>
...


来源:https://stackoverflow.com/questions/32817070/how-to-modify-an-invoice-in-quickbooks-using-qbxml-and-qbsdk13

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!