PHPackages                             annajeanine/instabox-php-client - 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. annajeanine/instabox-php-client

ActiveLibrary[API Development](/categories/api)

annajeanine/instabox-php-client
===============================

v1.7(3y ago)261MITHTMLPHP &gt;=8.1

Since May 14Pushed 3y ago2 watchersCompare

[ Source](https://github.com/annajeanine/instabox-php-client)[ Packagist](https://packagist.org/packages/annajeanine/instabox-php-client)[ RSS](/packages/annajeanine-instabox-php-client/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (4)Versions (9)Used By (0)

Instabox API PHP Client
=======================

[](#instabox-api-php-client)

Unofficial PHP API Client for the Instabox API. More information about Instabox can be found on .

Full documentation about the Instabox API can be found on . Contact your account manager for credentials.

### Installation

[](#installation)

The client can be easily installed through composer:

```
composer require annajeanine/instabox-php-client

```

### Connection

[](#connection)

Initialize the Connection class with your Client ID and Client Secret. Optionally for development purposes, set the Sandbox variable to true.

```
$connection = new \Instabox\Connection('clientID', 'clientSecret', true);

```

The connection is required for the Instabox interface which handles which models can be initialized.

```
$instabox = new \Instabox\Instabox($connection);

```

### Create an order instance

[](#create-an-order-instance)

To create an order, use the Instabox class. Initialize an order through here.

```
$order = $instabox->order();

```

Set all required properties of the order. For the required properties, consult the API documentation.

The order model has nested properties, such as the `Recipient` and `Sender`. Initialize these and set these to the corresponding property of the `Order` model.

```
// Create nested DeliveryOption model and add this to the order
$deliveryOptions = new \Instabox\Models\Order\NestedModels\DeliveryOption();
$deliveryOptions->sort_code = 'IN20';
$order->delivery_option = $deliveryOptions;

```

### Create order through API

[](#create-order-through-api)

To create the order through the API, you have to save the `Order` model.

```
try {
    $order->save();
} catch (\Instabox\Exceptions\UnauthorizedException $exception) {
    // Client credentials are incorrect
} catch (\Instabox\Exceptions\ServerException $exception) {
    // Got a [500, 502, 503, 503, 507] response
} catch (\Instabox\Exceptions\ResponseException $exception) {
    // Response was unexpected.
} catch (\GuzzleHttp\Exception\ConnectException $exception) {
    // Guzzle ConnectionException occured
} catch (Exception $exceptions) {
    // Unexpected error occured
}

```

Note; There are a couple of exceptions which could be thrown. Working on improving these once response examples become available.

### Generate a label

[](#generate-a-label)

Instabox provides support to create a label through their API. But, as stated in their documentation

> Please avoid to use this if you can create labels on your own. This function is designed for really small merchants. Note that an order needs to be created first and then the label can be fetched. So it can take a few minutes before the label is available.

Therefore, this client provides generating a label through the usage of `dompdf`. Therefore, there is no need to wait and a label can be generated directly after making the order. To generate a label for a order use:

```
$label = $instabox->label($order);
$generatedLabel = $label->generateLabel();

file_put_contents('example-label.pdf', $generatedLabel);

```

### Example

[](#example)

A full example of the implementation can be found [here](src/examples/script.php).

### Credits

[](#credits)

The setup of the API is inspired by the set-up of Picqer PHP clients:

-
-

### To do's

[](#to-dos)

- Improve label
    - Add small Instabox logo to bottom of label
    - Make label pixel perfect
    - Find out which phone number of recipient should be used.
- Improve unhappy path with response examples
- Add tests
- Explore possibility of using spatie DTO for client

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% 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 ~3 days

Total

8

Last Release

1431d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ada955fb8804a74b44a1b85d2ad104496983288aaa9c42652a5aee2387be946?d=identicon)[annajeanine](/maintainers/annajeanine)

---

Top Contributors

[![annajeanine](https://avatars.githubusercontent.com/u/17251777?v=4)](https://github.com/annajeanine "annajeanine (20 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

### Embed Badge

![Health badge](/badges/annajeanine-instabox-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/annajeanine-instabox-php-client/health.svg)](https://phpackages.com/packages/annajeanine-instabox-php-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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