PHPackages                             1337erik/zoho-laravel-api - 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. 1337erik/zoho-laravel-api

ActiveLibrary[API Development](/categories/api)

1337erik/zoho-laravel-api
=========================

Fork from Asciisd's Laravel Zoho API V3 Package, need to take over maintaining and improving this for my own personal purposes. Feel free to use and contribute, this is my first time doing something like this.

052PHP

Since Mar 15Pushed 2y agoCompare

[ Source](https://github.com/1337erik/zoho-laravel-api)[ Packagist](https://packagist.org/packages/1337erik/zoho-laravel-api)[ RSS](/packages/1337erik-zoho-laravel-api/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Zoho API V3 Package
===========================

[](#laravel-zoho-api-v3-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6f5dc8ba98190bbfa388c476990489e9b7b609d65e36e4f6c33e0a48d126e27a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617363696973642f7a6f686f2d76332e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/zoho-v3)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/5f0c4fc17a682094a842ffd329848904cc984181bbf7c862b37f6e6675df9688/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617363696973642f7a6f686f2d76332f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/asciisd/zoho-v3/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f67584551c50177b575d4b71ff832fb5028932fe35d843c1da9aaf81840fb769/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617363696973642f7a6f686f2d76332e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/zoho-v3)

This package used to integrate with the new Zoho V3 Api CRM

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

[](#requirements)

- PHP &gt;= 8.0
- Laravel &gt;= 8.0

Registering a Zoho Client
-------------------------

[](#registering-a-zoho-client)

Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. To register your app:

1. Visit this page [https://api-console.zoho.com/](https://api-console.zoho.com)
2. Click on `ADD CLIENT`.
3. Choose a `Self Client`.
4. Enter `Scope: aaaserver.profile.READ,ZohoCRM.modules.ALL,ZohoCRM.settings.ALL`.
5. Create grant token by providing the necessary scopes, time duration (the duration for which the generated token is valid) and Scope Description.
6. Your Client app would have been created and displayed by now.
7. Select the created OAuth client.

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

[](#installation)

You can install the package via `composer require`:

```
composer require asciisd/zoho-v3
```

You'll need to add the following variables to your .env file. Use the credentials previously obtained registering your application.

```
ZOHO_CLIENT_ID="Code from Client Secrit Section"
ZOHO_CLIENT_SECRET="Code from Client Secrit Section"
ZOHO_REDIRECT_URI=https://APP_URL/zoho/oauth2callback
ZOHO_CURRENT_USER_EMAIL=admin@example.com
ZOHO_TOKEN="Code Generated from last step"

# available datacenters (USDataCenter, EUDataCenter, INDataCenter, CNDataCenter, AUDataCenter)
ZOHO_DATACENTER=USDataCenter
ZOHO_SANDBOX=true
```

You can publish the config file with:

```
php artisan vendor:publish --tag="zoho-v3-config"
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="zoho-v3-migrations"
php artisan migrate
```

### Environments

[](#environments)

maybe in some cases you wish to enforce zoho to use one of zoho's environments, so you can go to `AppServiceProvider`and use `Zoho::useEnvironment()` method

```
Zoho::useEnvironment(EUDataCenter::DEVELOPER());
```

So that will override config settings.

Usage
-----

[](#usage)

Imagine that you need to get all modules from Zoho system.

```
use Asciisd\Zoho\ZohoManager;

$response = ZohoManager::make(self::TESTING_MODULE);
$modules  = $response->getAllModules();
```

Model Can be used like this:-
-----------------------------

[](#model-can-be-used-like-this-)

Available only starting from **v1.1.0**

add `Zohoable` as extended class like this:-

```
use Asciisd\Zoho\Zohoable;
use Asciisd\Zoho\ZohoManager;

class Invoice extends Zohoable {

    // this is your Zoho module API Name
    protected $zoho_module_name = 'Payments';

    public function searchCriteria(){
        // you should return string of criteria that you want to find current record in crm with.
        //EX:
        return ZohoManager::make('Payments')
                            ->where('PaymentID', $this->payment_id)
                            ->andWhere('Order_ID', $this->order_id)
                            ->getCriteria();
    }

    public function zohoMandatoryFields() {
        // you should return array of mandatory fields to create module from this model
        // EX:
        return ['Base_Currency' => $this->currency];
    }
}
```

so now you can use invoice like this

```
$invoice = \App\Invoice::find(1);

// to check if has zoho id stored on local database or not
$invoice->hasZohoId();

// to return the stored zoho id
$invoice->zohoId();

// that will search on zoho with provided criteria to find the record and associated your model with returned id if exist
// if you provided an `id` that will be used instead of searching on Zoho
$invoice->createOrUpdateZohoId($id = null);

// you can also send current model to zoho
// that wil use `zohoMandatoryFields` method to Serialize model to zohoObject
// Also you can pass additional fields as array to this method
$invoice->createAsZohoable($options = []);
```

**Note:** To use the Invoice like this, you must have the `invoices` table in your database just like you would for any Laravel model. This allows you to save data to the database and also be able to link it to the `zohos` table and use all the functions in `Zohoable`. Use the CRUD functions below if you do not intend to use the Zohoable model this way.

CRUD Can be used like this:-
----------------------------

[](#crud-can-be-used-like-this-)

#### READ

[](#read)

```
use Asciisd\Zoho\ZohoManager;

// we can now deal with leads module
$leads = ZohoManager::useModule('Leads');

// OR

$leads = ZohoManager::make('Leads');

// find record by its ID
$lead = $leads->getRecord('3582074000002383003');
```

#### UPDATE

[](#update)

```
$record = new Record();
$record->setId('3582074000002383003');

// Set value as field
$record->addFieldValue(Leads::FirstName(), 'Updated');
$record->addFieldValue(Leads::LastName(), 'Record');

// Set value as key value
$lead->setKeyValue('Phone', '5555555555552');

// Then call update() method
$response = $leads->update($record);
```

#### CREATE

[](#create)

```
// create the record into zoho crm then get the created instance data
$response = $leads->create([
    'First_Name' => 'Amr',
    'Last_Name' => 'Emad',
    'Email' => 'test@asciisd.com',
    'Phone' => '012345678910',
]);
```

#### DELETE

[](#delete)

```
// delete record by its id
$lead = $leads->delete('3582074000002383003');
```

#### SEARCH

[](#search)

##### Word

[](#word)

```
use Asciisd\Zoho\ZohoManager;

$records = ZohoManager::useModule('Leads')->searchRecordsByWord('word to be searched');
$first_record = $records[0];
```

##### Phone

[](#phone)

```
use Asciisd\Zoho\ZohoManager;

$records = ZohoManager::useModule('Leads')->searchRecordsByPhone('12345678910');
$first_record = $records[0];
```

##### Email

[](#email)

```
use Asciisd\Zoho\ZohoManager;

$records = ZohoManager::make('Leads')->searchRecordsByEmail('nobody@asciisd.com');
$first_record = $records[0];
```

##### Criteria

[](#criteria)

```
use Asciisd\Zoho\ZohoManager;

$records = ZohoManager::make('Leads')->searchRecordsByCriteria('(City:equals:NY) and (State:equals:Alden)')->get();
$first_record = $records[0];
```

##### Custom

[](#custom)

```
use Asciisd\Zoho\ZohoManager;

$records = ZohoManager::make('Leads')
                    ->where('City', 'NY')
                    ->andWhere('State','Alden')
                    ->get();

$first_record = $records[0];
```

International Versions
----------------------

[](#international-versions)

If you're using zoho.com, you don't have to change anything.

If you're using zoho.eu, add to `.env`:

```
ZOHO_ACCOUNTS_URL=https://accounts.zoho.eu
ZOHO_API_BASE_URL=www.zohoapis.eu

```

If you're using zoho.com.cn, add to `.env`:

```
ZOHO_ACCOUNTS_URL=https://accounts.zoho.com.cn
ZOHO_API_BASE_URL=www.zohoapis.com.cn

```

Support
-------

[](#support)

Contact:
[asciisd.com](https://asciisd.com)

+2-010-1144-1444

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/asciisd/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [aemaddin](https://github.com/asciisd)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3d252ccb08ed709b170a24a082625e61f8fdb482044e112fb6be0550a7d9b3a?d=identicon)[1337erik](/maintainers/1337erik)

---

Top Contributors

[![1337erik](https://avatars.githubusercontent.com/u/20347157?v=4)](https://github.com/1337erik "1337erik (38 commits)")[![aemaddin](https://avatars.githubusercontent.com/u/11630742?v=4)](https://github.com/aemaddin "aemaddin (36 commits)")[![jaketoolson](https://avatars.githubusercontent.com/u/612332?v=4)](https://github.com/jaketoolson "jaketoolson (5 commits)")

### Embed Badge

![Health badge](/badges/1337erik-zoho-laravel-api/health.svg)

```
[![Health](https://phpackages.com/badges/1337erik-zoho-laravel-api/health.svg)](https://phpackages.com/packages/1337erik-zoho-laravel-api)
```

###  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.0k15](/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)
