Skip to content
Advertisement

Intuit Quickbooks Online API how to handle purchase response in PHP SDK

I’m trying to query for purchases from my QBO.

JavaScript

Please provide me link if there is any doc explaining how to handle the response object using php. i’m using IPP V3 Keith Palmer sdk

There are methods for retrieving information form account query object as show below.

JavaScript

I’m looking for similar kind of methods to work on purchase response object

I checked the purchase entities doc on quickbooks but its not providing details on how to extract data from the response object

Advertisement

Answer

The PHP methods exactly mirror the XML node names displayed in the Intuit documentation.

For example, Intuit’s documentation shows an object like this:

JavaScript

So, your Purchase object is going to have methods that mirror this XML structure. For example:

JavaScript

Unsurprisingly, there are also ->set*(...) methods too.

JavaScript

In the case of line items (which there can be more than one of), you can count the number of Line nodes like this:

JavaScript

And then loop through them:

JavaScript

Unsurprisingly, the Line object will have a method for each node it contains too:

JavaScript

As a shortcut, you can also use XPath statements to get at this data:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement