PHPackages                             subster/php-sdk - 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. subster/php-sdk

ActiveLibrary[API Development](/categories/api)

subster/php-sdk
===============

Unofficial PHP SDK for Subster

v0.0.5(1mo ago)028MITPHPPHP ^8.1

Since Feb 26Pushed 2w ago1 watchersCompare

[ Source](https://github.com/subster-payments/php-sdk)[ Packagist](https://packagist.org/packages/subster/php-sdk)[ Docs](https://github.com/subster/php-sdk)[ RSS](/packages/subster-php-sdk/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (10)Versions (6)Used By (0)

Subster PHP SDK
===============

[](#subster-php-sdk)

Work in progress. Not ready for production yet!

Requirements
------------

[](#requirements)

- PHP 8.1 or later.

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

[](#installation)

Install via composer:

```
composer require subster/php-sdk
```

Usage
=====

[](#usage)

Create a checkout session
-------------------------

[](#create-a-checkout-session)

```
use Subster\PhpSdk\SubsterConnector;
use Subster\PhpSdk\DataObjects\CreateCheckoutSessionData;

$subster = new SubsterConnector('your-api-key');

$session = $subster->checkoutSessions()->create(
    CreateCheckoutSessionData::from([
        'customer' => 'customer-id',
        'items' => [
            [
                'plan' => 'your-plan-id',
            ],
        ],
        'success_url' => 'https://example.ru/success',
        'cancel_url' => 'https://example.ru/cancel',
    ])
);
```

Create a checkout session with a paid trial
-------------------------------------------

[](#create-a-checkout-session-with-a-paid-trial)

```
use Subster\PhpSdk\SubsterConnector;
use Subster\PhpSdk\DataObjects\CheckoutSessionTrialData;
use Subster\PhpSdk\DataObjects\CheckoutSessionTrialDurationData;
use Subster\PhpSdk\DataObjects\CreateCheckoutSessionData;
use Subster\PhpSdk\DataObjects\CreateCheckoutSessionSubscriptionData;

$subster = new SubsterConnector('your-api-key');

$session = $subster->checkoutSessions()->create(
    CreateCheckoutSessionData::from([
        'customer' => 'customer-id',
        'items' => [
            [
                'plan' => 'your-recurring-plan-id',
            ],
        ],
        'subscription_data' => CreateCheckoutSessionSubscriptionData::from([
            'trial' => CheckoutSessionTrialData::from([
                'amount' => 100,
                'duration' => CheckoutSessionTrialDurationData::from([
                    'unit' => 'day',
                    'count' => 14,
                ]),
            ]),
        ]),
        'success_url' => 'https://example.ru/success',
        'cancel_url' => 'https://example.ru/cancel',
    ])
);
```

Allowed trial duration units: `hour`, `day`, `week`, `month`, `year`.

Create a billing portal session
-------------------------------

[](#create-a-billing-portal-session)

```
use Subster\PhpSdk\SubsterConnector;
use Subster\PhpSdk\DataObjects\CreateBillingPortalSessionData;

$subster = new SubsterConnector('your-api-key');

$session = $subster->billingPortalSessions()->create(
    CreateBillingPortalSessionData::from([
        'customer' => 'customer-id',
        'return_url' => 'https://example.ru/billing',
    ])
);
```

Change a subscription plan
--------------------------

[](#change-a-subscription-plan)

```
use Subster\PhpSdk\SubsterConnector;
use Subster\PhpSdk\DataObjects\ChangeSubscriptionPlanData;

$subster = new SubsterConnector('your-api-key');

$change = $subster->subscriptions()->changePlan(
    'subscription-id',
    ChangeSubscriptionPlanData::from([
        'plan' => 'target-plan-id',
        'success_url' => 'https://example.ru/success',
        'cancel_url' => 'https://example.ru/cancel',
    ])
);

if ($change->mode === 'checkout') {
    // Redirect the customer to $change->url.
}
```

Testing
=======

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Subster](https://github.com/subster)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance93

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

Total

5

Last Release

52d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4862088?v=4)[Anton Antonov](/maintainers/everully)[@everully](https://github.com/everully)

---

Top Contributors

[![everully](https://avatars.githubusercontent.com/u/4862088?v=4)](https://github.com/everully "everully (11 commits)")

---

Tags

phpapiclientsdksubster

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/subster-php-sdk/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k8.8M83](/packages/openai-php-laravel)[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

3623.1M18](/packages/kunalvarma05-dropbox-php-sdk)[google-gemini-php/laravel

Google Gemini PHP for Laravel is a supercharged PHP API client that allows you to interact with the Google Gemini AI API

637513.9k6](/packages/google-gemini-php-laravel)[resend/resend-php

Resend PHP library.

596.2M35](/packages/resend-resend-php)[mozex/anthropic-php

PHP client for the Anthropic API: messages, streaming, tool use, thinking, web search, code execution, batches, and more.

47480.9k16](/packages/mozex-anthropic-php)[gemini-api-php/laravel

Gemini API client for Laravel

8916.9k](/packages/gemini-api-php-laravel)

PHPackages © 2026

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