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

ActiveLibrary[API Development](/categories/api)

dolivroo/sdk
============

Official PHP SDK for Dolivroo Delivery API - Unified shipping API for Algeria

06PHP

Since Dec 22Pushed 4mo agoCompare

[ Source](https://github.com/Dolivroo/sdk-php)[ Packagist](https://packagist.org/packages/dolivroo/sdk)[ RSS](/packages/dolivroo-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Dolivroo PHP SDK
================

[](#dolivroo-php-sdk)

Official PHP SDK for the [Dolivroo](https://dolivroo.com) Delivery API - Unified shipping API for Algeria.

[![Latest Version](https://camo.githubusercontent.com/22d29e2e51d84bc7e5d857fbb4b9f5f34a3e896044ea68e531d820b2b81bbaa8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f6c6976726f6f2f73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dolivroo/sdk)[![License](https://camo.githubusercontent.com/59d24f4c12e86b090abbc0d67a1ac3181efd648e7a89255dc0bb7b85ff7784f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646f6c6976726f6f2f73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dolivroo/sdk)

Features
--------

[](#features)

- ✅ **Unified API** - Single interface for Yalidine, Ecotrack, ZR Express
- ✅ **Full CRUD** - Create, track, update, cancel parcels
- ✅ **Rate Comparison** - Compare shipping rates across providers
- ✅ **Bulk Operations** - Mass parcel creation with progress tracking
- ✅ **Label Generation** - Download shipping labels as PDF
- ✅ **Laravel Ready** - Service provider, facade, and config publishing
- ✅ **Fully Typed** - PHP 8.1+ with strict types and IDE autocompletion

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

[](#requirements)

- PHP 8.1 or higher
- Guzzle HTTP 7.0+

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

[](#installation)

```
composer require dolivroo/sdk
```

### Laravel Setup

[](#laravel-setup)

The SDK automatically registers itself via Laravel package discovery.

Publish the config file:

```
php artisan vendor:publish --tag=dolivroo-config
```

Add your API key to `.env`:

```
DOLIVROO_API_KEY=your-api-key-here
```

Quick Start
-----------

[](#quick-start)

### Standalone Usage

[](#standalone-usage)

```
use Dolivroo\Dolivroo;

$dolivroo = new Dolivroo('your-api-key');

// Create a parcel
$parcel = $dolivroo->parcels->create('yalidine', [
    'customer' => [
        'first_name' => 'Mohamed',
        'last_name' => 'Ali',
        'phone' => '0555000000',
        'address' => '123 Rue Test'
    ],
    'destination' => [
        'wilaya' => 'Alger',
        'commune' => 'Bab El Oued'
    ],
    'package' => [
        'products' => 'T-Shirt x2',
        'weight' => 1.5
    ],
    'payment' => [
        'amount' => 2500,
        'free_shipping' => false
    ],
    'options' => [
        'delivery_type' => 'home'
    ]
]);

echo $parcel['tracking_id']; // YAL123456
```

### Laravel Usage

[](#laravel-usage)

```
use Dolivroo\Laravel\Facades\Dolivroo;

// Using the facade
$parcel = Dolivroo::parcels->create('yalidine', [...]);

// Using dependency injection
public function ship(Dolivroo\Dolivroo $dolivroo)
{
    return $dolivroo->parcels->create('yalidine', [...]);
}
```

API Reference
-------------

[](#api-reference)

### Parcels

[](#parcels)

```
// Create a parcel
$dolivroo->parcels->create($companyCode, $order);

// Get parcel status
$dolivroo->parcels->get($companyCode, $trackingId);

// List all parcels
$dolivroo->parcels->list($companyCode, ['page' => 1]);

// Update a parcel
$dolivroo->parcels->update($companyCode, $trackingId, $order);

// Cancel a parcel
$dolivroo->parcels->cancel($companyCode, $trackingId);

// Get label (returns base64)
$dolivroo->parcels->label($companyCode, $trackingId);

// Download label as binary PDF
$pdf = $dolivroo->parcels->downloadLabel($companyCode, $trackingId);

// Save label to file
$dolivroo->parcels->saveLabel($companyCode, $trackingId, '/path/to/label.pdf');
```

### Rates

[](#rates)

```
// Get rates for a provider
$rates = $dolivroo->rates->get('Alger', 'Oran', 'yalidine');

// Compare all providers
$allRates = $dolivroo->rates->compare('Alger', 'Oran');

// Find cheapest option
$cheapest = $dolivroo->rates->findCheapest('Alger', 'Oran', 'home');
```

### Bulk Operations

[](#bulk-operations)

```
// Create bulk upload
$result = $dolivroo->bulk->create('yalidine', [
    [
        'recipient' => ['name' => 'Customer 1', 'phone' => '0555111111'],
        'destination' => ['wilaya_id' => 16, 'commune' => 'Bab El Oued'],
        'parcel' => ['products' => 'Item A', 'amount' => 2000]
    ],
    // ... more orders
], autoProcess: true);

// Check status
$status = $dolivroo->bulk->status($result['sheet_id']);

// Wait for completion (polls until done)
$final = $dolivroo->bulk->waitForCompletion($result['sheet_id']);

// Get detailed results
$results = $dolivroo->bulk->results($result['sheet_id']);
```

### Wilayas

[](#wilayas)

```
// List all wilayas
$wilayas = $dolivroo->wilayas->all();

// Find by name (fuzzy search)
$alger = $dolivroo->wilayas->find('Alger');

// Get by ID
$wilaya = $dolivroo->wilayas->get(16);

// Validate
if ($dolivroo->wilayas->isValid('Algr')) { // typo
    // false
}
```

### Centers (StopDesk)

[](#centers-stopdesk)

```
// Get centers in a wilaya
$centers = $dolivroo->centers->inWilaya(16, 'yalidine');
```

Error Handling
--------------

[](#error-handling)

```
use Dolivroo\Exceptions\DolivrooException;
use Dolivroo\Exceptions\ValidationException;
use Dolivroo\Exceptions\AuthenticationException;
use Dolivroo\Exceptions\RateLimitException;
use Dolivroo\Exceptions\NotFoundException;

try {
    $parcel = $dolivroo->parcels->create('yalidine', $order);
} catch (ValidationException $e) {
    // Handle validation errors
    $errors = $e->getErrors();
    if ($e->hasFieldError('customer.phone')) {
        echo "Invalid phone: " . implode(', ', $e->getFieldErrors('customer.phone'));
    }
} catch (AuthenticationException $e) {
    // Invalid API key
    echo "Auth failed: " . $e->getMessage();
} catch (RateLimitException $e) {
    // Too many requests
    sleep(60);
    // Retry...
} catch (NotFoundException $e) {
    // Parcel not found
} catch (DolivrooException $e) {
    // General error
    echo "Error: " . $e->getMessage();
}
```

Configuration Options
---------------------

[](#configuration-options)

```
$dolivroo = new Dolivroo('api-key', [
    'base_url' => 'https://custom-url.com/api/v1/unified',
    'timeout' => 60,       // Request timeout in seconds
    'verify_ssl' => false, // Disable SSL verification (dev only)
]);
```

Supported Providers
-------------------

[](#supported-providers)

ProviderCodeCreateTrackUpdateCancelLabelsYalidine`yalidine`✅✅✅✅✅Ecotrack`ecotrack`✅✅✅✅✅ZR Express`zr_express`✅✅❌❌❌Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

Support
-------

[](#support)

- 📧 Email:
- 📖 Docs:
- 🐛 Issues:

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance50

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7914a192dd163638229e77b7ac94cc4a121e6cd44414715bfbd7ee34535a3666?d=identicon)[aouniradouan](/maintainers/aouniradouan)

---

Top Contributors

[![aouniradouan](https://avatars.githubusercontent.com/u/20269102?v=4)](https://github.com/aouniradouan "aouniradouan (2 commits)")

---

Tags

algeriaalgerieapibaridimobdolivrooecotrackmaystrodeliverywilayasyalidineyaliteczrzrexpress

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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