PHPackages                             mblsolutions/inspireddeck-php - 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. mblsolutions/inspireddeck-php

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

mblsolutions/inspireddeck-php
=============================

Official Inspired Deck interface for PHP applications.

v2.0.2(2mo ago)010.7k↑150%31MITPHPPHP ^8.0CI passing

Since Sep 11Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/mblsolutions/inspireddeck-php)[ Packagist](https://packagist.org/packages/mblsolutions/inspireddeck-php)[ RSS](/packages/mblsolutions-inspireddeck-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (40)Used By (1)

Inspired Deck interface for PHP
===============================

[](#inspired-deck-interface-for-php)

[![Build Status](https://camo.githubusercontent.com/0a0fd8ed30a8f1e1f7051153211481040727c279cabc62fc6a1e676275bdf271/68747470733a2f2f7472617669732d63692e6f72672f6d626c736f6c7574696f6e732f696e7370697265646465636b2d7068702e737667)](https://travis-ci.org/mblsolutions/inspireddeck-php)

The Inspired Deck Interface for PHP gives you an API interface into the Inspired Deck Platform for your PHP applications.

Contents
--------

[](#contents)

- [Integration Applications](#integration-applications)
- [Installation](#installation)
- [Authentication](#authentication)
- [Find Code](#find-code)
- [Code Transactions](#code-transactions)
- [Transaction History](#transaction-history)
- [License](#license)

Integration Applications
------------------------

[](#integration-applications)

Inspired Deck provides an interface for the integrator to manage their own set of security credentials. This interface is available from the ‘Integrations’ menu item of the Inspired Deck Portal.

- [Live Integration Applications](https://portal.inspireddeck.co.uk/integration) / [Staging Integration Applications](https://staging-portal.inspireddeck.co.uk/integration)
- [Live Documentation](https://portal.inspireddeck.co.uk/docs) / [Staging Documentation](https://staging-portal.inspireddeck.co.uk/docs)

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

[](#installation)

The recommended way to install Inspired Deck PHP is through [Composer](https://getcomposer.org/).

```
composer require mblsolutions/inspireddeck-php
```

Usage
-----

[](#usage)

### Authentication

[](#authentication)

Please Note: Your API credentials (Client ID, Client Secret and access\_tokens) carry many permissions. Keep these credentials secure. Do not share this data in Github, client side code etc... If you believe any of your credentials have been compromised, within the Inspired Deck integration application interface revoke/reset user tokens, client secrets and encryption keys.

Authentication can be made by passing your Inspired Deck Integration Application `Client ID`, `Client Secret`, `Users Email` and `Users Password` to the authentication password method.

```
$deckAuthentication = new \MBLSolutions\InspiredDeck\Authentication();

$authentication = $deckAuthentication->password(1, 'auth-secret', 'john.doe@exmaple.com', 'password');
```

A successful authentication will return an OAuth response containing access, refresh and user information.

```
[
    'token_type' => 'Bearer',
    'expires_in' => 31622400,
    'access_token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBmOGMwNDAxZDAy',
    'refresh_token' => 'def5020002eca9ac7875d5d800c195024d7fb702535c0d30a0',
    'user' => [
        'name' => 'John Doe',
        'email' => 'john.doe@example.com',
        'role' => 'programme_manager'
    ]
];
```

We recommend this information is stored and reused between requests (the authentication will expire '31622400' seconds from the moment the authentication is issued).

Use your `access_token` by setting the token in the InspiredDeck Configuration. The PHP library will automatically attach this token to each api request (within the current request, each PHP request would need to re-set this token).

```
\MBLSolutions\InspiredDeck\InspiredDeck::setToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBmOGMwNDAxZDAy');
```

### Find Code

[](#find-code)

Before transactions can be issued against product codes, we recommend checking the current state/validity of the code. The search object should be used to issue this request to Inspired Deck. Search criteria should be one of `serial`, `pan`, `customer` or `transaction`.

```
\MBLSolutions\InspiredDeck\InspiredDeck::setToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBmOGMwNDAxZDAy');

$search = new \MBLSolutions\InspiredDeck\Search();

$result = $search->code([
    'serial' => 123456789,
    'pan' => null,
    'customer' => null,
    'transaction' => null,
]);
```

A successful request will show information about the code.

```
[
    'data' => [
        'activation_date' => null,
        'asset' => "Example Gift Card",
        'balance' => 0,
        'created' => "2016-08-31T12:36:34+00:00",
        'currency_code' => "GBP",
        'currency_decimals' => 2,
        'display' => "12345*******6799",
        'expiration_date' => "2021-12-16T00:00:00+00:00",
        'profile' => "Example Codes",
        'serial' => 123456789,
        'sku' => "GIFT_CARD",
        'status' => "active",
        'type' => "physical",
        'updated' => "2019-10-30T11:35:49+00:00",
        'valid_from' => null,
        'valid_to' => null,
    ]
];
```

### Code Transactions

[](#code-transactions)

Code transactions can be performed on a number of API objects included within this package (a full list can be located in the src directory e.g. /src/Balance.php).

```
\MBLSolutions\InspiredDeck\InspiredDeck::setToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBmOGMwNDAxZDAy');

$search = new \MBLSolutions\InspiredDeck\Credit();

$result = $search->credit([
    'serial' => 12345678,
    'amount' => 1000,
    'reference' => 'TEST-REF-1'
]);
```

A successful transaction will return updated information about the code (see updated balance).

```
[
    'data' => [
        'activation_date' => null,
        'asset' => "Example Gift Card",
        'balance' => 1000,
        'created' => "2016-08-31T12:36:34+00:00",
        'currency_code' => "GBP",
        'currency_decimals' => 2,
        'display' => "12345*******6799",
        'expiration_date' => "2021-12-16T00:00:00+00:00",
        'profile' => "Example Codes",
        'serial' => 123456789,
        'sku' => "GIFT_CARD",
        'status' => "active",
        'type' => "physical",
        'updated' => "2019-10-30T11:35:49+00:00",
        'valid_from' => null,
        'valid_to' => null,
    ]
];
```

### Transaction History

[](#transaction-history)

Code transaction history can be obtained using the Transaction History object.

```
\MBLSolutions\InspiredDeck\InspiredDeck::setToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBmOGMwNDAxZDAy');

$search = new \MBLSolutions\InspiredDeck\TransactionHistory();

$page = 1;
$limit = 5;

$result = $search->all(12345678, $page, $limit);
```

Transaction history for the requested code will be returned.

```
[
    'data' => [
        [
            'action' => "search",
            'action_name' => "Find Code",
            'amount' => 1000,
            'comment' => null,
            'currency_code' => "GBP",
            'currency_decimals' => 2,
            'date' => "2020-10-01T10:40:40+00:00",
            'external_ref' => null,
            'origin_ref' => null,
            'reference' => "TEST-REF-1",
            'reversed' => false,
            'serial' => 123456789,
            'user' => "John Doe"
        ],
        [
            'action' => "search",
            'action_name' => "Find Code",
            'amount' => 0,
            'comment' => null,
            'currency_code' => "GBP",
            'currency_decimals' => 2,
            'date' => "2020-10-01T10:40:33+00:00",
            'external_ref' => null,
            'origin_ref' => null,
            'reference' => "ID-1601548826005",
            'reversed' => false,
            'serial' => 123456789,
            'user' => "John Doe"
        ]
    ]
];
```

### License

[](#license)

Inspired Deck Interface for PHP is free software distributed under the terms of the MIT license.

A contract/subscription to Inspired Deck is required to make use of this package, for more information contact [MBL Solutions](mailto:support@mblsolutions.co.uk)

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance84

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 89% 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 ~63 days

Recently: every ~477 days

Total

38

Last Release

81d ago

Major Versions

v1.7 → v2.0.02022-12-09

PHP version history (3 changes)v1.0.0PHP &gt;=7.1

v1.7PHP ^7.1|^8.0

v2.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/610936?v=4)[Christian Innerbichler](/maintainers/lerouse)[@lerouse](https://github.com/lerouse)

![](https://www.gravatar.com/avatar/102e5b958c4a1e833fd8812ac866581ccf52bbc0cd9627253589025c42cf0f37?d=identicon)[hayleyberryl2s](/maintainers/hayleyberryl2s)

---

Top Contributors

[![lerouse](https://avatars.githubusercontent.com/u/610936?v=4)](https://github.com/lerouse "lerouse (81 commits)")[![pureskillz83](https://avatars.githubusercontent.com/u/8451038?v=4)](https://github.com/pureskillz83 "pureskillz83 (5 commits)")[![hayleyberryl2s](https://avatars.githubusercontent.com/u/152175725?v=4)](https://github.com/hayleyberryl2s "hayleyberryl2s (2 commits)")[![JonKnibbsPP](https://avatars.githubusercontent.com/u/132350278?v=4)](https://github.com/JonKnibbsPP "JonKnibbsPP (2 commits)")[![rsloan-mlbsolutions](https://avatars.githubusercontent.com/u/115983535?v=4)](https://github.com/rsloan-mlbsolutions "rsloan-mlbsolutions (1 commits)")

---

Tags

giftcardinspiredsuiteinspireddecke-gift

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mblsolutions-inspireddeck-php/health.svg)

```
[![Health](https://phpackages.com/badges/mblsolutions-inspireddeck-php/health.svg)](https://phpackages.com/packages/mblsolutions-inspireddeck-php)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[kamerk22/amazongiftcode

Laravel Package for Amazon Gift Codes.

46140.3k](/packages/kamerk22-amazongiftcode)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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