Getting Started


Install nxsys/library.client-brex with Composer.

composer require nxsys/library.client-brex

And please don’t forget

require_once 'vendor/autoload.php';

Getting a Token From Brex

For consumer accounts, you will need an API token from Brex. Instructions for getting that token can be found on Brex’s developer website:

Please ensure that you select the necessary amount of scopes for your application to function. This will also ensure that you mitigate information leakage and have fewer attack surfaces.

This library has no minimum scope requirements.

PSR-7 HTTP Client

This library allows you to keep the HTTP client library you may already be using in your application; it does this through service discovery. If you are not using an PSR-7 aware HTTP client, then you will need to install one.

Install the package below.

composer require symfony/http-client

We have tested this against Symfony’s Http Client which bundles a client and appropriate factories (nyholm/psr7).


If this is confusing please read and don’t hesitate to chat with us!

Calling the API

Calling this library is fairly straightforward. You can jump right in without requiring too much boilerplate. We like simplicity!

#if using composer use the autoloader
require 'vendor\autoload.php';

use NxSys\Library\Clients\Brex as BrexSdk;

$oSDK=new BrexSdk\SDKHost;

//Let's get company details to start
$oTeamClient=$oSDK->setAuthKey('BREX TOKEN') #consider using a token vault

/** @var BrexSdk\API\Team\Client */

//... OR
//if you will be doing work across the API, use the following convenience method

/** @var BrexSdk\API\Team\Model\CompanyResponse */

// ACME Corp, Inc.