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

ActiveLibrary[API Development](/categories/api)

zoyaspace/zoya-php-sdk
======================

Framework-agnostic PHP SDK for the Zoya API.

v0.1.1(today)02↑2900%proprietaryPHPPHP ^8.2CI passing

Since Jun 10Pushed todayCompare

[ Source](https://github.com/zoyaspace/zoya-php-sdk)[ Packagist](https://packagist.org/packages/zoyaspace/zoya-php-sdk)[ Docs](https://github.com/zoyaspace/zoya-php-sdk)[ RSS](/packages/zoyaspace-zoya-php-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Zoya PHP SDK
============

[](#zoya-php-sdk)

Framework-agnostic PHP SDK for the Zoya API.

Goals
-----

[](#goals)

- work in plain PHP and Laravel
- keep the core transport-neutral and framework-neutral
- allow endpoint resources to be added incrementally
- make API simulation and contract testing easy before the API surface is finalized

Current Scope
-------------

[](#current-scope)

This package currently provides the foundation layer and the first public API resource helpers:

- immutable SDK configuration
- API key authentication for the public API
- fixed environment mapping for `prod` and `dev`
- versioned public API prefix configuration
- PSR-18 transport support
- request factory based HTTP executor
- normalized response wrapper
- API exceptions
- fake transport for tests and API simulation
- OpenAPI contract scaffold for future code generation and mock servers
- convenience methods for public property and lead endpoints

OpenAPI
-------

[](#openapi)

The package includes a starter OpenAPI contract in `openapi/openapi.yaml`.

The intended workflow is:

- define or refine endpoints in OpenAPI first
- use the spec as the contract for backend, SDK, and external integrations
- use the spec to run a mock server during SDK development before the API is fully implemented
- keep ergonomic SDK resource classes hand-written on top of the contract instead of exposing generator output directly

Local Development
-----------------

[](#local-development)

```
composer install
composer test
```

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

[](#installation)

After the package is submitted to Packagist, the standard installation command is:

```
composer require zoyaspace/zoya-php-sdk
```

Until Packagist has indexed the package, you can use the GitHub VCS repository directly:

Via Composer VCS repository:

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/zoyaspace/zoya-php-sdk.git"
        }
    ],
    "require": {
        "zoyaspace/zoya-php-sdk": "dev-main"
    }
}
```

Then install dependencies:

```
composer install
```

After the first stable tag is published and Packagist has indexed the package, prefer a version constraint such as `^0.1` instead of `dev-main`.

Quick Start
-----------

[](#quick-start)

```
use Zoya\Sdk\Client\ZoyaClientFactory;
use Zoya\Sdk\Client\ZoyaEnvironment;

$apiToken = 'zya_xxxxx.yyyyy';

$client = ZoyaClientFactory::make(
    apiToken: $apiToken,
    environment: ZoyaEnvironment::Production,
    apiVersion: 'v1',
);

$investments = $client->listPropertyInvestments([
    'page' => ['number' => 1, 'size' => 20],
    'filter' => ['status' => ['active']],
    'sort' => '-created_at',
]);

$investment = $client->getPropertyInvestment('piv_xxxxxxxxxxxxxxxxxxxxxxxx');

$lead = $client->createLead([
    'contact_name' => 'Jan Kowalski',
    'contact_email' => 'jan.kowalski@example.com',
    'organization_id' => 'org_xxxxxxxxxxxxxxxxxxxxxxxx',
]);

$leadSources = $client->listLeadSourcesPage();
$firstLeadSource = $leadSources->items[0] ?? null;
```

If the integrator needs lower-level control, the SDK still exposes the manual `ZoyaClient` + `Psr18Transport` construction path.

API Token
---------

[](#api-token)

The SDK user should paste the API token in application configuration, not directly inside reusable library code.

For plain PHP:

```
$apiToken = getenv('ZOYA_API_TOKEN');
```

For Laravel:

```
$apiToken = config('services.zoya.api_token');
```

The token is then passed into the SDK through:

```
ZoyaClientFactory::make(apiToken: $apiToken, ...)
```

The SDK sends it in the `X-Zoya-Api-Key` request header, which matches the current public API contract.

Environments
------------

[](#environments)

The SDK supports only the official public API environments and always builds requests under the `/public/{version}` routing prefix:

- `ZoyaEnvironment::Production` -&gt; `https://api.zoyaspace.com`
- `ZoyaEnvironment::Development` -&gt; `https://api-dev.zoyaspace.com`

The public API version is configured separately:

- `apiVersion: 'v1'` -&gt; requests are sent to `/api/public/v1/...`
- `apiVersion: 'v2'` -&gt; requests would be sent to `/api/public/v2/...`

Example:

```
ZoyaClientFactory::make(
    apiToken: $apiToken,
    environment: ZoyaEnvironment::Development,
    apiVersion: 'v1',
)
```

That means `listLeadSources()` targets:

```
https://api-dev.zoyaspace.com/api/public/v1/lead-sources

```

For normal usage, the SDK user should choose one of the supported environments and an API version instead of passing custom server URLs. `baseUrlOverride` exists only for local SDK development, mock servers, and contract testing.

Examples
--------

[](#examples)

- [Plain PHP](examples/plain-php.php)
- [Laravel](examples/laravel.php)

Public API Helpers
------------------

[](#public-api-helpers)

The client currently exposes convenience methods for:

- `listPropertyInvestments(array $query = [])`
- `getPropertyInvestment(string $publicId)`
- `listProducts(array $query = [])`
- `getProduct(string $publicId)`
- `listPropertyBuildings(array $query = [])`
- `getPropertyBuilding(string $publicId)`
- `listPropertyUnits(array $query = [])`
- `getPropertyUnit(string $publicId)`
- `listLeadSources(array $query = [])`
- `getLeadSource(string $publicId)`
- `listSalesChannels(array $query = [])`
- `getSalesChannel(string $publicId)`
- `createLead(array $payload)`

For better DX, the client also exposes typed helpers for selected collection and detail responses:

- `listPropertyInvestmentsPage(array $query = [])`
- `getPropertyInvestmentData(string $publicId)`
- `listProductsPage(array $query = [])`
- `getProductData(string $publicId)`
- `listPropertyBuildingsPage(array $query = [])`
- `getPropertyBuildingData(string $publicId)`
- `listPropertyUnitsPage(array $query = [])`
- `getPropertyUnitData(string $publicId)`
- `listLeadSourcesPage(array $query = [])`
- `getLeadSourceData(string $publicId)`
- `listSalesChannelsPage(array $query = [])`
- `getSalesChannelData(string $publicId)`
- `createLeadData(array $payload)`

The `array $query` arguments accept nested PHP arrays and are serialized with PHP-compatible bracket notation, for example:

```
[
    'page' => ['number' => 1, 'size' => 20],
    'filter' => ['status' => ['active']],
    'sort' => '-created_at',
]
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

2

Last Release

0d ago

PHP version history (2 changes)v0.1.0PHP ^8.3

v0.1.1PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/117686706?v=4)[filonex](/maintainers/filonex)[@filonex](https://github.com/filonex)

---

Top Contributors

[![filonex](https://avatars.githubusercontent.com/u/117686706?v=4)](https://github.com/filonex "filonex (9 commits)")

---

Tags

phpapisdkzoya

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[openai-php/client

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

5.8k26.1M294](/packages/openai-php-client)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35729.6k2](/packages/telnyx-telnyx-php)[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

46684.5k5](/packages/deepseek-php-deepseek-php-client)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60415.4M74](/packages/mollie-mollie-api-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k5](/packages/theodo-group-llphant)[mozex/anthropic-php

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

49480.9k16](/packages/mozex-anthropic-php)

PHPackages © 2026

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