fw4/setle-api

PHP library for implementing the Setle API

v2.1.0 2024-06-26 12:20 UTC

README

PHP client for the Setle API. For information and terms of use, refer to the official documentation.

Installation

composer require fw4/setle-api

Usage

use Setle\Setle;

// Instantiate the API using a client id and client secret
$api = new Setle('client-id-string', 'client-secret-string');

// Request a list of estates
$estates = $api->getEstates();
foreach ($estates as $estate) {
    echo $estate->estate->estate_type . ': ' . $estate->referral_link . PHP_EOL;
}

Access tokens

Access tokens are managed by the library, and long-running scripts will automatically trigger a refresh when a token expires. Due to the short lifespan of Setle's access tokens it is not recommended to manage tokens manually, but it is supported through the requestAccessToken() and setAccessToken() methods.

License

fw4/setle-api is licensed under the MIT License (MIT). Please see LICENSE for more information.