PHPackages                             seravo/php-seravo-api - 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. seravo/php-seravo-api

ActiveLibrary[API Development](/categories/api)

seravo/php-seravo-api
=====================

PHP Library for Seravo API

v2.0.1(1w ago)002[4 issues](https://github.com/Seravo/php-seravo-api/issues)[1 PRs](https://github.com/Seravo/php-seravo-api/pulls)MITPHPPHP &gt;=8.2CI passing

Since Feb 5Pushed 1w ago3 watchersCompare

[ Source](https://github.com/Seravo/php-seravo-api)[ Packagist](https://packagist.org/packages/seravo/php-seravo-api)[ RSS](/packages/seravo-php-seravo-api/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (17)Versions (13)Used By (0)

[![](https://camo.githubusercontent.com/56337bccdffeb2175010250897f8c377c9030f8533204be885abe4c0537e2faa/68747470733a2f2f73657261766f2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032342f30362f73657261766f2d6c6f676f2d3531322e706e67)](https://camo.githubusercontent.com/56337bccdffeb2175010250897f8c377c9030f8533204be885abe4c0537e2faa/68747470733a2f2f73657261766f2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032342f30362f73657261766f2d6c6f676f2d3531322e706e67)

PHP Seravo API
==============

[](#php-seravo-api)

A simple, object-oriented wrapper for the Seravo API, written in PHP.

Getting Started
---------------

[](#getting-started)

API credentials are required to use the service. For more information and to request API credentials, please visit our [website](https://www.seravo.com) or contact  directly.

### Requirements

[](#requirements)

- PHP &gt;= 8.2
- PHP XML extension (php-xml)
- [ext-curl](https://www.php.net/manual/en/curl.installation.php) PHP cURL extension
- [ext-json](https://www.php.net/manual/en/json.installation.php) PHP JSON extension
- [ext-mbstring](https://www.php.net/manual/en/mbstring.installation.php) PHP Multibyte String extension

### Installation

[](#installation)

Clone the project:

**HTTPS**

```
git clone https://github.com/Seravo/php-seravo-api.git

```

**SSH**

```
git clone git@github.com:Seravo/php-seravo-api.git

```

Install composer dependencies:

```
composer install

```

The package uses PSR-4 autoloader for class autoloading. Activate autoloading by requiring the Composer autoloader *(Note the path to the vendor directory is relative to your project)*:

```
require 'vendor/autoload.php';

```

### Environment Variables

[](#environment-variables)

The following environment variables are required to be set before using the library:

- `SERAVO_API_CLIENT_ID`
- `SERAVO_API_SECRET`

Optionally, you may pass these environment variables as well:

- `SERAVO_ENVIRONMENT`
    - Defines the API environment (`testing`, `staging`, `production`) to be used. Defaults to `production` if omitted from `.env` and/or constructor.

These values must be set in the `/.env` file. See `.env.example`.

Basic Usage
-----------

[](#basic-usage)

See the [examples](https://github.com/Seravo/php-seravo-api/tree/main/examples) directory for more detailed information about how to use the library.

#### Initializing the Client

[](#initializing-the-client)

To initialize the `SeravoAPI` client, instantiate the class with valid credentials and authenticate:

```
