PHPackages                             excelle-insights/sage - 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. excelle-insights/sage

ActiveLibrary[API Development](/categories/api)

excelle-insights/sage
=====================

Sage Online integration package

01PHP

Since Feb 2Pushed 3mo agoCompare

[ Source](https://github.com/excelle-insights/sage)[ Packagist](https://packagist.org/packages/excelle-insights/sage)[ RSS](/packages/excelle-insights-sage/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Excelle Insights Sage Integration
=================================

[](#excelle-insights-sage-integration)

A PHP package to integrate with **Sage Online (QBO)**, including authentication, customer management, and local synchronization.

---

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

[](#installation)

You can install the package via Composer:

```
composer require excelle-insights/sage:dev-main
```

Environment Setup
-----------------

[](#environment-setup)

Create a .env file in your project root (or rely on the package .env):

```
# Sage API
QBO_BASE_URL=https://sage.api.intuit.com
QBO_CLIENT_ID=YOUR_CLIENT_ID
QBO_CLIENT_SECRET=YOUR_CLIENT_SECRET
QBO_REALM_ID=YOUR_COMPANY_ID
QBO_REDIRECT_URI=http://gimco.local/admin/debug_scripts/qbo-auth-callback.php
QBO_TABLE_PREFIX=qbo_beta

# Database connection
DB_DSN=mysql:host=127.0.0.1;dbname=myapp
DB_USER=root
DB_PASSWORD=secret

```

The package automatically loads its own .env if present.

Running Migrations
------------------

[](#running-migrations)

This package uses Phinx for database migrations.

1. Run the migrations:

```
php vendor/excelle-insights/sage/scripts/migrate.php
```

Tables created include:

- api\_access\_tokens
- \_companies
- \_customers
- \_invoices
- \_invoice\_items
- http\_request\_logs

Quick Start
-----------

[](#quick-start)

1. Get the OAuth Authorization URL

This script generates a link for the user to authorize your app in Sage:

```
