PHPackages                             laravel7/infusionsoft-php-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. laravel7/infusionsoft-php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

laravel7/infusionsoft-php-sdk
=============================

PHP SDK for the Infusionsoft

1.4.9(7y ago)04MITPHPPHP &gt;=7.0

Since May 14Pushed 5y agoCompare

[ Source](https://github.com/lzanette/infusionsoft-php)[ Packagist](https://packagist.org/packages/laravel7/infusionsoft-php-sdk)[ Docs](https://developer.infusionsoft.com)[ RSS](/packages/laravel7-infusionsoft-php-sdk/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (11)Versions (31)Used By (0)

Infusionsoft PHP SDK
====================

[](#infusionsoft-php-sdk)

[![Build Status](https://camo.githubusercontent.com/82c79be613cdae8494e2996df1ea2c3f9c6fb3ddaa511e818e6a66779d9629f7/68747470733a2f2f7472617669732d63692e6f72672f696e667573696f6e736f66742f696e667573696f6e736f66742d7068702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/infusionsoft/infusionsoft-php)[![Total Downloads](https://camo.githubusercontent.com/7de0635c86540177a04fc04b485ea9596761ea9dd38c041ba7a5957b39d31bc1/68747470733a2f2f706f7365722e707567782e6f72672f696e667573696f6e736f66742f7068702d73646b2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/infusionsoft/php-sdk)[![Latest Stable Version](https://camo.githubusercontent.com/3247ac1b54a4cc4ff2895b145c2bfef8d0af4c3aeb48302851d4b73015d21880/68747470733a2f2f706f7365722e707567782e6f72672f696e667573696f6e736f66742f7068702d73646b2f762f737461626c652e706e67)](https://packagist.org/packages/infusionsoft/php-sdk)

Version Notes
-------------

[](#version-notes)

This version implements RESTful endpoints, a new version of Guzzle, and a restructured request handler.

As of version 1.4, PHP 7+ is required.

### Breaking Change

[](#breaking-change)

If you use the `Contacts`, `Orders` or `Products` services, there are now two different classes handling each service - one for REST, one for XML-RPC. *This version of the SDK will load the REST class by default.* If you still need the XML-RPC class, pass `'xml'` as an argument when requesting the object: `$infusionsoft->orders('xml')'`

Kudos to [toddstoker](https://github.com/toddstoker) and [mattmerrill](https://github.com/mattmerrill) for their contributions to this release.

Install
-------

[](#install)

Using the composer CLI:

```
composer require infusionsoft/php-sdk

```

Or manually add it to your composer.json:

```
{
    "require": {
        "infusionsoft/php-sdk": "1.4.*"
    }
}
```

Authentication
--------------

[](#authentication)

The client ID and secret are the key and secret for your OAuth2 application found at the [Infusionsoft Developers](https://keys.developer.infusionsoft.com/apps/mykeys) website.

```
if(empty(session_id();)) session_start();

require_once 'vendor/autoload.php';

$infusionsoft = new \Infusionsoft\Infusionsoft(array(
	'clientId'     => 'XXXXXXXXXXXXXXXXXXXXXXXX',
	'clientSecret' => 'XXXXXXXXXX',
	'redirectUri'  => 'http://example.com/',
));

// If the serialized token is available in the session storage, we tell the SDK
// to use that token for subsequent requests.
if (isset($_SESSION['token'])) {
	$infusionsoft->setToken(unserialize($_SESSION['token']));
}

// If we are returning from Infusionsoft we need to exchange the code for an
// access token.
if (isset($_GET['code']) and !$infusionsoft->getToken()) {
	$_SESSION['token'] = serialize($infusionsoft->requestAccessToken($_GET['code']));
}

if ($infusionsoft->getToken()) {
	// Save the serialized token to the current session for subsequent requests
	$_SESSION['token'] = serialize($infusionsoft->getToken());

	// MAKE INFUSIONSOFT REQUEST
} else {
	echo 'Click here to authorize';
}
```

Making XML-RPC Requests
-----------------------

[](#making-xml-rpc-requests)

```
require_once 'vendor/autoload.php';

//
// Setup your Infusionsoft object here, then set your token either via the request or from storage
// As of v1.3 contacts defaults to rest
$infusionsoft->setToken($myTokenObject);

$infusionsoft->contacts('xml')->add(array('FirstName' => 'John', 'LastName' => 'Doe'));
```

Making REST Requests
--------------------

[](#making-rest-requests)

The PHP SDK is setup to allow easy access to REST endpoints. In general, a single result is returned as a Class representing that object, and multiple objects are returned as an Infusionsoft Collection, which is simply a wrapper around an array of results making them easier to manage.

The standard REST operations are mapped to a series of simple functions. We'll use the Tasks service for our examples, but the operations below work on all documented Infusionsoft REST services.

To retrieve all tasks:

```
$tasks = $infusionsoft->tasks()->all();
```

To retrieve a single task:

```
$task = $infusionsoft->tasks()->find($taskId);
```

To query only completed tasks:

```
$tasks = $infusionsoft->tasks()->where('status', 'completed')->get();
```

You can chain `where()` as many times as you'd like, or you can pass an array:

```
$tasks = $infusionsoft->tasks()->where(['status' => 'completed', 'user_id' => '45'])->get();
```

To create a task:

```
$task = $infusionsoft->tasks()->create([
   'title' => 'My First Task',
   'description' => 'Better get it done!'
]);
```

Then update that task:

```
$task->title = 'A better task title';
$task->save();
```

And finally, to delete the task:

```
$task->delete();
```

Several REST services have a `/sync` endpoint, which we provide a helper method for:

```
$tasks = $infusionsoft->tasks()->sync($syncId);
```

This returns a list of tasks created or updated since the sync ID was last generated.

```
require_once 'vendor/autoload.php';

//
// Setup your Infusionsoft object here, then set your token either via the request or from storage
//
$infusionsoft->setToken($myTokenObject);

$infusionsoft->tasks()->find('1');
```

### Dates

[](#dates)

DateTime objects are used instead of a DateTime string where the date(time) is a parameter in the method.

```
$datetime = new \DateTime('now',new \DateTimeZone('America/New_York'));
```

### Debugging

[](#debugging)

To enable debugging of requests and responses, you need to set the debug flag to try by using:

```
$infusionsoft->setDebug(true);
```

Once enabled, logs will by default be written to an array that can be accessed by:

```
$infusionsoft->getLogs();
```

You can utilize the powerful logging plugin built into Guzzle by using one of the available adapters. For example, to use the Monolog writer to write to a file:

```
use Monolog\Handler\StreamHandler;
use Monolog\Logger;

$logger = new Logger('client');
$logger->pushHandler(new StreamHandler('infusionsoft.log'));

$infusionsoft->setHttpLogAdapter($logger);
```

Testing
-------

[](#testing)

```
$ phpunit
```

Laravel 5.1 Service Provider
----------------------------

[](#laravel-51-service-provider)

In config/app.php, register the service provider

```
Infusionsoft\FrameworkSupport\Laravel\InfusionsoftServiceProvider::class,

```

Register the Facade (optional)

```
'Infusionsoft'       => Infusionsoft\FrameworkSupport\Laravel\InfusionsoftFacade::class

```

Publish the config

```
php artisan vendor:publish --provider="Infusionsoft\FrameworkSupport\Laravel\InfusionsoftServiceProvider"

```

Set your env variables

```
INFUSIONSOFT_CLIENT_ID=xxxxxxxx
INFUSIONSOFT_SECRET=xxxxxxxx
INFUSIONSOFT_REDIRECT_URL=http://localhost/auth/callback

```

Access Infusionsoft from the Facade or Binding

```
 $data = Infusionsoft::data()->query("Contact",1000,0,['Id' => '123'],['Id','FirstName','LastName','Email'], 'Id', false);

 $data = app('infusionsoft')->data()->query("Contact",1000,0,['Id' => '123'],['Id','FirstName','LastName','Email'], 'Id', false);

```

Lumen Service Provider
----------------------

[](#lumen-service-provider)

In bootstrap/app.php, register the service provider

```
$app->register(Infusionsoft\FrameworkSupport\Lumen\InfusionsoftServiceProvider::class);

```

Set your env variables (make sure you're loading your env file in app.php)

```
INFUSIONSOFT_CLIENT_ID=xxxxxxxx
INFUSIONSOFT_SECRET=xxxxxxxx
INFUSIONSOFT_REDIRECT_URL=http://localhost/auth/callback

```

Access Infusionsoft from the Binding

```
 $data = app('infusionsoft')->data()->query("Contact",1000,0,['Id' => '123'],['Id','FirstName','LastName','Email'], 'Id', false);

```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/infusionsoft/infusionsoft-php/blob/master/CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/infusionsoft/infusionsoft-php/blob/master/LICENSE) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~62 days

Recently: every ~44 days

Total

30

Last Release

2572d ago

PHP version history (5 changes)1.0.0-beta1PHP &gt;=5.3.0

1.0.0-beta2PHP &gt;=5.3.3

1.1.0PHP &gt;=5.4

1.2.0PHP &gt;=5.5

1.4.1PHP &gt;=7.0

### Community

Maintainers

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

---

Top Contributors

[![andrewryno](https://avatars.githubusercontent.com/u/50643?v=4)](https://github.com/andrewryno "andrewryno (47 commits)")[![MicFai](https://avatars.githubusercontent.com/u/131530258?v=4)](https://github.com/MicFai "MicFai (30 commits)")[![kressaty](https://avatars.githubusercontent.com/u/289165?v=4)](https://github.com/kressaty "kressaty (27 commits)")[![lzanette](https://avatars.githubusercontent.com/u/4632968?v=4)](https://github.com/lzanette "lzanette (10 commits)")[![mfairch](https://avatars.githubusercontent.com/u/2048552?v=4)](https://github.com/mfairch "mfairch (6 commits)")[![skeemer](https://avatars.githubusercontent.com/u/864069?v=4)](https://github.com/skeemer "skeemer (5 commits)")[![nova4005](https://avatars.githubusercontent.com/u/3578444?v=4)](https://github.com/nova4005 "nova4005 (4 commits)")[![toddstoker](https://avatars.githubusercontent.com/u/248347?v=4)](https://github.com/toddstoker "toddstoker (3 commits)")[![mattmerrill](https://avatars.githubusercontent.com/u/231331?v=4)](https://github.com/mattmerrill "mattmerrill (3 commits)")[![jeremiahmarks](https://avatars.githubusercontent.com/u/940635?v=4)](https://github.com/jeremiahmarks "jeremiahmarks (1 commits)")[![iugo-robert](https://avatars.githubusercontent.com/u/1051689?v=4)](https://github.com/iugo-robert "iugo-robert (1 commits)")[![acobster](https://avatars.githubusercontent.com/u/320688?v=4)](https://github.com/acobster "acobster (1 commits)")[![igorsantos07](https://avatars.githubusercontent.com/u/532299?v=4)](https://github.com/igorsantos07 "igorsantos07 (1 commits)")[![greggor88](https://avatars.githubusercontent.com/u/16009961?v=4)](https://github.com/greggor88 "greggor88 (1 commits)")[![Fly1nP4nda](https://avatars.githubusercontent.com/u/2753880?v=4)](https://github.com/Fly1nP4nda "Fly1nP4nda (1 commits)")[![oxaide](https://avatars.githubusercontent.com/u/5656734?v=4)](https://github.com/oxaide "oxaide (1 commits)")[![phillbooth](https://avatars.githubusercontent.com/u/2863626?v=4)](https://github.com/phillbooth "phillbooth (1 commits)")[![ribdot](https://avatars.githubusercontent.com/u/15382672?v=4)](https://github.com/ribdot "ribdot (1 commits)")[![rjbrown](https://avatars.githubusercontent.com/u/48569?v=4)](https://github.com/rjbrown "rjbrown (1 commits)")[![roenschg](https://avatars.githubusercontent.com/u/9590236?v=4)](https://github.com/roenschg "roenschg (1 commits)")

---

Tags

sdkinfusionsoft

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/laravel7-infusionsoft-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/laravel7-infusionsoft-php-sdk/health.svg)](https://phpackages.com/packages/laravel7-infusionsoft-php-sdk)
```

###  Alternatives

[infusionsoft/php-sdk

PHP SDK for the Infusionsoft

1292.1M7](/packages/infusionsoft-php-sdk)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k17](/packages/civicrm-civicrm-core)[zumba/amplitude-php

PHP SDK for Amplitude

409.5M5](/packages/zumba-amplitude-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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