PHPackages                             kinow-io/pipedrive-laravel-55 - 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. kinow-io/pipedrive-laravel-55

ActiveLibrary[API Development](/categories/api)

kinow-io/pipedrive-laravel-55
=============================

Complete Pipedrive API client for PHP and/or Laravel 5.5

2.15.0(3y ago)0616MITPHP

Since Dec 8Pushed 3y agoCompare

[ Source](https://github.com/kinow-io/pipedrive-laravel-55)[ Packagist](https://packagist.org/packages/kinow-io/pipedrive-laravel-55)[ RSS](/packages/kinow-io-pipedrive-laravel-55/feed)WikiDiscussions addSearchEndpoint Synced 2d ago

READMEChangelogDependencies (5)Versions (58)Used By (0)

Complete Pipedrive API client for PHP
=====================================

[](#complete-pipedrive-api-client-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/d12770ceb2f54c74e2dc352b605813c33c2ba7e5fa30255e8e350fbb5f0558d0/68747470733a2f2f706f7365722e707567782e6f72672f646576696f2f7069706564726976652f762f737461626c65)](https://packagist.org/packages/devio/pipedrive) [![Build Status](https://camo.githubusercontent.com/a6e7db3b3a7e4da0f8dcf55bdf2470172b33b86ee29c1641d28c0843bc6508ba/68747470733a2f2f7472617669732d63692e6f72672f49737261656c4f7274756e6f2f7069706564726976652e737667)](https://travis-ci.org/IsraelOrtuno/pipedrive) [![Total Downloads](https://camo.githubusercontent.com/3130705403eed6102662ceef9654fa53e8d93d519e828e96e772ba413d22dbed/68747470733a2f2f706f7365722e707567782e6f72672f646576696f2f7069706564726976652f646f776e6c6f616473)](https://packagist.org/packages/devio/pipedrive)

Contribute by referral code / link
----------------------------------

[](#contribute-by-referral-code--link)

This won't take much time. You could use my referral code or link to get up to 45 days completely free of charge. Just sign up using this link or add the code to the billing section:

[af-devio](https://www.pipedrive.com/register?promocode=af-devio)

Consider donating
-----------------

[](#consider-donating)

Do you like this package? Did you find it useful? Donate and support its development.

[![Donate](https://camo.githubusercontent.com/604e3db9c8751116b3f765aad0353ec7ded655bbe8aaacbc38d8c4a6b784b3ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d677265656e2e737667)](https://www.paypal.me/IsraelOrtuno)

---

This package provides a complete **framework agnostic** Pipedrive CRM API client library for PHP. It includes all the resources listed on Pipedrive's documentation.

Feel free to drop me a message at  or tweet me at [@IsraelOrtuno](https://twitter.com/IsraelOrtuno).

Quick start using API token (read below for OAuth)
--------------------------------------------------

[](#quick-start-using-api-token-read-below-for-oauth)

```
$token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx';
$pipedrive = new Pipedrive($token);

// Easily access a Pipedrive resource and its values
$organization = $pipedrive->organizations->find(1);
var_dump($organization->getData());

// Also simple to update any Pipedrive resource value
$organization = $pipedrive->organizations->update(1, ['name' => 'Big Code']);
var_dump($organization->getData());

// Keep reading this documentation to find out more.
```

For a deeper knowledge of how to use this package, follow this index:

- [Installation](#installation)
- [Usage](#usage)
    - [Create the Pipedrive instance](#create-the-pipedrive-instance)
        - [With API token](#using-api-token)
        - [With OAuth](#using-oauth)
    - [Resolve a Pipedrive API Resource](#resolve-a-pipedrive-api-resource)
- [Performing a resource call](#performing-a-resource-call)
    - [Available methods](#available-methods)
    - [Performing the Request](#performing-the-request)
    - [Handling the response](#handling-the-response)
    - [Response methods](#response-methods)
- [Available resources](#available-resources)
    - [The File Resource](#the-file-resource)
- [Configure and use in Laravel](#configure-and-use-in-laravel)
    - [Service Provider and Facade](#service-provider-and-facade)
    - [The service configuration](#the-service-configuration)
    - [Using it](#using-it)
- [Contribute](#contribute)

Important
=========

[](#important)

Versions 1.x do not include OAuth support, update to version 2.x to use this feature.

Installation
============

[](#installation)

You can install the package via `composer require` command:

```
composer require devio/pipedrive
```

Or simply add it to your composer.json dependences and run `composer update`:

```
"require": {
    "devio/pipedrive": "^2.0"
}
```

Usage
=====

[](#usage)

Create the Pipedrive instance
-----------------------------

[](#create-the-pipedrive-instance)

`Devio\Pipedrive\Pipedrive` class acts as Manager and will be responsible of resolving the different API resources available. Pipedrive supports two different authentication methods: via **API token** (for manual integrations) and with **OAuth** (for public and private apps). You can read more about it on the official documentation, here:

### Using API token

[](#using-api-token)

```
$token = 'PipedriveTokenHere';
$pipedrive = new Pipedrive($token);
```

> NOTE: Consider storing this object into a global variable.

### Using OAuth

[](#using-oauth)

To understand how the OAuth flow works, please read the documentation first.
You can find it here:

You will first need to create an app and retrieve client\_id and client\_secret. Please, read the official documentation to learn how to do that.
You can find all you need here:

Once you have your client\_id, client\_secret, and redirect\_url, you can instantiate the class like this:

```
$pipedrive = Pipedrive::OAuth([
    'clientId' => '',
    'clientSecret' => '',
    'redirectUrl' => '',
    'storage' => new PipedriveTokenIO() // This is your implementation of the PipedriveTokenStorage interface (example below)
]);
```

**The class will automatically handle the redirect to the authentication server and refresh token requests.**

The only thing you need to provide is your own implementation of the PipedriveTokenStorage interface.

The purpose of this class is to read and write a `PipedriveToken` object, containing `access_token`, `refresh_token`, and `expiresAt`, giving you the ability to handle this information as you prefer (for example storing these properties in your preferred way).

Here's an example of how it can be implemented:

```
class PipedriveTokenIO implements \Devio\Pipedrive\PipedriveTokenStorage
{
    public function setToken(\Devio\Pipedrive\PipedriveToken $token) {
        $_SESSION['token'] = serialize($token); // or encrypt and store in the db, or anything else...
    }

    public function getToken() { // Returns a PipedriveToken instance
        return isset($_SESSION['token']) ? unserialize($_SESSION['token']) : null;
    }
}
```

In this simple example, the PipedriveToken is simply stored and retrieved from the session. Which means that once the session expires, the user will be redirected to the authentication page.

You might want to store this object inside the database. Storing the whole object serialized could be the fastest way to do that, but you can also retrieve access token, refresh token, and the expiration time individually using the methods `getAccessToken`, `getRefreshToken`, and `expiresAt`. Like this:

```
public function setToken(\Devio\Pipedrive\PipedriveToken $token) {
    $token->getAccessToken(); // save it individually
    $token->getRefreshToken(); // save it individually
    $token->expiresAt(); // save it individually
}
```

Similarly, the object can be instantiated like so:

```
$token = new \Devio\Pipedrive\PipedriveToken([
    'accessToken' => 'xxxxx', // read it individually from the db
    'refreshToken' => 'xxxxx', // read it individually from the db
    'expiresAt' => 'xxxxx', // read it individually from the db
]);
```

#### Handling the callback

[](#handling-the-callback)

In the callback (the url you specified as `redirectUrl`), you should call the `authorize` method on the `$pipedrive` object, like so:

```
if(!empty($_GET['code'])) {
    $pipedrive->authorize($_GET['code']);
}
```

This will exchange the authorization code for the first access token, and store it using the `setToken` method you provided.

Resolve a Pipedrive API Resource
--------------------------------

[](#resolve-a-pipedrive-api-resource)

Once we have our Pipedrive instance, we are able to resolve any Pipedrive API Resource in many ways.

First you could do it calling the `make()` method:

```
// Organizations
$organizations = $pipedrive->make('organizations');
// Persons
$persons = $pipedrive->make('persons');
// ...
```

It also intercepts the magic method `__get` so we could do:

```
// Deals
$deals = $pipedrive->deals;
// Activities
$activities = $pipedrive->activities;
// ...
```

And just in case you prefer `__call`, you can use it, too:

```
// EmailMessages
$emailMessages = $pipedrive->emailMessages();
// GlobalMessages
$globalMessages = $pipedrive->globalMessages();
// ...
```

They are 3 different ways of doing the same thing, pick the one you like the most. It will automatically set the **studly case** version of the asked resource, so it will work with `emailMessages`, `EmailMessages`, `email_messages`...

> IMPORTANT: Navigate to the `src/Resources` directory to find out all the resources available.

Performing a resource call
--------------------------

[](#performing-a-resource-call)

### Available methods

[](#available-methods)

All resources have various methods for performing the different API requests. Please, navigate to the resource class you would like to work with to find out all the methods available. Every method is documented and can also be found at [Pipedrive API Docs page](https://developers.pipedrive.com/v1).

Every resource extends from `Devio\Pipedrive\Resources\Basics\Resource` where the most common methods are defined. Some of them are disabled for the resources that do not include them. Do not forget to check out the Traits included and some resources use, they define some other common calls to avoid code duplication.

### Performing the Request

[](#performing-the-request)

After resolved the resource we want to use, we are able to perform an API request. At this point, we only have to execute the endpoint we would like to access:

```
$organizations = $pipedrive->organizations->all();
//
$pipedrive->persons->update(1, ['name' => 'Israel Ortuno']);
```

Any of these methods will perform a synchronous request to the Pipedrive API.

### Handling the response

[](#handling-the-response)

Every Pipedrive API endpoint gives a response and this response is converted to a `Devio\Pipedrive\Http\Response` object to handle it:

```
$response = $pipedrive->organizations->all();

$organizations = $response->getData();
```

#### Response methods

[](#response-methods)

The `Response` class has many methods available for accessing the response data:

##### isSuccess()

[](#issuccess)

Check if the server responded the request was successful.

##### getContent()

[](#getcontent)

Will provide the raw response provided by the Pipedrive API. Useful if you need specific control.

##### getData()

[](#getdata)

Get the response main data object which will include the information about the endpoint we are calling.

##### getAdditionalData()

[](#getadditionaldata)

Some responses include an additional data object with some extra information. Fetch this object with this method.

##### getStatusCode()

[](#getstatuscode)

Get the response status code.

##### getHeaders()

[](#getheaders)

Get the response headers.

Available resources
-------------------

[](#available-resources)

Every Resource logic is located at the `src/Resources` directory. However we'll mention every included resource here:

ResourceMethods implementedNotesActivities✅ 6/6ActivityFields✅ 1/1ActivityTypes✅ 5/5Currencies✅ 1/1DealFields✅ 25/25Deals✅ 6/6EmailMessages✅ 4/4EmailThreads✅ 6/6Files✅ 8/8Filters✅ 6/6GlobalMessages✅ 2/2Goals⚠️ 5/6Missing goal results methodNotes✅ 5/5NoteFields✅ 1/1OrganizationFields✅ 6/6OrganizationRelationships✅ 5/5Organizations✅ 18/18PermissionsSets✅ 6/6PersonFields✅ 18/20Persons⚠️ 18/20Missing `add` and `delete` pictures as getting required fields error.Pipelines⚠️ 6/8Missing deals conversion rates and deals movementsProductFields✅ 6/6Products✅ 9/9PushNotifications✅ 4/4Recents✅ 1/1Roles⚠️ 0/11Getting unathorized accessSearchResults✅ 2/2Stages✅ 7/7UserConnections✅ 1/1Users⚠️ 13/20Getting unathorized access when playing with roles and permissionsUserSettings✅ 1/1✅ Completed / ⚠️ Pipedrive API errors

### The File Resource

[](#the-file-resource)

The File resource is the only one that works a little bit different than others. While other resources may be intuitively used as most of them just require a plain array of tada, the `File` resource requires an `\SplFileInfo` instance to make it work:

```
$file = new \SplFileInfo('document.pdf');

$pipedrive->files->add([
    'file'   => $file,
    'person_id' => 1,
    // 'deal_id' => 1
]);
```

Actually, it is pretty simple. Just pass a `\SplFileInfo` instance to the `file` key of the options array and specify at least one of the elements it goes related to (deal, person, ...).

Configure and use in Laravel
============================

[](#configure-and-use-in-laravel)

If you are using Laravel, you could make use of the `PipedriveServiceProvider` and `PipedriveFacade` which will make the using of this package much more comfortable:

Service Provider and Facade
---------------------------

[](#service-provider-and-facade)

Include the `PipedriveServiceProvider` to the providers array in `config/app.php` and register the Laravel Facade.

```
'providers' => [
  ...
  Devio\Pipedrive\PipedriveServiceProvider::class,
  ...
],
'alias' => [
    ...
    'Pipedrive' => Devio\Pipedrive\PipedriveFacade::class,
    ...
]
```

The service configuration
-------------------------

[](#the-service-configuration)

Laravel includes a configuration file for storing external services information at `config/services.php`. We have to set up our Pipedrive token at that file like this:

```
'pipedrive' => [
    'token' => 'the pipedrive token'
]
```

Of course, as many other config parameters, you could store the token at your `.env` file or environment variable and fetch it using `dotenv`:

```
'pipedrive' => [
    'token' => env('PIPEDRIVE_TOKEN')
]
```

Using it
--------

[](#using-it)

You could use it using the Laravel facade `PipedriveFacade` that we have previously loaded:

```
$organizations = Pipedrive::organizations()->all();
//
Pipedrive::persons()->add(['name' => 'John Doe']);
```

Also, resolve it out of the service container:

```
$pipedrive = app()->make('pipedrive');
```

Or even inject it wherever you may need using the `Devio\Pipedrive\Pipedrive` signature.

Contribute
==========

[](#contribute)

Feel free to contribute via PR.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 83.2% 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 ~49 days

Recently: every ~145 days

Total

54

Last Release

1247d ago

Major Versions

0.3.3 → 1.0.02016-07-26

1.1.0 → 2.0.02018-10-03

1.2.0 → 2.0.32018-11-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26574748?v=4)[Kinow](/maintainers/kinow-io)[@kinow-io](https://github.com/kinow-io)

---

Top Contributors

[![IsraelOrtuno](https://avatars.githubusercontent.com/u/1769417?v=4)](https://github.com/IsraelOrtuno "IsraelOrtuno (163 commits)")[![JanMikes](https://avatars.githubusercontent.com/u/3995003?v=4)](https://github.com/JanMikes "JanMikes (8 commits)")[![daniti](https://avatars.githubusercontent.com/u/18900328?v=4)](https://github.com/daniti "daniti (7 commits)")[![3mg](https://avatars.githubusercontent.com/u/6938967?v=4)](https://github.com/3mg "3mg (5 commits)")[![joemugen](https://avatars.githubusercontent.com/u/14120614?v=4)](https://github.com/joemugen "joemugen (4 commits)")[![JordanKinow](https://avatars.githubusercontent.com/u/67052271?v=4)](https://github.com/JordanKinow "JordanKinow (4 commits)")[![hlagrid](https://avatars.githubusercontent.com/u/5960304?v=4)](https://github.com/hlagrid "hlagrid (2 commits)")[![bmarcinkowski](https://avatars.githubusercontent.com/u/15612449?v=4)](https://github.com/bmarcinkowski "bmarcinkowski (1 commits)")[![mauriciovander](https://avatars.githubusercontent.com/u/2056797?v=4)](https://github.com/mauriciovander "mauriciovander (1 commits)")[![mstralka](https://avatars.githubusercontent.com/u/439680?v=4)](https://github.com/mstralka "mstralka (1 commits)")

---

Tags

apiclientlaravelpipedrive

### Embed Badge

![Health badge](/badges/kinow-io-pipedrive-laravel-55/health.svg)

```
[![Health](https://phpackages.com/badges/kinow-io-pipedrive-laravel-55/health.svg)](https://phpackages.com/packages/kinow-io-pipedrive-laravel-55)
```

###  Alternatives

[devio/pipedrive

Complete Pipedrive API client for PHP and/or Laravel

1701.8M](/packages/devio-pipedrive)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[smodav/mpesa

M-Pesa API implementation

16467.9k1](/packages/smodav-mpesa)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

74331.3k1](/packages/mozex-anthropic-laravel)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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