PHPackages                             clevpro/laravel-quickbooks - 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. clevpro/laravel-quickbooks

ActiveLibrary[API Development](/categories/api)

clevpro/laravel-quickbooks
==========================

Laravel package for Quickbooks API Integration

1.0.7(1y ago)23461MITPHPPHP ^7.4|^8.0

Since Oct 5Pushed 1y agoCompare

[ Source](https://github.com/Clevpro/laravel-quickbooks)[ Packagist](https://packagist.org/packages/clevpro/laravel-quickbooks)[ Docs](https://github.com/clevpro/laravel-quickbooks)[ RSS](/packages/clevpro-laravel-quickbooks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (9)Used By (0)

Laravel QuickBooks Integration
==============================

[](#laravel-quickbooks-integration)

Introduction
------------

[](#introduction)

**Laravel QuickBooks Integration** is a package that provides an easy and flexible way to integrate **QuickBooks Online** with Laravel. It allows you to manage customers, create invoices, and interact with the QuickBooks Online API directly.

Features
--------

[](#features)

- OAuth 2.0 authentication for QuickBooks Online.
- Create and update invoices.
- Create and update customers.
- Fetch invoice PDFs.
- Built using **QuickBooks Online REST API** directly, no SDK required.

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

First, add the package to your project using Composer:

```
composer require clevpro/laravel-quickbooks
```

### 2. Publish the Configuration

[](#2-publish-the-configuration)

After installing the package, publish the configuration file:

```
php artisan vendor:publish --provider="Clevpro\LaravelQuickbooks\QuickbooksServiceProvider" --tag=config
```

This will create a `config/quickbooks.php` file where you can define your QuickBooks API credentials.

### 3. Configure Environment Variables

[](#3-configure-environment-variables)

Add the following QuickBooks API credentials to your `.env` file:

```
QUICKBOOKS_SANDBOX=true
QUICKBOOKS_CLIENT_ID=your-client-id
QUICKBOOKS_CLIENT_SECRET=your-client-secret
QUICKBOOKS_REDIRECT_URI=https://yourdomain.com/quickbooks/callback
```

Usage
-----

[](#usage)

### Authentication and OAuth Flow

[](#authentication-and-oauth-flow)

You will need to authenticate with QuickBooks to get the access token. Redirect users to the QuickBooks OAuth page and handle the callback.

#### Step 1: Redirect to QuickBooks OAuth

[](#step-1-redirect-to-quickbooks-oauth)

To initiate the connection to QuickBooks, call the following service method:

```
use Clevpro\LaravelQuickbooks\Services\QuickbooksOAuthService;

$quickbooksOAuthService = new QuickbooksOAuthService();
$authUrl = $quickbooksOAuthService->generateAuthUrl();
return redirect($authUrl);
```

#### Step 2: Handle the OAuth Callback

[](#step-2-handle-the-oauth-callback)

Handle the callback to exchange the authorization code for access tokens:

```
use Clevpro\LaravelQuickbooks\Services\QuickbooksOAuthService;
use Illuminate\Http\Request;

public function callback(Request $request)
{
    $quickbooksOAuthService = new QuickbooksOAuthService();
    $accessTokenData = $quickbooksOAuthService->getAccessToken($request->input('code'));

    // Store the access token, refresh token, and realm ID in the database
    // Example:
    $user = Auth::user();
    $user->quickbooks_access_token = $accessTokenData['access_token'];
    $user->quickbooks_refresh_token = $accessTokenData['refresh_token'];
    $user->quickbooks_realm_id = $accessTokenData['realm_id'];
    $user->save();

    return redirect()->route('dashboard')->with('success', 'QuickBooks connected successfully!');
}
```

### Creating an Invoice

[](#creating-an-invoice)

You can create an invoice by calling the `createInvoice()` method from the `QuickbooksInvoiceService`:

```
use Clevpro\LaravelQuickbooks\Services\QuickbooksInvoiceService;

$quickbooksInvoiceService = new QuickbooksInvoiceService($user->quickbooks_access_token, $user->quickbooks_realm_id);

$lineItems = [
    [
        "Amount" => 100,
        "DetailType" => "SalesItemLineDetail",
        "SalesItemLineDetail" => [
            "Qty" => 1,
            "UnitPrice" => 100,
            "ItemRef" => [
                "value" => "123" // The ID of a valid QuickBooks item
            ]
        ],
        "Description" => "Consulting services"
    ]
];

$invoiceData = [
    'customer_id' => '1', // Valid customer ID in QuickBooks
    'line_items' => $lineItems
];

$invoice = $quickbooksInvoiceService->createInvoice($invoiceData);
```

### Updating an Invoice

[](#updating-an-invoice)

To update an invoice:

```
$updatedInvoiceData = [
    'customer_id' => '1',
    'line_items' => $lineItems
];

$updatedInvoice = $quickbooksInvoiceService->updateInvoice($invoiceId, $updatedInvoiceData);
```

### Retrieving an Invoice

[](#retrieving-an-invoice)

To fetch an invoice by ID:

```
$invoice = $quickbooksInvoiceService->getInvoice($invoiceId);
```

### Retrieving Invoice PDF

[](#retrieving-invoice-pdf)

To fetch the PDF version of an invoice:

```
$pdf = $quickbooksInvoiceService->getInvoicePdf($invoiceId);
return response($pdf, 200)->header('Content-Type', 'application/pdf');
```

Advanced Usage
--------------

[](#advanced-usage)

For more advanced usage like error handling, token refreshing, or interacting with other QuickBooks Online API entities, refer to the QuickBooks API documentation: [QuickBooks API Documentation](https://developer.intuit.com/app/developer/qbo/docs/get-started).

Testing
-------

[](#testing)

You can write unit and feature tests for your package by running:

```
vendor/bin/phpunit
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

8

Last Release

578d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/339d8f7de1415d71762c551baeec17ebe8159a0e81b380e602616d426093008f?d=identicon)[kowsar52](/maintainers/kowsar52)

---

Top Contributors

[![kowsar52](https://avatars.githubusercontent.com/u/34295607?v=4)](https://github.com/kowsar52 "kowsar52 (15 commits)")

---

Tags

laravel-quickbooksclevpro

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/clevpro-laravel-quickbooks/health.svg)

```
[![Health](https://phpackages.com/badges/clevpro-laravel-quickbooks/health.svg)](https://phpackages.com/packages/clevpro-laravel-quickbooks)
```

###  Alternatives

[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[grantholle/powerschool-api

A Laravel package to make interacting with PowerSchool less painful.

1715.6k1](/packages/grantholle-powerschool-api)

PHPackages © 2026

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