PHPackages                             templatemonster/api2-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. templatemonster/api2-client

ActiveLibrary[API Development](/categories/api)

templatemonster/api2-client
===========================

TemplateMonster API client

1.1.2(1y ago)0557[1 PRs](https://github.com/Plasma-Platform/Plasma-API2-Client/pulls)Apache License, Version 2.0PHPPHP &gt;=5.3.0

Since Jul 2Pushed 5mo ago9 watchersCompare

[ Source](https://github.com/Plasma-Platform/Plasma-API2-Client)[ Packagist](https://packagist.org/packages/templatemonster/api2-client)[ RSS](/packages/templatemonster-api2-client/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)DependenciesVersions (15)Used By (0)

TemplateMonster API2 Client
===========================

[](#templatemonster-api2-client)

[![version](https://camo.githubusercontent.com/63581ff8196e0cec357b66185a2ae628330cf35a0af523c82ec8ca67abfde49b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e312e322d677265656e2e737667)](./CHANGELOG.md) [![php-version](https://camo.githubusercontent.com/7414c9e895268a54581928f4829ab7fb1c6ccf5b2a8b626e6674634556071976/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d706870266d6573736167653d2533453d352e3326636f6c6f723d677265656e)](https://camo.githubusercontent.com/7414c9e895268a54581928f4829ab7fb1c6ccf5b2a8b626e6674634556071976/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d706870266d6573736167653d2533453d352e3326636f6c6f723d677265656e)

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

[](#installation)

Using Composer (recommended)

Add the dependency in your `composer.json`

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/M0nsterLabs/api2client.git"
        }
    ],
    "require": {
        "templatemonster/api2-client":"dev-master"
    }
}
```

Usage
-----

[](#usage)

Templates
=========

[](#templates)

```
// Create API instance
$api = new \API2Client\Api ('api2.templatemonster.com', 'myUserName', 'myUserToken');

// Receive a count of all Templates
$templatesCount = $api->getTemplatesCount ()

// Receive a list of Templates
$offset = 0;
$limit  = 20;

$templates = $api->getTemplatesList ($offset, $limit);

/** @var API2Client\Entities\Template $template  */
foreach ($templates as $template)
{
    // Template pages
    $templatePages =  $template->getPages ();
}

// Receive a single Template
$template_id = 30506;

/** @var API2Client\Entities\Template $template */
$template = $api->getTemplate ($template_id);
```

Orders
======

[](#orders)

Receive a status of Order
-------------------------

[](#receive-a-status-of-order)

```
/** @var \API2Client\Entities\Order\Status $status */
$status  = $api->getOrderStatus ('rgRvuzZQP9OoALyEKGKA');

// print status title
echo $status->getStatusName ();
```

Get all Statuses
----------------

[](#get-all-statuses)

```
$statuses = $api->getOrderStatuses ();

/** @var \API2Client\Entities\Order\Status  $status */
foreach ($statuses as $status)
{
    echo $status->getStatusCode ();
    echo $status->getStatusName ();
}
```

Create an Order
---------------

[](#create-an-order)

```
$order = new \API2Client\Entities\Order ();

$order->setProjectId        (0);
$order->setAmount           (174);
$order->setBonusesAmount    (0);

$billingInfo = new \API2Client\Entities\Order\BillingInfo ();

$billingInfo->setAccountSId     ('u03e9b361c607ju37707iyo8s273sibh9z8lka2e6kt3276e41g11e7f6ozjm0cv7c4a40piorf408bb203of6wnbx2v24xfo61nwr4o7960tu898w50u4bu51zn2fa1');
$billingInfo->setAddress        ('Torenplein Str');
$billingInfo->setCityName       ('Hasselt');
$billingInfo->setContactPhone   (74933242323);
$billingInfo->setEmail          ('mark.twain@mail.com');
$billingInfo->setCountryISO2    ('BE');
$billingInfo->setFullName       ('Mark Twain');
$billingInfo->setPhone          (74933242323);
$billingInfo->setPostalCode     (12123);
$billingInfo->setStateISO2      ('XX');

$order->setBillingInfo ($billingInfo);

$productInfo1 = new \API2Client\Entities\Order\ProductInfo ();

$productInfo1->setProductId (49334);
$productInfo1->setPrice     (69);
$productInfo1->setType      ('template');

$order->addProductInfo ($productInfo1);

$productInfo2 = new \API2Client\Entities\Order\ProductInfo ();

$productInfo2->setProductId (49334);
$productInfo2->setPrice     (75);
$productInfo2->setType      ('template');

$order->addProductInfo ($productInfo2);

$externalProduct = new \API2Client\Entities\Order\ProductInfo ();

$externalProduct->setProductId  (0);
$externalProduct->setPrice      (33);
$externalProduct->setFinalPrice (30);
$externalProduct->setName       ('Headspace Journey Subscription');
$externalProduct->setType       ('external');

$order->addProductInfo ($externalProduct);

$trackingInfo = new \API2Client\Entities\Order\TrackingInfo ();

$trackingInfo->setRmsLocale     ('EN');
$trackingInfo->setRefererUrl    ('http://localhost:8081/');
$trackingInfo->setUserAgent     ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36');
$trackingInfo->setUserIPAddress ('10.0.2.2');
$trackingInfo->setUserLanguage  ('en-US,en;q=0.8,uk;q=0.6,ru;q=0.4');
$trackingInfo->setUserLocalTime ('Tue May 27 2014 10:31:05 GMT+0300 (EEST)');
$trackingInfo->setTrackers (array(
    "ga" => "GA1.1.1479631296.1738839056"
));

$order->setTrackingInfo ($trackingInfo);

$paymentInfo = new \API2Client\Entities\Order\PaymentInfo ();

$paymentInfo->setCurrencyId     (0);
$paymentInfo->setCurrencyRate   (1);
$paymentInfo->setPaymentId      (2);

$order->setPaymentInfo ($paymentInfo);

/** @var \API2Client\Entities\OrderCreated $result */
$result = $api->createOrder ($order);
```

Get customer management portal link
-----------------------------------

[](#get-customer-management-portal-link)

```
// Create API instance
$api = new \API2Client\Api ('api2.templatemonster.com', 'myUserName', 'myUserToken');
$subscriptionId = 'abc12345678';
$link = $api->getCustomerManagementPortalLink($subscriptionId);
```

Success response

```
API2Client\Entities\Order\CustomerPortal Object
(
    [link:protected] => https://billing.stripe.com/p/session/test_YWNjdF8VGb1NE
    [status:API2Client\Entities\Order\CustomerPortal:private] => 1
    [messages:API2Client\Entities\Order\CustomerPortal:private] => Array()
)
```

Response if not exist subscriptions

```
API2Client\Entities\Order\CustomerPortal Object
(
    [link:protected] =>
    [status:API2Client\Entities\Order\CustomerPortal:private] =>
    [messages:API2Client\Entities\Order\CustomerPortal:private] => Array
        (
            [0] => Subscription does not exists
        )
)
```

Response if payment method not supported customer management portal

```
API2Client\Entities\Order\CustomerPortal Object
(
    [link:protected] =>
    [status:API2Client\Entities\Order\CustomerPortal:private] =>
    [messages:API2Client\Entities\Order\CustomerPortal:private] => Array
        (
            [0] => Payment method not supported customer management portal
        )
)
```

Get url on invoice url by transaction
-------------------------------------

[](#get-url-on-invoice-url-by-transaction)

```
// Create API instance
$api = new \API2Client\Api ('api2.templatemonster.com', 'myUserName', 'myUserToken');
$link = $api->getInvoiceUrl('abc12345678');
```

Success response

```
API2Client\Entities\Order\BillingPortal Object
(
    [url:protected] => https://www.domain.com/invoice/a1?token=token
    [status:API2Client\Entities\Order\BillingPortal:private] => 1
    [messages:API2Client\Entities\Order\BillingPortal:private] => Array()
)
```

Get url on status page url by transaction
-----------------------------------------

[](#get-url-on-status-page-url-by-transaction)

```
// Create API instance
$api = new \API2Client\Api ('api2.templatemonster.com', 'myUserName', 'myUserToken');
$link = $api->getTransactionStatusUrl('abc12345678');
```

Success response

```
API2Client\Entities\Order\BillingPortal Object
(
    [url:protected] => https://www.domain.com/transaction-statuses/a1?token=token
    [status:API2Client\Entities\Order\BillingPortal:private] => 1
    [messages:API2Client\Entities\Order\BillingPortal:private] => Array()
)
```

Error Handling
--------------

[](#error-handling)

```
try
{
    $templatesCount = $api->getTemplatesCount ()
}
catch (\API2Client\ApiException $e)
{
    // API Error
    $e->getMessage ();
}
catch (\API2Client\Client\APIException $e)
{
    // HTTP Client Error
    $e->getMessage ();
}
```

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance60

Regular maintenance activity

Popularity15

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity66

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

Recently: every ~19 days

Total

13

Last Release

437d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a155b7be23704de5be0dcb5d2b543736a2e9765ea2eb7e6103fb28307bf2b9b?d=identicon)[ch-tm](/maintainers/ch-tm)

---

Top Contributors

[![0legKolomiets](https://avatars.githubusercontent.com/u/5287629?v=4)](https://github.com/0legKolomiets "0legKolomiets (29 commits)")[![dimanovoseltsev](https://avatars.githubusercontent.com/u/3934456?v=4)](https://github.com/dimanovoseltsev "dimanovoseltsev (21 commits)")[![ch-tm](https://avatars.githubusercontent.com/u/22640796?v=4)](https://github.com/ch-tm "ch-tm (6 commits)")[![utrain-tm](https://avatars.githubusercontent.com/u/8993736?v=4)](https://github.com/utrain-tm "utrain-tm (4 commits)")[![bumblebeeTM](https://avatars.githubusercontent.com/u/64977456?v=4)](https://github.com/bumblebeeTM "bumblebeeTM (3 commits)")[![ch](https://avatars.githubusercontent.com/u/16863?v=4)](https://github.com/ch "ch (2 commits)")[![aleksandrfirst](https://avatars.githubusercontent.com/u/26219042?v=4)](https://github.com/aleksandrfirst "aleksandrfirst (2 commits)")[![RossKvit](https://avatars.githubusercontent.com/u/48969922?v=4)](https://github.com/RossKvit "RossKvit (1 commits)")

### Embed Badge

![Health badge](/badges/templatemonster-api2-client/health.svg)

```
[![Health](https://phpackages.com/badges/templatemonster-api2-client/health.svg)](https://phpackages.com/packages/templatemonster-api2-client)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k13](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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