0
votes

I need to develop a simple PHP application for a client that connects to quickbooks online to populate customer data and invoices.

Is there an easy way to accomplish this or does it really require going through the IPP app setup, including the OAuth setup, etc? This app will only ever be used for this one customer, and I have no intentions to use it elsewhere.

All I really need is a way to hit their API. Any guidance or information on navigating this would be appreciated!

2

2 Answers

1
votes

To start development using QB API, you need to create an IA apps in Intuit's appcenter. https://developer.intuit.com/docs/0025_quickbooksapi/0010_getting_started/0010_signup

From the above link you will get - apptoken, consumer key and consumer Secret. You can use the above 3 keys in IPPOAuthPlayground(PFB link) to get the access token and access secret corresponding to your QB Online account. https://appcenter.intuit.com/Playground/OAuth

Intuit provides PHP devkit which you can download from the link below. You can simply plugin the above OAuth tokens in devkit and call any QB endpoints.

Download Link - https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits

User Guide ( code snippets ) - https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0210_ipp_php_sdk_for_quickbooks_v3/0002_synchronous_calls/0001_data_service_apis

Thanks

1
votes

If you're integrating with QuickBooks Online, you need to use OAuth. It's ridiculously trivial to get started with OAuth and QuickBooks Online if you use existing code - here's an open-source QuickBooks PHP DevKit which should be helpful (disclaimer - I'm the author):

If you follow the quick-start guide:

You should be up and running within 15 minutes or so. It's as easy as registering with Intuit, changing a few configuration variables, and clicking a "Connect to QuickBooks" button.

You end up with some pretty simple looking code like this:

$CustomerService = new QuickBooks_IPP_Service_Customer();

$Customer = new QuickBooks_IPP_Object_Customer();
$Customer->setTitle('Mr');
$Customer->setGivenName('Keith');
$Customer->setMiddleName('R');
$Customer->setFamilyName('Palmer');
$Customer->setDisplayName('Keith R Palmer ' . mt_rand(0, 1000));

// Email
$PrimaryEmailAddr = new QuickBooks_IPP_Object_PrimaryEmailAddr();
$PrimaryEmailAddr->setAddress('[email protected]');
$Customer->setPrimaryEmailAddr($PrimaryEmailAddr);

if ($resp = $CustomerService->add($Context, $realm, $Customer))
{
    print('Our new customer ID is: [' . $resp . '] (name "' . $Customer->getDisplayName() . '")');
}
else
{
    print($CustomerService->lastError($Context));
}

There are tons of additional examples here: