Search code examples
phpapiquickbooks

Quickbooks web API - Pulling data from quickbooks


I would like to be able to pull data from an existing online QB setup that I have access to, specifically all customers data that are sub accounts of a specific parent account. I would then like to add the data to a html table. Is this possible and if so where do I start? Thanks.


Solution

  • Is this possible

    Yes.

    where do I start?

    If I was you... I would start by searching. This question gets answered over and over and over again on StackOverflow, and there's tons of Google results too.

    But... here's an overview:

    Look in the docs/ directory of the above QuickBooks PHP open-source code. There's lot of examples of querying QuickBooks Online for data. Specifically, you're probably going to want some code that looks like this:

    $CustomerService = new QuickBooks_IPP_Service_Customer();
    $customers = $CustomerService->query($Context, $realm, "SELECT * FROM Customer MAXRESULTS 25");
    foreach ($customers as $Customer)
    {
        print('Customer Id=' . $Customer->getId() . ' is named: ' . $Customer->getFullyQualifiedName() . '<br>');
    }