Warning
This client library is not currently being supported by Duffel due to a lack of adoption.
You're welcome to fork the repositories and continue maintaining them for your own use.
If, in the future, there's sufficient demand for a particular client library, we'll reconsider our decision to officially support it.
A PHP library for the Duffel API.
- PHP >= 7.4
- A Duffel API access token (this quick start guide will help you to create one)
To get started, simply require this library using
Composer. You will also need to install packages
which provide
psr/http-client-implementation
and
psr/http-factory-implementation
.
An installation could look like the following command.
$ composer require "duffel/api:dev-main" "guzzlehttp/guzzle:^7.4" "http-interop/http-factory-guzzle:^1.2
A simple example of using this library (after successfully installing it) follows.
use Duffel\Client;
$client = new Duffel\Client();
$client->setAccessToken(getenv('DUFFEL_ACCESS_TOKEN'));
$client->airports->list();
See the examples/
directory for additional working examples.
Duffel's PHP API Client library is licensed under the MIT license.