0

I want to get all inventory items from quickbooks with only full name and quantity on hand fields, in order to get a smaller xml. Do you know how to achieve this?

This is the xml query request:

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="10.0"?>
<QBXML>
    <QBXMLMsgsRq onError="stopOnError">
        <ItemInventoryQueryRq>
        </ItemInventoryQueryRq>
    </QBXMLMsgsRq>
</QBXML>
Alex
  • 436
  • 4
  • 9

1 Answers1

4

You can use this tag to pick specifically which fields you want to include:

<IncludeRetElement>

For example, this gets invoices, but only the TxnID, EditSequence, and RefNumber fields:

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="8.0"?>
<QBXML>
  <QBXMLMsgsRq onError="stopOnError">
    <InvoiceQueryRq requestID="abcd1234">

      <TxnID>ABCD-1234</TxnID>

      <IncludeRetElement>TxnID</IncludeRetElement>
      <IncludeRetElement>EditSequence</IncludeRetElement>
      <IncludeRetElement>RefNumber</IncludeRetElement>

    </InvoiceQueryRq>
  </QBXMLMsgsRq>
</QBXML>

Example from this wiki:

You may also want to reference Intuit's documentation which shows this, the QuickBooks OSR:

Keith Palmer Jr.
  • 27,666
  • 16
  • 68
  • 105