fw4/setle-api

PHP library for implementing the Setle API

v2.0.0 2023-03-06 15:04 UTC

This package is auto-updated.

Last update: 2024-05-08 16:30:42 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.