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

ActiveLibrary[API Development](/categories/api)

coopcycle/coopcycle-php-sdk
===========================

v1.0.2(5y ago)440MITPHP

Since Mar 25Pushed 5y ago3 watchersCompare

[ Source](https://github.com/coopcycle/coopcycle-php-sdk)[ Packagist](https://packagist.org/packages/coopcycle/coopcycle-php-sdk)[ RSS](/packages/coopcycle-coopcycle-php-sdk/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

CoopCycle PHP SDK
=================

[](#coopcycle-php-sdk)

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

[](#installation)

The recommended way to install **coopcycle-php-sdk** is through [composer](http://getcomposer.org).

Run the following on the command line:

```
php composer require coopcycle/coopcycle-php-sdk

```

Usage
-----

[](#usage)

To instantiate the client, you will need a client id and a client secret.

```
use CoopCycle\Client;

$client = new Client([
    'base_uri'      => 'https://acme.coopcycle.org',
    'client_id'     => 'YourClientId',
    'client_secret' => 'YourClientSecret'
]);
```

### Creating deliveries

[](#creating-deliveries)

You can use the client to create deliveries.

```
$request = [
    'pickup' => [
        'address' => '50, Rue de Rivoli, Paris'
    ],
    'dropoff' => [
        'address' => '90, Rue de Rivoli, Paris',
        'before' => 'today 13:00'
    ],
];

$response = $client->deliveries->create($request);
```

### Creating webhooks

[](#creating-webhooks)

You can also use the client to subscribe to webhooks.

```
$data = [
    'event' => 'delivery.completed',
    'url' => 'https://coopcycle.org/webhook',
];

$response = $client->webhooks->create($data);
```

### Verifying webhooks signature

[](#verifying-webhooks-signature)

When you create a webhook, the response object will contain a `secret` property. Make sure to store this `secret` somewhere on your system, to later verify the signature.

```
{
    "@context":"/api/contexts/Webhook",
    "@id":"/api/webhooks/1",
    "@type":"Webhook",
    "url":"https://example.com/webhook",
    "event":"delivery.completed",
    "secret":"4mCOyJ7UAa371oUjYcC2R9BZRx5eQT08qTzLAnh4e8M="
}
```

When you receive a webhook on your endpoint, the `X-CoopCycle-Signature` header will contain a HMAC signature.

Here is an example Symfony controller:

```
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class WebhookHandler {

    public function __invoke(Request $request)
    {
        $payload = $request->getContent();
        $signature = $request->headers->get('X-CoopCycle-Signature');

        // You will probably restore the secret from your database instead
        $secret = "4mCOyJ7UAa371oUjYcC2R9BZRx5eQT08qTzLAnh4e8M=";

        if (!$client->webhooks->verifySignature($payload, $signature, $secret)) {
            return new Response('Invalid webhook signature', 400);
        }

        return new Response('OK', 200);
    }
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

3

Last Release

1872d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)
