PHPackages                             chemistrymarketing/zoho-subscriptions-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. chemistrymarketing/zoho-subscriptions-sdk

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

chemistrymarketing/zoho-subscriptions-sdk
=========================================

Zoho Subscriptions SDK

v0.0.3-alpha(7y ago)14211MITPHP

Since Sep 12Pushed 7y agoCompare

[ Source](https://github.com/Chemistrymarketing/zoho-subscriptions-sdk)[ Packagist](https://packagist.org/packages/chemistrymarketing/zoho-subscriptions-sdk)[ RSS](/packages/chemistrymarketing-zoho-subscriptions-sdk/feed)WikiDiscussions master Synced today

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

Zoho Subscriptions PHP SDK
==========================

[](#zoho-subscriptions-php-sdk)

Partial PHP SDK for Zoho Subscriptions

Usage
-----

[](#usage)

To instantiate a client, use the static `build` method with your organisation ID and Auth token from Zoho.

```
use ZohoSubscription\Client as ZohoClient;

$client = new ZohoClient::build($id, $token);
```

### Customers

[](#customers)

If you're creating a customer, most of the customer data is not technically required (except the email address), so we have setter methods to add it when it is provided:

```
$customer = new \ZohoSubscription\Resources\Customers\Customer($email);
$customer->setName($firstName, $lastName, $salutation);
$customer->setCompanyName($companyName);
$customer->setCurrencyCode($currencyCode);
$customer->setDisplayName($displayName);
$customer->setVatRegistration($countryCode, $vatNumber);
```

You can add custom fields to customers like so:

```
$customer->addCustomField('label', 'value', 'data type');
$customer->addCustomField('label 2', 'value', 'data type');
```

Then when you're ready to save the customer, you send it to the method in the client, which returns the customer ID:

```
$id = $client->send($client)->getId();
```

#### Customer Addresses

[](#customer-addresses)

adding an address to a customer requires you to create Address objects:

```
$address = new  new \ZohoSubscription\Resources\Customers\Address();
$address->setRegion($country, $state, $zip);
$address->setLocale($street, $city, $attention);
```

then you can add it to the billing address or the shipping address on the customer before sending the request:

```
$customer->setBillingAddress($address);

$customer->setShippingAddress($address);
```

### Hosted Page: Subscriptions

[](#hosted-page-subscriptions)

Creating a subscription is, at it's simplest, a case of creating a Subscription entity and sending it to the client:

```
$subscription = new  new \ZohoSubscription\Resources\HostedPages\Subscription($customerId, $planId);

$url = $client->send($subscription)->getId();
```

This creates a hosted page, and returns the URL which your user needs to be redirected to in order to complete their subscription.

You can optionally add a redirect url to the subscription before you send the request to let Zoho know where to send the user after the order has been completed:

```
$subscription->addRedirectUrl($redirectUrl);
```

Regions
-------

[](#regions)

Zoho Subscriptions are available in different regions, which have different URL's to access the API.

To change to the EU region, you can use the `setApiRegionEU()` method on the `Client` class, and change it back with the `setApiRegionCOM()`

```
$client = ZohoSubscription\Client::build();

$client->setApiRegionEU();
$client->setApiRegionCOM();

$request = new ZohoSubscription\Resources\Customers\Customer('test@example.com');

$client->send($request);
```

Creating new API methods
------------------------

[](#creating-new-api-methods)

I have currently only created API classes for the functionality that is needed for the current project I am working on. If you need anything else, you can easily do so by implementing the `ZohoSubscription\Contracts\Requestable` interface and optionally using the `ZohoSubscription\Partials\HasRequestables` trait, for example this is a very basic Payment API implementation:

```
namespace MyCo\Zoho\Resources\Payments;

use ZohoSubscription\Contracts\Requestable;
use ZohoSubscription\Partials\HasRequestables;

class Payment implements Requestable
{
    use HasRequestables;

    public function __construct(string $customerId, int $amount, string $paymentMode)
    {
        $this->attributes['customer_id'] = $customerId;
        $this->attributes['amount'] = $amount;
        $this->attributes['payment_mode'] = $paymentMode;
    }

    /**
     * @return string
     * @throws \Exception
     */
    public function getUri(): string
    {
        return 'payments';
    }

    /**
     * @return string
     * @throws \Exception
     */
    public function getId(): string
    {
        if (is_null($this->response)) {
            throw new \Exception('Trying to get ID when request not sent yet');
        }
        return json_decode($this->response->getBody())->payment->payment_id;
    }
}
```

which you could build up and pass to the client's `send` method.

```
$payment = new MyCo\Zoho\Resources\Payments($customerId, $amount, 'cash');

$paymentId = $client->send($payment)->getId();
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

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

2799d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e16a979f062ee9a01f53d23dc34dd4fcfc0ac32df859827174bc7782d2e1aa5?d=identicon)[willishq](/maintainers/willishq)

---

Top Contributors

[![willishq](https://avatars.githubusercontent.com/u/1564903?v=4)](https://github.com/willishq "willishq (16 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chemistrymarketing-zoho-subscriptions-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/chemistrymarketing-zoho-subscriptions-sdk/health.svg)](https://phpackages.com/packages/chemistrymarketing-zoho-subscriptions-sdk)
```

###  Alternatives

[shlinkio/shlink

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

4.8k4.3k](/packages/shlinkio-shlink)[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

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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