quickbooks desktop web connector qbxml: add invoic

2019-08-08 21:01发布

I'm trying to add an invoice and populate its CLASS field with a value (I can't post a screenshot of the invoice "CLASS" field because I don't have the reputation, its the field just to the right of "PRICE EACH" field), I don't know how to add the CLASS value in the qbxml. Here is the xml I'm using and it works:

$xml = '<?xml version="1.0" encoding="utf-8"?>
            <?qbxml version="2.0"?>
            <QBXML>
              <QBXMLMsgsRq onError="stopOnError">
                <InvoiceAddRq requestID="xxxxxxxx">
                  <InvoiceAdd>
                    <CustomerRef>
                      <FullName>Some company:12 street gotham</FullName>
                    </CustomerRef>
                    <TxnDate>2015-01-23</TxnDate>
                    <RefNumber>TPY125</RefNumber>
                    <BillAddress>
                      <Addr1>some bill address</Addr1>
                      <City>some bill city</City>
                      <State>some bill state</State>
                      <PostalCode>some bill zip</PostalCode>
                      <Country>United States</Country>
                    </BillAddress>
                    <ShipAddress>
                        <Addr1>some ship address</Addr1>
                        <City>some ship address</City>
                        <State>some ship state</State>
                        <PostalCode>some ship zip</PostalCode>
                        <Country>United States</Country>
                    </ShipAddress>
                    <PONumber></PONumber>
                    <TermsRef>
            <FullName>Net 120</FullName>
                    </TermsRef>
                    <Memo></Memo>

                    <InvoiceLineAdd>
                      <ItemRef>
                        <FullName>16 Electrical and Lighting</FullName>
                      </ItemRef>
                      <Desc>Item 1 Description Goes Here</Desc>
                      <Quantity>1</Quantity>
                      <Rate>33.00</Rate>                      
                    </InvoiceLineAdd>

                  </InvoiceAdd>
                </InvoiceAddRq>
              </QBXMLMsgsRq>
            </QBXML>';

I'm using QuickBooks Enterprise, Web connector ver: 2.1.0.30. So what do I have to add in the xml for the "CLASS" field? Thanks in advance.

1条回答
萌系小妹纸
2楼-- · 2019-08-08 21:52

You can always refer to the QuickBooks OSR for XML reference for QuickBooks desktop:

In this specific case, you can set the Class on a per line item basis like this:

                ...
                <InvoiceLineAdd>
                  <ItemRef>
                    <FullName>16 Electrical and Lighting</FullName>
                  </ItemRef>
                  <Desc>Item 1 Description Goes Here</Desc>
                  <Quantity>1</Quantity>
                  <Rate>33.00</Rate>   

                  <ClassRef>
                    <ListID> ... specify a ListID here ...</ListID
                     <!-- Or, instead of ListID you can specify: -->
                    <FullName> ... specify Class FullName here ...</FullName>

                </InvoiceLineAdd>
                ...
查看更多
登录 后发表回答