PHPackages                             webleit/zohobooksapi - 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. webleit/zohobooksapi

ActiveLibrary[API Development](/categories/api)

webleit/zohobooksapi
====================

Zoho Books API v3 - PHP SDK

5.6.1(10mo ago)4881.0k↓76.5%50[3 issues](https://github.com/Weble/ZohoBooksApi/issues)[1 PRs](https://github.com/Weble/ZohoBooksApi/pulls)1MITPHPPHP ^7.2 || ^8.0

Since Feb 12Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/Weble/ZohoBooksApi)[ Packagist](https://packagist.org/packages/webleit/zohobooksapi)[ RSS](/packages/webleit-zohobooksapi/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (6)Versions (70)Used By (1)

[![Latest Version on Packagist](https://camo.githubusercontent.com/22a6dc056dfe2cb3c1474e61ab807e6389add3955c3d117515de9246558dae21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7765626c6569742f7a6f686f626f6f6b736170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/webleit/zohobooksapi)[![Total Downloads](https://camo.githubusercontent.com/95102b82f8f374a31e0f5ae0573d510de15f854961e69dbb00188858704755dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7765626c6569742f7a6f686f626f6f6b736170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/webleit/zohobooksapi)

Zoho Books API v3 - PHP SDK
===========================

[](#zoho-books-api-v3---php-sdk)

This Library is a SDK in PHP that simplifies the usage of the Zoho Books Api version 3 () It provides both an interface to ease the interaction with the APIs without bothering with the actual REST request, while packaging the various responses using very simple Model classes that can be then uses with any other library or framework.

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

[](#installation)

```
composer require webleit/zohobooksapi

```

Usage
-----

[](#usage)

In order to use the library, just require the composer autoload file, and then fire up the library itself. In order for the library to work, you need to be authenticated with the zoho apis.

Online Mode
-----------

[](#online-mode)

```
require './vendor/autoload.php';

// setup the generic zoho oath client
$oAuthClient = new \Weble\ZohoClient\OAuthClient('[CLIENT_ID]', '[CLIENT_SECRET]');
$oAuthClient->setRefreshToken('[REFRESH_TOKEN]');
$oAuthClient->setRegion(\Weble\ZohoClient\Enums\Region::us());
$oAuthClient->useCache($yourPSR6CachePool);

// setup the zoho books client
$client = new \Webleit\ZohoBooksApi\Client($oAuthClient);
$client->setOrganizationId('[YOUR_ORGANIZATION_ID]');

// Create the main class
$zohoBooks = new \Webleit\ZohoBooksApi\ZohoBooks($client);
```

Offline Mode
------------

[](#offline-mode)

This one is preferred when you need to autonomously renew the access token yourself. Used in all the "machine to machine" communication, and it's the best way when you are using the apis to, for example, sync with a 3rd party application, like your ERP or Ecommerce website. See  for more details on this.

```
require './vendor/autoload.php';

// setup the generic zoho oath client
$oAuthClient = new \Weble\ZohoClient\OAuthClient('[CLIENT_ID]', '[CLIENT_SECRET]');
$oAuthClient->setRefreshToken('[REFRESH_TOKEN]');
$oAuthClient->setRegion(\Weble\ZohoClient\Enums\Region::us());
$oAuthClient->useCache($yourPSR6CachePool);
$oAuthClient->offlineMode();

// Access Token
$accessToken = $oAuthClient->getAccessToken();
$isExpired = $oAuthClient->accessTokenExpired();

// setup the zoho books client
$client = new \Webleit\ZohoBooksApi\Client($oAuthClient);
$client->setOrganizationId('[YOUR_ORGANIZATION_ID]');

// Create the main class
$zohoBooks = new \Webleit\ZohoBooksApi\ZohoBooks($client);
```

API calls
---------

[](#api-calls)

To call any Api, just use the same name reported in the api docs. You can get the list of supported apis using the getAvailableModules() method

```
$zohoBooks->getAvailableModules();
```

You can, for example, get the list of invoices by using:

```
$invoices = $zohoBooks->invoices->getList();
```

or the list of contacts

```
$contacts = $zohoBooks->contacts->getList();
```

### List calls

[](#list-calls)

To get a list of resources from a module, use the getList() method

```
$invoices = $zohoBooks->invoices->getList();
```

It's possible to pass through some parameters to filter the result (see the zoho books api docs for some examples)

```
$invoices = $zohoBooks->invoices->getList(['status' => 'unpaid']);
```

In order to navigate the pages, just use the "page" and "per\_page" parameters in the getList call

```
$invoices = $zohoBooks->invoices->getList(['status' => 'unpaid', 'page' => 3, 'per_page' => 200]);
```

Return Types
------------

[](#return-types)

Any "list" api call returns a Collection object, which is taken for Laravel Collection package. You can therefore use the result as Collection, which allows mapping, reducing, serializing, etc

```
$invoices = $zohoBooks->invoices->getList();

$data = $invoices->toArray();
$json = $invoices->toJson();

// After fetch filtering in php
$filtered = $invoices->where('total', '>', 200);

// Grouping
$filtered = $invoices->groupBy('customer_id');
```

Any "resource" api call returns a Model object of a class dedicated to the single resource you're fetching. For example, calling

```
$invoice = $zohoBooks->invoices->get('idoftheinvoice');
$id = $invoice->getId();
$data = $invoice->toArray();
$total = $invoice->total;
```

will return a \\Webleit\\ZohoBooksApi\\Models\\Invoice object, which is Arrayable and Jsonable, and that can be therefore used in many ways.

Zoho Books token expiration notes
---------------------------------

[](#zoho-books-token-expiration-notes)

- Each access token is valid for only an hour and used only for the operations defined in the scope.
- Refresh token does not expire. Use it to refresh access tokens when they expire.
- You can only generate a maximum of five refresh tokens in a minute.

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

[](#contributing)

Finding bugs, sending pull requests or improving the docs - any contribution is welcome and highly appreciated

Versioning
----------

[](#versioning)

Semantic Versioning Specification (SemVer) is used.

Copyright and License
---------------------

[](#copyright-and-license)

Copyright Weble Srl under the MIT license.

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance52

Moderate activity, may be stable

Popularity46

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 76.4% 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 ~51 days

Recently: every ~82 days

Total

67

Last Release

321d ago

Major Versions

1.0 → 2.0.02017-01-13

2.2.3 → 3.0.02019-09-17

3.3.3 → 4.0.02020-04-09

4.5.1 → 5.0.02021-02-12

PHP version history (4 changes)1.0PHP &gt;=5.5.0

4.0.0PHP &gt;=7.2.0

4.5.0PHP ^7.2 || 8.0

5.2.2PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fe88932c3280467c9a30f79205c0f2c85aecd28dae3a9e8b035d773ef6218ef?d=identicon)[Skullbock](/maintainers/Skullbock)

---

Top Contributors

[![Skullbock](https://avatars.githubusercontent.com/u/1104083?v=4)](https://github.com/Skullbock "Skullbock (198 commits)")[![xrobau](https://avatars.githubusercontent.com/u/457798?v=4)](https://github.com/xrobau "xrobau (19 commits)")[![tm1000](https://avatars.githubusercontent.com/u/564256?v=4)](https://github.com/tm1000 "tm1000 (15 commits)")[![bluec](https://avatars.githubusercontent.com/u/1577895?v=4)](https://github.com/bluec "bluec (6 commits)")[![mhallhol](https://avatars.githubusercontent.com/u/74914650?v=4)](https://github.com/mhallhol "mhallhol (4 commits)")[![ibmgeniuz](https://avatars.githubusercontent.com/u/64996874?v=4)](https://github.com/ibmgeniuz "ibmgeniuz (2 commits)")[![midweste](https://avatars.githubusercontent.com/u/6331501?v=4)](https://github.com/midweste "midweste (2 commits)")[![kishan93](https://avatars.githubusercontent.com/u/5936307?v=4)](https://github.com/kishan93 "kishan93 (1 commits)")[![benlumley](https://avatars.githubusercontent.com/u/194052?v=4)](https://github.com/benlumley "benlumley (1 commits)")[![mogilvie](https://avatars.githubusercontent.com/u/7894754?v=4)](https://github.com/mogilvie "mogilvie (1 commits)")[![n4huel](https://avatars.githubusercontent.com/u/13697682?v=4)](https://github.com/n4huel "n4huel (1 commits)")[![ProgrammerZ](https://avatars.githubusercontent.com/u/5883291?v=4)](https://github.com/ProgrammerZ "ProgrammerZ (1 commits)")[![stojankukrika](https://avatars.githubusercontent.com/u/10199584?v=4)](https://github.com/stojankukrika "stojankukrika (1 commits)")[![marcopetersamazing](https://avatars.githubusercontent.com/u/26324203?v=4)](https://github.com/marcopetersamazing "marcopetersamazing (1 commits)")[![berrugo](https://avatars.githubusercontent.com/u/10728169?v=4)](https://github.com/berrugo "berrugo (1 commits)")[![CihanSenturk](https://avatars.githubusercontent.com/u/53110792?v=4)](https://github.com/CihanSenturk "CihanSenturk (1 commits)")[![GameGamer43](https://avatars.githubusercontent.com/u/78716?v=4)](https://github.com/GameGamer43 "GameGamer43 (1 commits)")[![jpvaillancourt](https://avatars.githubusercontent.com/u/4520731?v=4)](https://github.com/jpvaillancourt "jpvaillancourt (1 commits)")[![jutiss](https://avatars.githubusercontent.com/u/29696357?v=4)](https://github.com/jutiss "jutiss (1 commits)")[![jvandervalk](https://avatars.githubusercontent.com/u/58563121?v=4)](https://github.com/jvandervalk "jvandervalk (1 commits)")

---

Tags

apiZohobookszohobooks

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webleit-zohobooksapi/health.svg)

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

###  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.7k7.6M74](/packages/openai-php-laravel)[tristanjahier/zoho-crm

A PHP client for the API of Zoho CRM.

2414.3k](/packages/tristanjahier-zoho-crm)[rugaard/weatherkit

Integrate Apple WeatherKit API into your project

111.4k](/packages/rugaard-weatherkit)

PHPackages © 2026

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