PHPackages                             cliffom/tokenex - 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. cliffom/tokenex

ActiveLibrary[API Development](/categories/api)

cliffom/tokenex
===============

TokenEx API

v0.5.1(10y ago)0375MITPHPPHP &gt;=5.6.0

Since Feb 26Pushed 10y agoCompare

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

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Tokenex [![Build Status](https://camo.githubusercontent.com/3e6a77b1c95c46fde52b1aba7ae99458d865e5a9c0045135eae110bbe74fc51e/68747470733a2f2f7472617669732d63692e6f72672f636c6966666f6d2f746f6b656e65782d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cliffom/tokenex-php) [![Circle CI](https://camo.githubusercontent.com/4753914d6b7b703b93cea7df9c8b60836e69770e0cbc43c282e203dbcbaf643e/68747470733a2f2f636972636c6563692e636f6d2f67682f636c6966666f6d2f746f6b656e65782d7068702e7376673f7374796c653d737667)](https://circleci.com/gh/cliffom/tokenex-php)
====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#tokenex--)

A convenient PHP package for the TokenEx API

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

[](#installation)

The fastest way to get up and running is to install via [composer](https://getcomposer.org/):

```
$ composer require cliffom/tokenex
```

Usage
-----

[](#usage)

### Tokenization

[](#tokenization)

#### Initialize your tokenizer

[](#initialize-your-tokenizer)

```
require __DIR__ . '/vendor/autoload.php';
use Cliffom\Tokenex\Tokenizer;

$tokenizer = new Tokenizer($TOKENEX_API_BASE_URL, $TOKENEX_ID, $TOKENEX_API_KEY);
```

#### Create a token

[](#create-a-token)

```
// From a credit card number
$token = $tokenizer->token_from_ccnum(4242424242424242);

// From arbitrary data
$token = $tokenizer->tokenize("This is random data containing 3 numbers less than 10");
```

#### Validate a token

[](#validate-a-token)

```
$tokenizer->validate_token($token); // true or false
```

#### Delete a token

[](#delete-a-token)

```
$tokenizer->delete_token($token); // true or false
```

#### Errors and References

[](#errors-and-references)

Each action call will return a reference ID that can be used to lookup a call in the TokenEx dashboard. Unsuccessful calls will also return an error describing the problem. Each can be accessed via:

```
var_dump($tokenizer->error); // array, empty if no errors
var_dump($tokenizer->reference_number); // string
```

Development
-----------

[](#development)

Use the following docker-compose commands to install dependencies and run the specs:

```
docker-compose run --rm tokenex composer install
docker-compose up

```

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

[](#contributing)

Bug reports and pull requests are welcome on GitHub at .

License
-------

[](#license)

All code is open source under the terms of the \[MIT License\](MIT License)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Every ~0 days

Total

3

Last Release

3730d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/146922756666186044be6a446c0f9c9892997a385735a30b2cd1b11505bfef4d?d=identicon)[cliffom](/maintainers/cliffom)

---

Top Contributors

[![cliffom](https://avatars.githubusercontent.com/u/249408?v=4)](https://github.com/cliffom "cliffom (20 commits)")

---

Tags

tokenizationtokenex

### Embed Badge

![Health badge](/badges/cliffom-tokenex/health.svg)

```
[![Health](https://phpackages.com/badges/cliffom-tokenex/health.svg)](https://phpackages.com/packages/cliffom-tokenex)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[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)
