PHPackages                             hlu2/quick-books\_demo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hlu2/quick-books\_demo

ActiveLibrary[API Development](/categories/api)

hlu2/quick-books\_demo
======================

The demo for QuickBooks PHP Open Source Release

1.1.0(9y ago)013Apache-2.0PHPPHP &gt;=5.6.0

Since Feb 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/hlu2/QuickBooks_Demo)[ Packagist](https://packagist.org/packages/hlu2/quick-books_demo)[ RSS](/packages/hlu2-quick-books-demo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

QuickBooks API PHP SDK
======================

[](#quickbooks-api-php-sdk)

=====================

PHP client for connecting to the QuickBooks Online V3 REST API.

To find out more, visit the official documentation website:

[![Build status](https://camo.githubusercontent.com/0b5a8df56d2b747e606f76506743c2bbb1127fcdf7f2ea2a2ce5ee38bd592f76/68747470733a2f2f7472617669732d63692e6f72672f686c75322f517569636b426f6f6b735f44656d6f2e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/0b5a8df56d2b747e606f76506743c2bbb1127fcdf7f2ea2a2ce5ee38bd592f76/68747470733a2f2f7472617669732d63692e6f72672f686c75322f517569636b426f6f6b735f44656d6f2e7376673f6272616e63683d6d6173746572)[![Latest Stable Version](https://camo.githubusercontent.com/3c6e3c983dd009b9551f55105ad541b714eae0e3b5f04bc98974f101b814d7ad/68747470733a2f2f706f7365722e707567782e6f72672f686c75322f717569636b2d626f6f6b735f64656d6f2f762f737461626c65)](https://packagist.org/packages/hlu2/quick-books_demo)[![Total Downloads](https://camo.githubusercontent.com/33165b5c27b905ebf4c05aceafa7ca81e5f7f4ddeee9aef2916def2c2dd4fa25/68747470733a2f2f706f7365722e707567782e6f72672f686c75322f717569636b2d626f6f6b735f64656d6f2f646f776e6c6f616473)](https://packagist.org/packages/hlu2/quick-books_demo)

Requirements
------------

[](#requirements)

- PHP 5.6 or greater
- PHP OAuth 1.2.3 extension enabled

**To connect to the API with OAuth1 you need the following:**

- Account with developer.intuit.com
- Consumer keys and Consumer secrets in your app for starting OAuth 1.0a flow
- Access Token and Access Token Secrets

To generate OAuth Access Token and Access Token Secrets, refer to our documentation here: [https://developer.intuit.com/docs/0100\_quickbooks\_online/0100\_essentials/000500\_authentication\_and\_authorization/connect\_from\_within\_your\_app](https://developer.intuit.com/docs/0100_quickbooks_online/0100_essentials/000500_authentication_and_authorization/connect_from_within_your_app)

We also suggest you play with OAuth playground:

You can use it generate access tokens for either QuickBooks Online production or sandbox.

Installation
------------

[](#installation)

Use the following Composer command to install the API client from \[the Intuit vendor on Packagist\](composer require quickbooks/v3-php-sdk):

```
 $ composer require quickbooks/v3-php-sdk
 $ composer update
```

If you are not familiar with Composer. Please read the introduction guide for Composer here:

Configuration
-------------

[](#configuration)

To use Class library, put:

```
require "vendor/autoload.php";
```

As the first line in your PHP Script before calling other libraries/Classes. (You can declare your own spl autoloader; however, using Composer’s `vendor/autoload.php` hook is recommended).

There are two ways to provide static configration for prepare the service context for API call:

### OAuth 1.0

[](#oauth-10)

Pass the OAuth configuration as an array:

```
$dataService = DataService::Configure(array(
         	  'auth_mode' => 'oauth1',
		  'consumerKey' => "qyprdUSoVpIHrtBp0eDMTHGz8UXuSz",
		  'consumerSecret' => "TKKBfdlU1I1GEqB9P3AZlybdC8YxW5qFSbuShkG7",
		  'accessTokenKey' => "lvprdePgDHR4kSxxC7KFb8sy84TjQMVJrbITqyeaRAwBrLuq",
		  'accessTokenSecret' => "VRm1nrr17JL1RhPAFGgEjepxWeSUbGGsOwsjrKLP",
		  'QBORealmID' => "123145812836282"
));
```

or you use the sdk.config file as the config file for preparing service context. You will need to pass the path of config file explicitly:

```
$dataService = DataService::Configure("/Your/Path/To/sdk.config");
```

Connecting to the QuickBooks Online API
---------------------------------------

[](#connecting-to-the-quickbooks-online-api)

Referring to class methods may be required sometime. To access to the Class reference Entity, go to:

Create new resources (PUT)
--------------------------

[](#create-new-resources-put)

To create a Customer in QuickBooks Online:

```

```

Update existing resources (PUT)
-------------------------------

[](#update-existing-resources-put)

To update a single resource, you will need to read the resource first and then update it:

```
// Same as adding a customer before
....
$customerObj = new IPPCustomer();
$customerObj->Name = "Name" . rand();
$customerObj->CompanyName = "CompanyName" . rand();
$customerObj->GivenName = "GivenName" . rand();
$customerObj->DisplayName = "DisplayName" . rand();
$resultingCustomerObj = $dataService->Add($customerObj);
$error = $dataService->getLastError();
if ($error != null) {
    echo "The Status code is: " . $error->getHttpStatusCode() . "\n";
    echo "The Helper message is: " . $error->getOAuthHelperError() . "\n";
    echo "The Response message is: " . $error->getResponseBody() . "\n";
}
else {
    echo "Created Customer Id={$resultingCustomerObj->Id}. Reconstructed response body:\n\n";
    $xmlBody = XmlObjectSerializer::getPostXmlFromArbitraryEntity($resultingCustomerObj, $urlResource);
    echo $xmlBody . "\n";
}

// Update Customer Obj
$resultingCustomerObj->GivenName = "New Name " . rand();
$resultingCustomerUpdatedObj = $dataService->Add($resultingCustomerObj);
if ($error != null) {
    echo "The Status code is: " . $error->getHttpStatusCode() . "\n";
    echo "The Helper message is: " . $error->getOAuthHelperError() . "\n";
    echo "The Response message is: " . $error->getResponseBody() . "\n";
}
else {
    echo "Created Customer Id={$resultingCustomerObj->Id}. Reconstructed response body:\n\n";
    $xmlBody = XmlObjectSerializer::getPostXmlFromArbitraryEntity($resultingCustomerObj, $urlResource);
    echo $xmlBody . "\n";
}
```

Delete resources (DELETE)
-------------------------

[](#delete-resources-delete)

To delete a single resource you can call the delete method on the dataService object:

```
...
$currentResultObj = $dataService->Delete($targetObject);
if ($crudResultObj)
	echo "Delete the purchase object that we just created.\n";
else
	echo "Did not delete the purchase object that we just created.\n";
```

Query resources (Query)
-----------------------

[](#query-resources-query)

To use Query, you will construct the Query String and call the $dataService-&gt;Query() method:

```
$allAccounts = $dataServices->Query("SELECT * FROM Account");
```

Handling Errors And Timeouts
----------------------------

[](#handling-errors-and-timeouts)

For whatever reason, the HTTP requests at the heart of the API may not always succeed.

Every method will return false if an error occurred, and you should always check for this before acting on the results of the method call.

```
$resultingCustomerObj = $dataService->Add($customerObj);
$error = $dataService->getLastError();
if ($error != null) {
    echo "The Status code is: " . $error->getHttpStatusCode() . "\n";
    echo "The Helper message is: " . $error->getOAuthHelperError() . "\n";
    echo "The Response message is: " . $error->getResponseBody() . "\n";
}
else {
    # code...
    // Echo some formatted output
    echo "Created Customer Id={$resultingCustomerObj->Id}. Reconstructed response body:\n\n";
    $xmlBody = XmlObjectSerializer::getPostXmlFromArbitraryEntity($resultingCustomerObj, $urlResource);
    echo $xmlBody . "\n";
}
```

See our Tool documentation for more information: [https://developer.intuit.com/docs/0100\_quickbooks\_online/0400\_tools/0005\_sdks/0209\_php](https://developer.intuit.com/docs/0100_quickbooks_online/0400_tools/0005_sdks/0209_php)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3383d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3ae62d3648c99965838d3b92d56752fd079748c195ee48e40f2849f0cb94121?d=identicon)[hlu2](/maintainers/hlu2)

---

Top Contributors

[![hlu2](https://avatars.githubusercontent.com/u/19961087?v=4)](https://github.com/hlu2 "hlu2 (49 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hlu2-quick-books-demo/health.svg)

```
[![Health](https://phpackages.com/badges/hlu2-quick-books-demo/health.svg)](https://phpackages.com/packages/hlu2-quick-books-demo)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
