PHPackages                             glorand/drip-php - 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. glorand/drip-php

ActivePackage[API Development](/categories/api)

glorand/drip-php
================

A PHP wrapper for Drip's REST API v2.0

1.0.4(7y ago)31221[1 issues](https://github.com/glorand/drip/issues)[1 PRs](https://github.com/glorand/drip/pulls)1MITPHPPHP ^7.1

Since Dec 4Pushed 5y ago2 watchersCompare

[ Source](https://github.com/glorand/drip)[ Packagist](https://packagist.org/packages/glorand/drip-php)[ RSS](/packages/glorand-drip-php/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (5)Dependencies (6)Versions (7)Used By (1)

[![](https://user-images.githubusercontent.com/883989/49755957-17ec0980-fcc2-11e8-9e04-0339714f979b.png)](https://user-images.githubusercontent.com/883989/49755957-17ec0980-fcc2-11e8-9e04-0339714f979b.png)

######  A PHP wrapper for Drip's REST API

[](#----a-php-wrapper-for-drips-rest-api)

 [ ![Latest Stable Version](https://camo.githubusercontent.com/dee8f488f4e83e3db736a5e454e7d0a86b05faae07a2bea478f4444be5f76422/68747470733a2f2f706f7365722e707567782e6f72672f676c6f72616e642f647269702d7068702f762f737461626c65) ](https://packagist.org/packages/glorand/drip-php) [ ![Build Status](https://camo.githubusercontent.com/557b68946a1c1de70f0612ee8fdf4de7e968176471e365bd683bedc0f2b284ac/68747470733a2f2f7472617669732d63692e636f6d2f676c6f72616e642f647269702e7376673f6272616e63683d6d6173746572) ](https://travis-ci.com/glorand/drip) [ ![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174) ](LICENSE.md) [ ![CodeFactor](https://camo.githubusercontent.com/f008409202ff7d5cc7493f1a6c4856f56c7ef54a94bf87d8c70447cf67fac3db/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f676c6f72616e642f647269702f62616467652f6d6173746572) ](https://www.codefactor.io/repository/github/glorand/drip/overview/master) [ ![StyleCI](https://camo.githubusercontent.com/7be19325f624ccf5130e3c6a8003bb0706e02172a33a60e6484acd6d968d59f6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136303333333133362f736869656c643f6272616e63683d6d6173746572) ](https://github.styleci.io/repos/160333136) [ ![Scrutinizer Code Quality](https://camo.githubusercontent.com/5d51d0399dd99e79a3ac592c62f1fce4f0e23dbab280076223333232014215e0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676c6f72616e642f647269702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572) ](https://scrutinizer-ci.com/g/glorand/drip/?branch=master) [ ![Code Coverage](https://camo.githubusercontent.com/d0e5d7404044f190b8be2970857988584986441e803bbc2bb00ea14f3dfbb687/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676c6f72616e642f647269702f6261646765732f636f7665726167652e706e673f623d6d6173746572) ](https://scrutinizer-ci.com/g/glorand/drip/?branch=master)

Drip PHP
========

[](#drip-php)

A PHP wrapper for Drip's REST API v2.0 for PHP 7.1+

Author: Gombos Lorand

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Current Features](#current_features)
    - [Instantiation](#instantiation)
    - [Api Response](#apiresponse)
    - [Accounts](#accounts)
    - [Events](#events)
    - [Subscribers](#subscribers)
    - [Batch Operations](#batch_operations)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [License](#license)

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

[](#installation-)

```
$ composer require glorand/drip-php

```

```
{
    "require": {
        "glorand/drip-php": "^1.0"
    }
}

```

Current Features
-------------------------------------------------------------

[](#current-features-)

### Instantiation

[](#instantiation-)

```
use Glorand\Drip\Drip;

$drip = new Drip('your-account-id', 'your-api-token', 'user-agent-optional');
```

### ApiResponse

[](#apiresponse-)

**Methods**

```
//http status code
public function getStatusCode(): int {}

public function isSuccess(): bool {}

public function getHttpMessage(): string {}

//drip response
public function getContents(): array {}
```

### Accounts

[](#accounts-)

**List all accounts**

```
$accounts = $drip->accounts()->list();

if($accounts->isSuccess()) {
    foreach($accounts->getContents() as $acount) {
        //
    }
}
```

**Fetch an account**

```
$account = $drip->accounts()->show('acount-id');

if($account->isSuccess()) {
    // $account->getContents()
}
```

### Events

[](#events-)

**Event Model**

```
$event = new Event();
$event->setEmail('test@email.com')
    ->setAction('Action')
    ->setOccurredAt(new \DateTime('2018-12-01'))
    ->setProperties(['prop_0' => 'val_prop_0'])
    ->addProperty('prop_1', 'val_prop_1')
    ->removeProperty('prop_1');
```

**Record an event**

```
/** Event Model */
$event = new Event();

/** boolean */
$drip->events()->store($event);
```

**List all custom events actions used in an account**

```
/** ApiResponse */
$events = $drip->events()->list();
```

### Subscribers

[](#subscribers-)

**Subscriber Model**

```
$subscriber = new Subscriber();
$subscriber->setEmail('test@email.com')
    ->setNewEmail('new@email.com')
    ->addCustomField('custom_f_1', 'val_custom_f_1')
    ->removeCustomField('custom_f_0')
    ->addTag('tag_1', 'val_tag_1')
    ->removeTag('tag_2')
```

**Create or update a subscriber**

```
/** Subscriber Model */
$subscriber = new Subscriber();

/** boolean */
$drip->subscribers()->store($subscriber);
```

**List all subscribers**

```
/** ApiResponse */
$events = $drip->subscribers()->list();
```

### Batch Operations

[](#batch-operations-)

**Create or update a batch of subscribers**

```
$testData = [
    [
        "email"     => "john@acme.com",
        "time_zone" => "America/Los_Angeles",
    ],
    (new Subscriber())->setEmail('joe@acme.com')->setTimeZone('America/Los_Angeles'),
];

/** boolean */
$drip->subscribers()->batchStore($testData);
```

**Unsubscribe a batch of subscribers**

```
$testData = [
    [
        "email"     => "john@acme.com",
    ],
    (new Subscriber())->setEmail('joe@acme.com'),
];

/** boolean */
$drip->subscribers()->batchUnsubscribe($testData);
```

**Record a batch of events**

```
$testData = [
    [
        "email"  => "john@acme.com",
        "action" => "Opened a door",
    ],
    (new Event())->setEmail('joe@acme.com')->setAction('Closed a door'),
];

/** boolean */
$drip->events()->batchStore($testData);
```

Changelog
-----------------------------------------------

[](#changelog-)

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

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

[](#contributing-)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------------------------------------------

[](#license-)

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

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~4 days

Total

5

Last Release

2703d ago

PHP version history (2 changes)1.0PHP ^7.0

1.0.1PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ace17e41000d3ff27464d894bed0066fba2f2dfe8c6179587b5b2307e7d31ec?d=identicon)[glorand](/maintainers/glorand)

---

Top Contributors

[![glorand](https://avatars.githubusercontent.com/u/883989?v=4)](https://github.com/glorand "glorand (45 commits)")

---

Tags

apidripdrip-apidrip-phpphpphp-wrapperrest-apigloranddrip-php

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/glorand-drip-php/health.svg)

```
[![Health](https://phpackages.com/badges/glorand-drip-php/health.svg)](https://phpackages.com/packages/glorand-drip-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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