PHPackages                             boldgrid/reseller-api - 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. boldgrid/reseller-api

ActiveLibrary[API Development](/categories/api)

boldgrid/reseller-api
=====================

SDK for the BoldGrid API

0.1(9y ago)118GPL2.0PHP

Since Mar 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/timelsass/boldgrid-api-client)[ Packagist](https://packagist.org/packages/boldgrid/reseller-api)[ RSS](/packages/boldgrid-reseller-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

BoldGrid API PHP SDK
====================

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

Using composer, you can get started quickly:

```
$ composer require boldgrid/api
```

In your code, use the normal procedures of requiring the autoloader. This client uses PSR-4 specification for autoloading:

```
require __DIR__ . '/vendor/autoload.php';
```

Now you can start using the API. The examples below will assume that your using the namespaces:

```
use Boldgrid\Api\Boldgrid;
```

Then you can kick off by creating a new api call using the default settings:

```
$api = new Boldgrid();
```

The endpoint is pointing to production, but you can easily switch this to the Reseller API sandbox endpoints by passing in the sandbox instance to the new Boldgrid constructor like this:

```
use Boldgrid\Api\Environment\Sandbox;

$api = new Boldgrid( new Sandbox );
```

Alternatively, you can this syntax to accomplish the same goal:

```
use Boldgrid\Api\Environment\Sandbox;

$api = new Boldgrid();
$api = $api->setEnvironment( new Sandbox );
```

The calls will utilize token based authentication and look for stored responses in the session data. You can choose to store the data in memcache instead by passing an instance of a class utilizing the Storage interface. This example shows how to set the storage to use Memcache instead of Session:

```
use Boldgrid\Api\Environment;
use Boldgrid\Api\Storage;

$api = new Boldgrid( new Environment\Sandbox, new Storage\Memcache );
```

Alternatively you can use the following syntax to accomplish the same thing:

```
use Boldgrid\Api\Environment\Sandbox;
use Boldgrid\Api\Storage\Memcache;

$api = $api
	->setEnvironment( new Sandbox )
	->setStorage( new Memcache );
```

Using the token based authentication, which is the default auth method - you will need to set the auth params. The tokens have a set expiration of 2 days for the BoldGrid Reseller API, so you will need to provide a way to retrieve the key/secret securely in your application. This can be done by passing in the key and reseller key, like this:

```
$api = $api
	->setKey( $key )
	->setResellerKey( $resellerKey );
```

We recommend sticking with the token based authentication for making calls from distributed applications, but you may wish to use other authentication methods when making calls. If you decide to use one of the other authentication methods you can simply pass the auth type desired to the setAuth method. The supported types are **token**, **basic**, and **key**. You can read more about the API authentication methods in our [API documentation](https://boldgrid.com/docs/api).

This example shows how to switch to using Basic Authentication for your call, which will require you to pass in your key and reseller key secret:

```
$api = $api
	->setAuth( 'basic' )
	->setKey( $key )
	->setResellerKey( $resellerKey );
```

This example shows how to authorize with only the key and reseller key:

```
$api = $api
	->setAuth( 'key' )
	->setKey( $key )
	->setResellerKey( $resellerKey );
```

Now that you know how to set the environment, authorization, and storage types - you can start making calls utilizing the BoldGrid Reseller API Client. Each call is segmented to it's base and endpoint. For instance, if you're looking to make a call to the key/list endpoint, the syntax would be like:

```
$api->key()->list();
```

Here's an example that sets the environment to the sandbox API, uses token authorization (default ), stores the token in memcache, and generates the key list of the clients under the reseller:

```
require __DIR__ . '/vendor/autoload.php';

use Boldgrid\Api\Boldgrid;
use Boldgrid\Api\Environment\Sandbox;
use Boldgrid\Api\Storage\Memcache;

$api = new Boldgrid();
$api = $api
	->setEnvironment( new Sandbox )
	->setStorage( new Memcache )
	->setKey( $key )
	->setResellerKey( $resellerKey );

$call = $api
	->key()
	->list();

var_dump( $call ); die;
```

Here's a list of available calls that can be made:

### Auth

[](#auth)

```
$api->auth()
	->getToken( $key, $resellerKey );
```

### Coin

[](#coin)

```
$api->coin()
	->balance( $connectId );

$api->coin()
	->add( $connectId, $coins );

$api->coin()
	->remove( $connectId, $coins );
```

### Key

[](#key)

```
$api->key()
	->list();

$api->key()
	->details( $connectId );

$api->key()
	->create( $email, $isPremium );

$api->key()
	->suspend( $connectId, $reason );

$api->key()
	->unsuspend( $connectId, $reason );

$api->key()
	->revoke( $connectId );

$api->key()
	->changeType( $connectId, $type );

$api->key()
	->createReseller( $title, $email, $optional );
```

### Site

[](#site)

```
$api->site()
	->list( $connectId, $dateFrom, $dateTo );
```

### User

[](#user)

```
$api->user()
	->update( $connectId, $email, $displayName );
$api->user()
	->updateReseller( $title, $email );
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

3352d ago

### Community

Maintainers

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

---

Top Contributors

[![timelsass](https://avatars.githubusercontent.com/u/11907254?v=4)](https://github.com/timelsass "timelsass (7 commits)")

### Embed Badge

![Health badge](/badges/boldgrid-reseller-api/health.svg)

```
[![Health](https://phpackages.com/badges/boldgrid-reseller-api/health.svg)](https://phpackages.com/packages/boldgrid-reseller-api)
```

###  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.1M453](/packages/google-gax)

PHPackages © 2026

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