Pratik
Pratik

Reputation: 1541

Fetching all Items from a Sales order in Quickbooks using PHP sdk

I using PHP sdk to connect to QuickBooks through Web Connector.

I am able to write QBXML request for fetching all sales order from QuickBooks.

Below is my QBXML request.

    <?qbxml version="11.0"?>

    <QBXML>

        <QBXMLMsgsRq onError="stopOnError">

            <SalesOrderQueryRq  iterator="Start"  >

                <MaxReturned>100</MaxReturned>

            </SalesOrderQueryRq>    

        </QBXMLMsgsRq>

    </QBXML>

It returns all details of sales orders but not the items which are in that sales order.
I want to fetch all items with their cost in particular sales order.
So can anybody tell me how can I do that ?

Upvotes: 0

Views: 1634

Answers (1)

Keith Palmer Jr.
Keith Palmer Jr.

Reputation: 27952

If you refer to the QuickBooks OSR Documentation, you'll notice that SalesOrderQueryRq requests support a tag called:

<IncludeLineItems>BOOLTYPE</IncludeLineItems>

Which is documented as follows (emphasis mine):

This filter allows you to omit line items from a query response to get a smaller result. The default value is false, so line items are omitted by default. Set IncludeLineItems to true to include line items in the response if you dont mind getting a larger result.

Soooo... if you set that to TRUE:

<?qbxml version="11.0"?>
<QBXML>
    <QBXMLMsgsRq onError="stopOnError">
        <SalesOrderQueryRq iterator="Start">
            <MaxReturned>100</MaxReturned>
            <IncludeLineItems>true</IncludeLineItems>
        </SalesOrderQueryRq>    
    </QBXMLMsgsRq>
</QBXML>

Then you'll get back the line items together with the core Sales Order data.

Upvotes: 1

Related Questions