PHPackages                             geniusreferrals/geniusreferrals - 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. geniusreferrals/geniusreferrals

ActiveLibrary[API Development](/categories/api)

geniusreferrals/geniusreferrals
===============================

This client allows you to implement referral programs using the Genius Referrals RESTful API.

v1.2(5y ago)09.6k—9.4%1MITPHPPHP &gt;=5.4.0

Since Feb 18Pushed 5y ago2 watchersCompare

[ Source](https://github.com/GeniusReferrals/Genius-Referrals-PHP)[ Packagist](https://packagist.org/packages/geniusreferrals/geniusreferrals)[ Docs](http://www.geniusreferrals.com)[ RSS](/packages/geniusreferrals-geniusreferrals/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

Getting started
===============

[](#getting-started)

How to Build
------------

[](#how-to-build)

The generated code has dependencies over external libraries like UniRest. These dependencies are defined in the `composer.json` file that comes with the SDK. To resolve these dependencies, we use the Composer package manager which requires PHP greater than 5.3.2 installed in your system. Visit  to download the installer file for Composer and run it in your system. Open command prompt and type `composer --version`. This should display the current version of the Composer installed if the installation was successful.

- Using command line, navigate to the directory containing the generated files (including `composer.json`) for the SDK.
- Run the command `composer install`. This should install all the required dependencies and create the `vendor` directory in your project directory.

[![Building SDK - Step 1](https://camo.githubusercontent.com/c7fd19f3407695ebcc39cb5bb00d84cfea20e2b9941940dc7b0f53ae3d7224b9/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d696e7374616c6c446570656e64656e6369657326776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/c7fd19f3407695ebcc39cb5bb00d84cfea20e2b9941940dc7b0f53ae3d7224b9/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d696e7374616c6c446570656e64656e6369657326776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

### \[For Windows Users Only\] Configuring CURL Certificate Path in php.ini

[](#for-windows-users-only-configuring-curl-certificate-path-in-phpini)

CURL used to include a list of accepted CAs, but no longer bundles ANY CA certs. So by default it will reject all SSL certificates as unverifiable. You will have to get your CA's cert and point curl at it. The steps are as follows:

1. Download the certificate bundle (.pem file) from  on to your system.
2. Add curl.cainfo = "PATH\_TO/cacert.pem" to your php.ini file located in your php installation. “PATH\_TO” must be an absolute path containing the .pem file.

```
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =
```

How to Intall on your Project via Composer
------------------------------------------

[](#how-to-intall-on-your-project-via-composer)

```
composer install geniusreferrals/geniusreferrals

```

How to Use
----------

[](#how-to-use)

The following section explains how to use the GeniusReferrals library in a new project.

### 1. Open Project in an IDE

[](#1-open-project-in-an-ide)

Open an IDE for PHP like PhpStorm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.

[![Open project in PHPStorm - Step 1](https://camo.githubusercontent.com/61bd9f648ff11f53e0a0c6f3d68920964afc3619915e9e9eb8dca7146e59efa4/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6f70656e49444526776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/61bd9f648ff11f53e0a0c6f3d68920964afc3619915e9e9eb8dca7146e59efa4/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6f70656e49444526776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

Click on `Open` in PhpStorm to browse to your generated SDK directory and then click `OK`.

[![Open project in PHPStorm - Step 2](https://camo.githubusercontent.com/17422ed35f2f5523a85a4a056dceb4ae88273f315252b6d53faebef5c8462c26/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6f70656e50726f6a6563743026776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/17422ed35f2f5523a85a4a056dceb4ae88273f315252b6d53faebef5c8462c26/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6f70656e50726f6a6563743026776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

### 2. Add a new Test Project

[](#2-add-a-new-test-project)

Create a new directory by right clicking on the solution name as shown below:

[![Add a new project in PHPStorm - Step 1](https://camo.githubusercontent.com/8709c86fe19875be52a767331f5dd4870efa974f2e9f10d5a635e2e276fd9fc6/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6372656174654469726563746f727926776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/8709c86fe19875be52a767331f5dd4870efa974f2e9f10d5a635e2e276fd9fc6/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6372656174654469726563746f727926776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

Name the directory as "test"

[![Add a new project in PHPStorm - Step 2](https://camo.githubusercontent.com/001df3b22c9ab3a2f883e4b58d3600163297d1c4234489e65e047aa7bdb29c0d/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6e616d654469726563746f727926776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/001df3b22c9ab3a2f883e4b58d3600163297d1c4234489e65e047aa7bdb29c0d/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6e616d654469726563746f727926776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

Add a PHP file to this project

[![Add a new project in PHPStorm - Step 3](https://camo.githubusercontent.com/1171ffa821bc1c40ba20a4f2881d451fd3c123fdee8d3c990a50bfe15cae5e70/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d63726561746546696c6526776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/1171ffa821bc1c40ba20a4f2881d451fd3c123fdee8d3c990a50bfe15cae5e70/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d63726561746546696c6526776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

Name it "testSDK"

[![Add a new project in PHPStorm - Step 4](https://camo.githubusercontent.com/dbcc5fc9979a1d6168971ed9c0a2901d4868b69256d248d6e7f2d063c43ee8e5/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6e616d6546696c6526776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/dbcc5fc9979a1d6168971ed9c0a2901d4868b69256d248d6e7f2d063c43ee8e5/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6e616d6546696c6526776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

Depending on your project setup, you might need to include composer's autoloader in your PHP code to enable auto loading of classes.

```
require_once "../vendor/autoload.php";
```

It is important that the path inside require\_once correctly points to the file `autoload.php` inside the vendor directory created during dependency installations.

[![Add a new project in PHPStorm - Step 4](https://camo.githubusercontent.com/34d3f6c25373411a469dda3aeead621e0e8bcad422d48ac55a793104c75f871c/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d70726f6a65637446696c657326776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/34d3f6c25373411a469dda3aeead621e0e8bcad422d48ac55a793104c75f871c/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d70726f6a65637446696c657326776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

After this you can add code to initialize the client library and acquire the instance of a Controller class. Sample code to initialize the client library and using controller methods is given in the subsequent sections.

### 3. Run the Test Project

[](#3-run-the-test-project)

To run your project you must set the Interpreter for your project. Interpreter is the PHP engine installed on your computer.

Open `Settings` from `File` menu.

[![Run Test Project - Step 1](https://camo.githubusercontent.com/f99806260e2f204fa825fae373d95d7c92c25e25f7a56dc1fc0b8997962ad8f1/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6f70656e53657474696e677326776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/f99806260e2f204fa825fae373d95d7c92c25e25f7a56dc1fc0b8997962ad8f1/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d6f70656e53657474696e677326776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

Select `PHP` from within `Languages & Frameworks`

[![Run Test Project - Step 2](https://camo.githubusercontent.com/c7597040f529be581bc6bb527757b13ca75dd45f3d884a7e5682eca665879882/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d736574496e7465727072657465723026776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/c7597040f529be581bc6bb527757b13ca75dd45f3d884a7e5682eca665879882/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d736574496e7465727072657465723026776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

Browse for Interpreters near the `Interpreter` option and choose your interpreter.

[![Run Test Project - Step 3](https://camo.githubusercontent.com/d529cdb8d06e19968f7adb41a083df7b5f5da3e0788b6d20c9c08b633c5ab7ed/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d736574496e7465727072657465723126776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/d529cdb8d06e19968f7adb41a083df7b5f5da3e0788b6d20c9c08b633c5ab7ed/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d736574496e7465727072657465723126776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

Once the interpreter is selected, click `OK`

[![Run Test Project - Step 4](https://camo.githubusercontent.com/0e1ae5f7db014e54f25b399ab774897a5e35dca6be698d4ece3f5afab83974e5/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d736574496e7465727072657465723226776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/0e1ae5f7db014e54f25b399ab774897a5e35dca6be698d4ece3f5afab83974e5/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d736574496e7465727072657465723226776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

To run your project, right click on your PHP file inside your Test project and click on `Run`

[![Run Test Project - Step 5](https://camo.githubusercontent.com/2ffb3aef38d2b8c22ae21697adeef4a0f47bcc364f4124690d6ccd38c1f40b30/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d72756e50726f6a65637426776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)](https://camo.githubusercontent.com/2ffb3aef38d2b8c22ae21697adeef4a0f47bcc364f4124690d6ccd38c1f40b30/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f737465703d72756e50726f6a65637426776f726b7370616365466f6c6465723d47656e697573253230526566657272616c732d504850)

How to Test
-----------

[](#how-to-test)

Unit tests in this SDK can be run using PHPUnit.

1. First install the dependencies using composer including the `require-dev` dependencies.
2. Run `vendor\bin\phpunit --verbose` from commandline to execute tests. If you have installed PHPUnit globally, run tests using `phpunit --verbose` instead.

You can change the PHPUnit test configuration in the `phpunit.xml` file.

Initialization
--------------

[](#initialization)

### Authentication

[](#authentication)

In order to setup authentication and initialization of the API client, you need the following information.

ParameterDescriptioncontentTypeThe content typexAuthTokenYour API Token, you can get your token here API client can be initialized as following.

```
// Configuration parameters and credentials
$contentType = "application/json"; // The content type
$xAuthToken = "3b9d11374b602fb47b987dff90f1c5940a1f377f"; // Your API Token, you can get your token here https://www.geniusreferrals.com/en/settings/api-access

$client = new GeniusReferralsLib\GeniusReferralsClient($contentType, $xAuthToken);
```

Class Reference
---------------

[](#class-reference)

### List of Controllers

[](#list-of-controllers)

- [RootsController](#roots_controller)
- [AuthenticationsController](#authentications_controller)
- [AdvocatesController](#advocates_controller)
- [AccountsController](#accounts_controller)
- [ReportsController](#reports_controller)
- [ReferralsController](#referrals_controller)
- [RedemptionRequestsController](#redemption_requests_controller)
- [BonusesController](#bonuses_controller)
- [CampaignsController](#campaigns_controller)

### [![Class: ](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67 ".RootsController")](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67) RootsController

[](#-rootscontroller)

#### Get singleton instance

[](#get-singleton-instance)

The singleton instance of the `RootsController` class can be accessed from the API Client.

```
$roots = $client->getRoots();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".RootsController.getRoot")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getRoot

[](#-getroot)

> The root of the API

```
function getRoot()
```

#### Example Usage

[](#example-usage)

```
$result = $roots->getRoot();
```

[Back to List of Controllers](#list_of_controllers)

### [![Class: ](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67 ".AuthenticationsController")](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67) AuthenticationsController

[](#-authenticationscontroller)

#### Get singleton instance

[](#get-singleton-instance-1)

The singleton instance of the `AuthenticationsController` class can be accessed from the API Client.

```
$authentications = $client->getAuthentications();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AuthenticationsController.getAuthentication")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getAuthentication

[](#-getauthentication)

> Allow clients to test authentication on Genius Referrals platform.

```
function getAuthentication()
```

#### Example Usage

[](#example-usage-1)

```
$result = $authentications->getAuthentication();
```

[Back to List of Controllers](#list_of_controllers)

### [![Class: ](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67 ".AdvocatesController")](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67) AdvocatesController

[](#-advocatescontroller)

#### Get singleton instance

[](#get-singleton-instance-2)

The singleton instance of the `AdvocatesController` class can be accessed from the API Client.

```
$advocates = $client->getAdvocates();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.deleteAdvocate")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) deleteAdvocate

[](#-deleteadvocate)

> Delete an advocate

```
function deleteAdvocate(
        $accountSlug,
        $advocateToken)
```

#### Parameters

[](#parameters)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's token#### Example Usage

[](#example-usage-2)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';

$advocates->deleteAdvocate($accountSlug, $advocateToken);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.putAdvocate")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) putAdvocate

[](#-putadvocate)

> Update an advocate.

```
function putAdvocate(
        $accountSlug,
        $advocateToken,
        $advocateForm)
```

#### Parameters

[](#parameters-1)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's tokenadvocateForm`Required`The body of the request#### Example Usage

[](#example-usage-3)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$advocateForm = new AdvocateForm();

$advocates->putAdvocate($accountSlug, $advocateToken, $advocateForm);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.postAdvocate")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) postAdvocate

[](#-postadvocate)

> Create a new advocate.

```
function postAdvocate(
        $accountSlug,
        $advocateForm)
```

#### Parameters

[](#parameters-2)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateForm`Required`The body of the request#### Example Usage

[](#example-usage-4)

```
$accountSlug = 'account_slug';
$advocateForm = new AdvocateForm();

$result = $advocates->postAdvocate($accountSlug, $advocateForm);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.getAdvocate")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getAdvocate

[](#-getadvocate)

> Get an advocate by a given token.

```
function getAdvocate(
        $accountSlug,
        $advocateToken)
```

#### Parameters

[](#parameters-3)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's token#### Example Usage

[](#example-usage-5)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';

$result = $advocates->getAdvocate($accountSlug, $advocateToken);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.deleteAdvocates")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) deleteAdvocates

[](#-deleteadvocates)

> Delete all advocates

```
function deleteAdvocates($accountSlug)
```

#### Parameters

[](#parameters-4)

ParameterTagsDescriptionaccountSlug`Required`The account identifier#### Example Usage

[](#example-usage-6)

```
$accountSlug = 'account_slug';

$advocates->deleteAdvocates($accountSlug);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.getAdvocates")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getAdvocates

[](#-getadvocates)

> Get the list of advocates

```
function getAdvocates(
        $accountSlug,
        $page = 1,
        $limit = 10,
        $filter = null,
        $sort = null)
```

#### Parameters

[](#parameters-5)

ParameterTagsDescriptionaccountSlug`Required`The account identifierpage`Optional` `DefaultValue`Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.limit`Optional` `DefaultValue`Maximum number of results to return in the response. Default (10), threshold (100)filter`Optional`Allowed fields: name, lastname, email, advocate\_token, bonus\_exchange\_method\_slug, campaign\_slug, can\_refer, is\_referral, from, to, created. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: [www.example.com/users?filter='name::todd|city::denver|title::grand](http://www.example.com/users?filter='name::todd%7Ccity::denver%7Ctitle::grand) poobah'sort`Optional`Allowed fields: name, lastname, email, created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this [www.example.com/users?sort='last\_name|first\_name|-hire\_date](http://www.example.com/users?sort='last_name%7Cfirst_name%7C-hire_date)'#### Example Usage

[](#example-usage-7)

```
$accountSlug = 'account_slug';
$page = 1;
$limit = 10;
$filter = 'filter';
$sort = 'sort';

$result = $advocates->getAdvocates($accountSlug, $page, $limit, $filter, $sort);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.patchAdvocate")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) patchAdvocate

[](#-patchadvocate)

> Update partial elements of an advocate.

```
function patchAdvocate(
        $accountSlug,
        $advocateToken,
        $advocatePatchForm)
```

#### Parameters

[](#parameters-6)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's tokenadvocatePatchForm`Required` `Collection`The body of the request#### Example Usage

[](#example-usage-8)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$advocatePatchForm = new AdvocatePatchForm();

$result = $advocates->patchAdvocate($accountSlug, $advocateToken, $advocatePatchForm);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.getShareLinks")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getShareLinks

[](#-getsharelinks)

> Get the advocates share links. These are the links that advocates use to share your services online. Share links are wrapped per campaign and widget package.

```
function getShareLinks(
        $accountSlug,
        $advocateToken)
```

#### Parameters

[](#parameters-7)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's token#### Example Usage

[](#example-usage-9)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';

$result = $advocates->getShareLinks($accountSlug, $advocateToken);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.putPaymentMethod")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) putPaymentMethod

[](#-putpaymentmethod)

> Update a payment method.

```
function putPaymentMethod(
        $accountSlug,
        $advocateToken,
        $advocatePaymentMethodId,
        $advocatePaymentMethodForm)
```

#### Parameters

[](#parameters-8)

ParameterTagsDescriptionaccountSlug`Required`The advocate's tokenadvocateToken`Required`The advocate's tokenadvocatePaymentMethodId`Required`The payment method's identifieradvocatePaymentMethodForm`Required`The body of the request#### Example Usage

[](#example-usage-10)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$advocatePaymentMethodId = 147;
$advocatePaymentMethodForm = new PaymentMethodForm();

$advocates->putPaymentMethod($accountSlug, $advocateToken, $advocatePaymentMethodId, $advocatePaymentMethodForm);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.getPaymentMethod")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getPaymentMethod

[](#-getpaymentmethod)

> Get an advocate's payment method

```
function getPaymentMethod(
        $accountSlug,
        $advocateToken,
        $advocatePaymentMethodId)
```

#### Parameters

[](#parameters-9)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's tokenadvocatePaymentMethodId`Required`The payment method's identifier#### Example Usage

[](#example-usage-11)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$advocatePaymentMethodId = 147;

$result = $advocates->getPaymentMethod($accountSlug, $advocateToken, $advocatePaymentMethodId);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.postPaymentMethod")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) postPaymentMethod

[](#-postpaymentmethod)

> Create a new payment method.

```
function postPaymentMethod(
        $accountSlug,
        $advocateToken,
        $advocatePaymentMethodForm)
```

#### Parameters

[](#parameters-10)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's tokenadvocatePaymentMethodForm`Required`The body of the request#### Example Usage

[](#example-usage-12)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$advocatePaymentMethodForm = new PaymentMethodForm();

$result = $advocates->postPaymentMethod($accountSlug, $advocateToken, $advocatePaymentMethodForm);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.getBonusRedemptionMethod")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getBonusRedemptionMethod

[](#-getbonusredemptionmethod)

> Get bonuses redemption method.

```
function getBonusRedemptionMethod($bonusesRedemptionMethodSlug)
```

#### Parameters

[](#parameters-11)

ParameterTagsDescriptionbonusesRedemptionMethodSlug`Required`The bonus redemption method's identifier#### Example Usage

[](#example-usage-13)

```
$bonusesRedemptionMethodSlug = 'bonuses_redemption_method_slug';

$result = $advocates->getBonusRedemptionMethod($bonusesRedemptionMethodSlug);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.getBonusRedemptionMethods")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getBonusRedemptionMethods

[](#-getbonusredemptionmethods)

> Get bonuses redemption methods.

```
function getBonusRedemptionMethods()
```

#### Example Usage

[](#example-usage-14)

```
$result = $advocates->getBonusRedemptionMethods();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.getCurrencies")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getCurrencies

[](#-getcurrencies)

> Get currencies.

```
function getCurrencies()
```

#### Example Usage

[](#example-usage-15)

```
$result = $advocates->getCurrencies();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.getCurrency")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getCurrency

[](#-getcurrency)

> Get a currency.

```
function getCurrency($code)
```

#### Parameters

[](#parameters-12)

ParameterTagsDescriptioncode`Required`The currency's code#### Example Usage

[](#example-usage-16)

```
$code = 'code';

$result = $advocates->getCurrency($code);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AdvocatesController.getPaymentMethods")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getPaymentMethods

[](#-getpaymentmethods)

> Get the advocate's payment methods.

```
function getPaymentMethods(
        $accountSlug,
        $advocateToken,
        $page = 1,
        $limit = 10,
        $filter = null,
        $sort = null)
```

#### Parameters

[](#parameters-13)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's tokenpage`Optional` `DefaultValue`Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.limit`Optional` `DefaultValue`Maximum number of results to return in the response. Default (10), threshold (100)filter`Optional`Allowed fields: username, is\_active. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: [www.example.com/users?filter='name::todd|city::denver|title::grand](http://www.example.com/users?filter='name::todd%7Ccity::denver%7Ctitle::grand) poobah'sort`Optional`Allowed fields: username, created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this [www.example.com/users?sort=last\_name|first\_name|-hire\_date](http://www.example.com/users?sort=last_name%7Cfirst_name%7C-hire_date)#### Example Usage

[](#example-usage-17)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$page = 1;
$limit = 10;
$filter = 'filter';
$sort = 'sort';

$result = $advocates->getPaymentMethods($accountSlug, $advocateToken, $page, $limit, $filter, $sort);
```

[Back to List of Controllers](#list_of_controllers)

### [![Class: ](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67 ".AccountsController")](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67) AccountsController

[](#-accountscontroller)

#### Get singleton instance

[](#get-singleton-instance-3)

The singleton instance of the `AccountsController` class can be accessed from the API Client.

```
$accounts = $client->getAccounts();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AccountsController.getAccount")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getAccount

[](#-getaccount)

> Get an account by a given slug.

```
function getAccount($accountSlug)
```

#### Parameters

[](#parameters-14)

ParameterTagsDescriptionaccountSlug`Required`The account identifier#### Example Usage

[](#example-usage-18)

```
$accountSlug = 'account_slug';

$result = $accounts->getAccount($accountSlug);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".AccountsController.getAccounts")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getAccounts

[](#-getaccounts)

> Get the list of accounts.

```
function getAccounts(
        $page = 1,
        $limit = 10,
        $filter = null,
        $sort = null)
```

#### Parameters

[](#parameters-15)

ParameterTagsDescriptionpage`Optional` `DefaultValue`Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.limit`Optional` `DefaultValue`Maximum number of results to return in the response. Default (10), threshold (100)filter`Optional`Allowed fields: name. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: [www.example.com/users?filter='name::todd|city::denver|title::grand](http://www.example.com/users?filter='name::todd%7Ccity::denver%7Ctitle::grand) poobah'sort`Optional`Allowed fields: name, created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this [www.example.com/users?sort=last\_name|first\_name|-hire\_date](http://www.example.com/users?sort=last_name%7Cfirst_name%7C-hire_date)#### Example Usage

[](#example-usage-19)

```
$page = 1;
$limit = 10;
$filter = 'filter';
$sort = 'sort';

$result = $accounts->getAccounts($page, $limit, $filter, $sort);
```

[Back to List of Controllers](#list_of_controllers)

### [![Class: ](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67 ".ReportsController")](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67) ReportsController

[](#-reportscontroller)

#### Get singleton instance

[](#get-singleton-instance-4)

The singleton instance of the `ReportsController` class can be accessed from the API Client.

```
$reports = $client->getReports();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReportsController.getReferralsSummaryPerOrigin")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getReferralsSummaryPerOrigin

[](#-getreferralssummaryperorigin)

> Get referrals summary per referral origin.

```
function getReferralsSummaryPerOrigin($advocateToken)
```

#### Parameters

[](#parameters-16)

ParameterTagsDescriptionadvocateToken`Required`The advocate's token#### Example Usage

[](#example-usage-20)

```
$advocateToken = 'advocate_token';

$result = $reports->getReferralsSummaryPerOrigin($advocateToken);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReportsController.getBonusesSummaryPerOrigin")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getBonusesSummaryPerOrigin

[](#-getbonusessummaryperorigin)

> Get bonuses summary per referral origin.

```
function getBonusesSummaryPerOrigin($advocateToken)
```

#### Parameters

[](#parameters-17)

ParameterTagsDescriptionadvocateToken`Required`The advocate's token#### Example Usage

[](#example-usage-21)

```
$advocateToken = 'advocate_token';

$result = $reports->getBonusesSummaryPerOrigin($advocateToken);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReportsController.getTopAdvocates")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getTopAdvocates

[](#-gettopadvocates)

> Get top 10 advocates.

```
function getTopAdvocates(
        $accountSlug = null,
        $campaignSlug = null,
        $limit = 10,
        $from = null,
        $to = null)
```

#### Parameters

[](#parameters-18)

ParameterTagsDescriptionaccountSlug`Optional`The account identifiercampaignSlug`Optional`The campaign identifierlimit`Optional` `DefaultValue`Maximum number of results to return in the response. Default (10)from`Optional`The datetime were the range of the search startsto`Optional`The datetime were the range of the search stops#### Example Usage

[](#example-usage-22)

```
$accountSlug = 'account_slug';
$campaignSlug = 'campaign_slug';
$limit = 10;
$from = date("D M d, Y G:i");
$to = date("D M d, Y G:i");

$result = $reports->getTopAdvocates($accountSlug, $campaignSlug, $limit, $from, $to);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReportsController.getShareDailyParticipation")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getShareDailyParticipation

[](#-getsharedailyparticipation)

> Get share daily participation.

```
function getShareDailyParticipation(
        $accountSlug = null,
        $campaignSlug = null,
        $advocateToken = null,
        $from = null,
        $to = null)
```

#### Parameters

[](#parameters-19)

ParameterTagsDescriptionaccountSlug`Optional`The account identifiercampaignSlug`Optional`The campaign identifieradvocateToken`Optional`The advocate's tokenfrom`Optional`The datetime were the range of the search startsto`Optional`The datetime were the range of the search stops#### Example Usage

[](#example-usage-23)

```
$accountSlug = 'account_slug';
$campaignSlug = 'campaign_slug';
$advocateToken = 'advocate_token';
$from = date("D M d, Y G:i");
$to = date("D M d, Y G:i");

$result = $reports->getShareDailyParticipation($accountSlug, $campaignSlug, $advocateToken, $from, $to);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReportsController.getReferralDailyParticipation")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getReferralDailyParticipation

[](#-getreferraldailyparticipation)

> Get referral daily participation.

```
function getReferralDailyParticipation(
        $accountSlug = null,
        $campaignSlug = null,
        $advocateToken = null,
        $from = null,
        $to = null)
```

#### Parameters

[](#parameters-20)

ParameterTagsDescriptionaccountSlug`Optional`The account identifiercampaignSlug`Optional`The campaign identifieradvocateToken`Optional`The advocate's tokenfrom`Optional`The datetime were the range of the search startsto`Optional`The datetime were the range of the search stops#### Example Usage

[](#example-usage-24)

```
$accountSlug = 'account_slug';
$campaignSlug = 'campaign_slug';
$advocateToken = 'advocate_token';
$from = date("D M d, Y G:i");
$to = date("D M d, Y G:i");

$result = $reports->getReferralDailyParticipation($accountSlug, $campaignSlug, $advocateToken, $from, $to);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReportsController.getClickDailyParticipation")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getClickDailyParticipation

[](#-getclickdailyparticipation)

> Get click daily participation.

```
function getClickDailyParticipation(
        $accountSlug = null,
        $campaignSlug = null,
        $advocateToken = null,
        $from = null,
        $to = null)
```

#### Parameters

[](#parameters-21)

ParameterTagsDescriptionaccountSlug`Optional`The account identifiercampaignSlug`Optional`The campaign identifieradvocateToken`Optional`The advocate's tokenfrom`Optional`The datetime were the range of the search startsto`Optional`The datetime were the range of the search stops#### Example Usage

[](#example-usage-25)

```
$accountSlug = 'account_slug';
$campaignSlug = 'campaign_slug';
$advocateToken = 'advocate_token';
$from = date("D M d, Y G:i");
$to = date("D M d, Y G:i");

$result = $reports->getClickDailyParticipation($accountSlug, $campaignSlug, $advocateToken, $from, $to);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReportsController.getBonusesDailyGiven")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getBonusesDailyGiven

[](#-getbonusesdailygiven)

> Get bonuses daily given.

```
function getBonusesDailyGiven(
        $accountSlug = null,
        $campaignSlug = null,
        $advocateToken = null,
        $from = null,
        $to = null)
```

#### Parameters

[](#parameters-22)

ParameterTagsDescriptionaccountSlug`Optional`The account identifiercampaignSlug`Optional`The campaign identifieradvocateToken`Optional`The advocate identifierfrom`Optional`The datetime were the range of the search startsto`Optional`The datetime were the range of the search stops#### Example Usage

[](#example-usage-26)

```
$accountSlug = 'account_slug';
$campaignSlug = 'campaign_slug';
$advocateToken = 'advocate_token';
$from = date("D M d, Y G:i");
$to = date("D M d, Y G:i");

$result = $reports->getBonusesDailyGiven($accountSlug, $campaignSlug, $advocateToken, $from, $to);
```

[Back to List of Controllers](#list_of_controllers)

### [![Class: ](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67 ".ReferralsController")](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67) ReferralsController

[](#-referralscontroller)

#### Get singleton instance

[](#get-singleton-instance-5)

The singleton instance of the `ReferralsController` class can be accessed from the API Client.

```
$referrals = $client->getReferrals();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReferralsController.getReferralOrigin")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getReferralOrigin

[](#-getreferralorigin)

> Get a referral origin by a given slug.

```
function getReferralOrigin($referralOriginSlug)
```

#### Parameters

[](#parameters-23)

ParameterTagsDescriptionreferralOriginSlug`Required`The referral origin identifier#### Example Usage

[](#example-usage-27)

```
$referralOriginSlug = 'referral_origin_slug';

$result = $referrals->getReferralOrigin($referralOriginSlug);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReferralsController.getReferralOrigins")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getReferralOrigins

[](#-getreferralorigins)

> Get referral origins. This is needed when creating (POST) a new referral, as referral\_origin\_slug refers to one of this origins.

```
function getReferralOrigins()
```

#### Example Usage

[](#example-usage-28)

```
$result = $referrals->getReferralOrigins();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReferralsController.getReferral")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getReferral

[](#-getreferral)

> Get a referral by a given id.

```
function getReferral(
        $accountSlug,
        $advocateToken,
        $referralId)
```

#### Parameters

[](#parameters-24)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's tokenreferralId`Required`The referral id#### Example Usage

[](#example-usage-29)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$referralId = 'referral_id';

$result = $referrals->getReferral($accountSlug, $advocateToken, $referralId);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReferralsController.deleteReferral")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) deleteReferral

[](#-deletereferral)

> Delete a referral.

```
function deleteReferral(
        $accountSlug,
        $advocateToken,
        $referralId)
```

#### Parameters

[](#parameters-25)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's tokenreferralId`Required`The referral identifier#### Example Usage

[](#example-usage-30)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$referralId = 'referral_id';

$referrals->deleteReferral($accountSlug, $advocateToken, $referralId);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReferralsController.postReferral")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) postReferral

[](#-postreferral)

> Create a new referral.

```
function postReferral(
        $accountSlug,
        $advocateToken,
        $referralForm)
```

#### Parameters

[](#parameters-26)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's tokenreferralForm`Required`The body of the request#### Example Usage

[](#example-usage-31)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$referralForm = new ReferralForm();

$result = $referrals->postReferral($accountSlug, $advocateToken, $referralForm);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReferralsController.putReferral")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) putReferral

[](#-putreferral)

> Update a referral.

```
function putReferral(
        $accountSlug,
        $advocateToken,
        $referralId,
        $referralForm)
```

#### Parameters

[](#parameters-27)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's tokenreferralId`Required`The referral idreferralForm`Required`The body of the request#### Example Usage

[](#example-usage-32)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$referralId = 'referral_id';
$referralForm = new ReferralForm();

$referrals->putReferral($accountSlug, $advocateToken, $referralId, $referralForm);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".ReferralsController.getReferrals")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getReferrals

[](#-getreferrals)

> Get the list of referrals for a given advocate.

```
function getReferrals(
        $accountSlug,
        $advocateToken,
        $page = 1,
        $limit = 10,
        $filter = null,
        $sort = null)
```

#### Parameters

[](#parameters-28)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The advocate's tokenpage`Optional` `DefaultValue`Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.limit`Optional` `DefaultValue`Maximum number of results to return in the response. Default (10), threshold (100)filter`Optional`Allowed fields: url, referral\_origin\_slug, created. Use the following delimiters to build your filters params. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: [www.example.com/users?filter='name::todd|city::denver|title::grand](http://www.example.com/users?filter='name::todd%7Ccity::denver%7Ctitle::grand) poobah'sort`Optional`Allowed fields: created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this [www.example.com/users?sort='last\_name|first\_name|-hire\_date](http://www.example.com/users?sort='last_name%7Cfirst_name%7C-hire_date)'#### Example Usage

[](#example-usage-33)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$page = 1;
$limit = 10;
$filter = 'filter';
$sort = 'sort';

$result = $referrals->getReferrals($accountSlug, $advocateToken, $page, $limit, $filter, $sort);
```

[Back to List of Controllers](#list_of_controllers)

### [![Class: ](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67 ".RedemptionRequestsController")](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67) RedemptionRequestsController

[](#-redemptionrequestscontroller)

#### Get singleton instance

[](#get-singleton-instance-6)

The singleton instance of the `RedemptionRequestsController` class can be accessed from the API Client.

```
$redemptionRequests = $client->getRedemptionRequests();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".RedemptionRequestsController.getRedemptionRequestStatus")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getRedemptionRequestStatus

[](#-getredemptionrequeststatus)

> Get a redemption request status.

```
function getRedemptionRequestStatus($redemptionRequestStatusSlug)
```

#### Parameters

[](#parameters-29)

ParameterTagsDescriptionredemptionRequestStatusSlug`Required`The redemption request status identifier#### Example Usage

[](#example-usage-34)

```
$redemptionRequestStatusSlug = 'redemption_request_status_slug';

$result = $redemptionRequests->getRedemptionRequestStatus($redemptionRequestStatusSlug);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".RedemptionRequestsController.getRedemptionRequestStatuses")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getRedemptionRequestStatuses

[](#-getredemptionrequeststatuses)

> Get redemption request statuses.

```
function getRedemptionRequestStatuses()
```

#### Example Usage

[](#example-usage-35)

```
$result = $redemptionRequests->getRedemptionRequestStatuses();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".RedemptionRequestsController.getRedemptionRequestAction")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getRedemptionRequestAction

[](#-getredemptionrequestaction)

> Get a redemption request action.

```
function getRedemptionRequestAction($redemptionRequestActionSlug)
```

#### Parameters

[](#parameters-30)

ParameterTagsDescriptionredemptionRequestActionSlug`Required`The redemption request action identifier#### Example Usage

[](#example-usage-36)

```
$redemptionRequestActionSlug = 'redemption_request_action_slug';

$result = $redemptionRequests->getRedemptionRequestAction($redemptionRequestActionSlug);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".RedemptionRequestsController.getRedemptionRequestActions")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getRedemptionRequestActions

[](#-getredemptionrequestactions)

> Get redemption request actions.

```
function getRedemptionRequestActions()
```

#### Example Usage

[](#example-usage-37)

```
$result = $redemptionRequests->getRedemptionRequestActions();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".RedemptionRequestsController.patchRedemptionRequest")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) patchRedemptionRequest

[](#-patchredemptionrequest)

> Redeem a redemption request. After the redemption request is created it needs to be redeemed. This will deduct the amount of the advocate unclaimed balance and move the request to the completed state.

```
function patchRedemptionRequest(
        $accountSlug,
        $redemptionRequestId)
```

#### Parameters

[](#parameters-31)

ParameterTagsDescriptionaccountSlug`Required`The account identifierredemptionRequestId`Required`The redemption request id#### Example Usage

[](#example-usage-38)

```
$accountSlug = 'account_slug';
$redemptionRequestId = 147;

$redemptionRequests->patchRedemptionRequest($accountSlug, $redemptionRequestId);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".RedemptionRequestsController.postRedemptionRequest")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) postRedemptionRequest

[](#-postredemptionrequest)

> Create a redemption request.

```
function postRedemptionRequest(
        $accountSlug,
        $redemptionRequestForm)
```

#### Parameters

[](#parameters-32)

ParameterTagsDescriptionaccountSlug`Required`The account identifierredemptionRequestForm`Required`The body of the request#### Example Usage

[](#example-usage-39)

```
$accountSlug = 'account_slug';
$redemptionRequestForm = new RedemptionRequestForm();

$result = $redemptionRequests->postRedemptionRequest($accountSlug, $redemptionRequestForm);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".RedemptionRequestsController.getRedemptionRequest")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getRedemptionRequest

[](#-getredemptionrequest)

> Get a redemption request by a given id.

```
function getRedemptionRequest(
        $accountSlug,
        $redemptionRequestId)
```

#### Parameters

[](#parameters-33)

ParameterTagsDescriptionaccountSlug`Required`The account identifierredemptionRequestId`Required`The redemption request identifier#### Example Usage

[](#example-usage-40)

```
$accountSlug = 'account_slug';
$redemptionRequestId = 'redemption_request_id';

$result = $redemptionRequests->getRedemptionRequest($accountSlug, $redemptionRequestId);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".RedemptionRequestsController.getRedemptionRequests")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getRedemptionRequests

[](#-getredemptionrequests)

> Get the list of redemption requests.

```
function getRedemptionRequests(
        $accountSlug,
        $page = 1,
        $limit = 10,
        $filter = null,
        $sort = null)
```

#### Parameters

[](#parameters-34)

ParameterTagsDescriptionaccountSlug`Required`The account identifierpage`Optional` `DefaultValue`Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.limit`Optional` `DefaultValue`Maximum number of results to return in the response. Default (10), threshold (100)filter`Optional`Allowed fields: redemption\_request\_id, name, lastname, email, request\_status\_slug, request\_action\_slug, from, to, created. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: [www.example.com/users?filter='name::todd|city::denver|title::grand](http://www.example.com/users?filter='name::todd%7Ccity::denver%7Ctitle::grand) poobah'sort`Optional`Allowed fields: name, lastname, email, created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this [www.example.com/users?sort='last\_name|first\_name|-hire\_date](http://www.example.com/users?sort='last_name%7Cfirst_name%7C-hire_date)'#### Example Usage

[](#example-usage-41)

```
$accountSlug = 'account_slug';
$page = 1;
$limit = 10;
$filter = 'filter';
$sort = 'sort';

$result = $redemptionRequests->getRedemptionRequests($accountSlug, $page, $limit, $filter, $sort);
```

[Back to List of Controllers](#list_of_controllers)

### [![Class: ](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67 ".BonusesController")](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67) BonusesController

[](#-bonusescontroller)

#### Get singleton instance

[](#get-singleton-instance-7)

The singleton instance of the `BonusesController` class can be accessed from the API Client.

```
$bonuses = $client->getBonuses();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".BonusesController.getBonuses")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getBonuses

[](#-getbonuses)

> Get the list of bonuses for a given account.

```
function getBonuses(
        $accountSlug,
        $page = 1,
        $limit = 10,
        $filter = null,
        $sort = null)
```

#### Parameters

[](#parameters-35)

ParameterTagsDescriptionaccountSlug`Required`The account identifierpage`Optional` `DefaultValue`Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.limit`Optional` `DefaultValue`Maximum number of results to return in the response. Default (10), threshold (100)filter`Optional`Allowed fields: name, lastname, email, campaign\_slug, from, to, created. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: [www.example.com/users?filter='name::todd|city::denver|title::grand](http://www.example.com/users?filter='name::todd%7Ccity::denver%7Ctitle::grand) poobah'sort`Optional`Allowed fields: name, lastname, email, created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this [www.example.com/users?sort='last\_name|first\_name|-hire\_date](http://www.example.com/users?sort='last_name%7Cfirst_name%7C-hire_date)'#### Example Usage

[](#example-usage-42)

```
$accountSlug = 'account_slug';
$page = 1;
$limit = 10;
$filter = 'filter';
$sort = 'sort';

$result = $bonuses->getBonuses($accountSlug, $page, $limit, $filter, $sort);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".BonusesController.postBonus")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) postBonus

[](#-postbonus)

> Make an attempt to give a bonus for to the advocate's referrer. The system processes the given advocate (referral) and creates a bonus for the advocate's referrer if is needed. All restrictions set on the campaigns for this account will be check out before giving the bonus to the advocate's referrer.

```
function postBonus(
        $accountSlug,
        $bonusesForm)
```

#### Parameters

[](#parameters-36)

ParameterTagsDescriptionaccountSlug`Required`The account identifierbonusesForm`Required`The body of the request#### Example Usage

[](#example-usage-43)

```
$accountSlug = 'account_slug';
$bonusesForm = new BonusesForm();

$result = $bonuses->postBonus($accountSlug, $bonusesForm);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".BonusesController.getBonusCheckup")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getBonusCheckup

[](#-getbonuscheckup)

> Check if there is a bonus to be given to the advocate. Allows the clients to check if there is a bonus to be given, it simulates the behaivor of a POST request to /accounts/{account\_slug}/bonuses resource. This resource is idempotent.

```
function getBonusCheckup(
        $accountSlug,
        $advocateToken,
        $reference,
        $paymentAmount)
```

#### Parameters

[](#parameters-37)

ParameterTagsDescriptionaccountSlug`Required`The account identifieradvocateToken`Required`The referral's token. Usually the one that completed the purchase, or trigger an event.reference`Required`The reference number for this request. Usually the order\_id, payment\_id, or timestamp.paymentAmount`Required`The payment amount the referrals has made. Required for a percentage based campaign.#### Example Usage

[](#example-usage-44)

```
$accountSlug = 'account_slug';
$advocateToken = 'advocate_token';
$reference = 'reference';
$paymentAmount = 105.64688331012;

$result = $bonuses->getBonusCheckup($accountSlug, $advocateToken, $reference, $paymentAmount);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".BonusesController.postForceBonus")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) postForceBonus

[](#-postforcebonus)

> Force the system to give a bonus to an advocate. The system will not take into account the restriccions specified on the campaigns.

```
function postForceBonus(
        $accountSlug,
        $bonusForm)
```

#### Parameters

[](#parameters-38)

ParameterTagsDescriptionaccountSlug`Required`The account identifierbonusForm`Required`The body of the request#### Example Usage

[](#example-usage-45)

```
$accountSlug = 'account_slug';
$bonusForm = new ForceBonusesForm();

$result = $bonuses->postForceBonus($accountSlug, $bonusForm);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".BonusesController.getBonusTrace")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getBonusTrace

[](#-getbonustrace)

> Get a bonus request trace.

```
function getBonusTrace(
        $accountSlug,
        $traceId)
```

#### Parameters

[](#parameters-39)

ParameterTagsDescriptionaccountSlug`Required`The account identifiertraceId`Required`The trace id#### Example Usage

[](#example-usage-46)

```
$accountSlug = 'account_slug';
$traceId = 105;

$result = $bonuses->getBonusTrace($accountSlug, $traceId);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".BonusesController.deleteBonus")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) deleteBonus

[](#-deletebonus)

> Delete a bonus

```
function deleteBonus(
        $accountSlug,
        $bonusId)
```

#### Parameters

[](#parameters-40)

ParameterTagsDescriptionaccountSlug`Required`The account identifierbonusId`Required`The bonus id#### Example Usage

[](#example-usage-47)

```
$accountSlug = 'account_slug';
$bonusId = 105;

$bonuses->deleteBonus($accountSlug, $bonusId);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".BonusesController.getBonus")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getBonus

[](#-getbonus)

> Get a bonus by a given id.

```
function getBonus(
        $accountSlug,
        $bonusId)
```

#### Parameters

[](#parameters-41)

ParameterTagsDescriptionaccountSlug`Required`The account identifierbonusId`Required`The bonus id#### Example Usage

[](#example-usage-48)

```
$accountSlug = 'account_slug';
$bonusId = 105;

$result = $bonuses->getBonus($accountSlug, $bonusId);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".BonusesController.getBonusTraces")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getBonusTraces

[](#-getbonustraces)

> Get the list of bonuses traces (audit trail). Every time the system tries to give a bonus the an advocate a new trace is created.

```
function getBonusTraces(
        $accountSlug,
        $page = 1,
        $limit = 10,
        $filter = null,
        $sort = null)
```

#### Parameters

[](#parameters-42)

ParameterTagsDescriptionaccountSlug`Required`The account identifierpage`Optional` `DefaultValue`Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.limit`Optional` `DefaultValue`Maximum number of results to return in the response. Default (10), threshold (100)filter`Optional`Allowed fields: reference, result, bonus\_amount, advocate\_token, advocate\_referrer\_token, campaign\_slug, from, to, created. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: [www.example.com/users?filter='name::todd|city::denver|title::grand](http://www.example.com/users?filter='name::todd%7Ccity::denver%7Ctitle::grand) poobah'sort`Optional`Allowed fields: created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this [www.example.com/users?sort='last\_name|first\_name|-hire\_date](http://www.example.com/users?sort='last_name%7Cfirst_name%7C-hire_date)'#### Example Usage

[](#example-usage-49)

```
$accountSlug = 'account_slug';
$page = 1;
$limit = 10;
$filter = 'filter';
$sort = 'sort';

$result = $bonuses->getBonusTraces($accountSlug, $page, $limit, $filter, $sort);
```

[Back to List of Controllers](#list_of_controllers)

### [![Class: ](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67 ".CampaignsController")](https://camo.githubusercontent.com/ec8022a6fb768aa7d81b8226237aadf63b8a726efab75a8314b224e54194c885/68747470733a2f2f617069646f63732e696f2f696d672f636c6173732e706e67) CampaignsController

[](#-campaignscontroller)

#### Get singleton instance

[](#get-singleton-instance-8)

The singleton instance of the `CampaignsController` class can be accessed from the API Client.

```
$campaigns = $client->getCampaigns();
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".CampaignsController.getCampaign")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getCampaign

[](#-getcampaign)

> Get a campaign by a given slug.

```
function getCampaign(
        $accountSlug,
        $campaignSlug)
```

#### Parameters

[](#parameters-43)

ParameterTagsDescriptionaccountSlug`Required`The account identifiercampaignSlug`Required`The campaign identifier#### Example Usage

[](#example-usage-50)

```
$accountSlug = 'account_slug';
$campaignSlug = 'campaign_slug';

$result = $campaigns->getCampaign($accountSlug, $campaignSlug);
```

#### [![Method: ](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67 ".CampaignsController.getCampaigns")](https://camo.githubusercontent.com/501a7bfa57a34ebbde43bfe00d7218a47c0a18eae15acb62480b8716f604ee87/68747470733a2f2f617069646f63732e696f2f696d672f6d6574686f642e706e67) getCampaigns

[](#-getcampaigns)

> Get the list of campaings for a given account.

```
function getCampaigns(
        $accountSlug,
        $page = 1,
        $limit = 10,
        $filter = null,
        $sort = null)
```

#### Parameters

[](#parameters-44)

ParameterTagsDescriptionaccountSlug`Required`The account identifierpage`Optional` `DefaultValue`Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.limit`Optional` `DefaultValue`Maximum number of results to return in the response. Default (10), threshold (100)filter`Optional`Allowed fields: name, description, start\_date, end\_date, is\_active (true|false), created. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: [www.example.com/users?filter='name::todd|city::denver|title::grand](http://www.example.com/users?filter='name::todd%7Ccity::denver%7Ctitle::grand) poobah'sort`Optional`Allowed fields: campaign\_slug, created, start\_date, end\_date, is\_active. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this [www.example.com/users?sort='last\_name|first\_name|-hire\_date](http://www.example.com/users?sort='last_name%7Cfirst_name%7C-hire_date)'#### Example Usage

[](#example-usage-51)

```
$accountSlug = 'account_slug';
$page = 1;
$limit = 10;
$filter = 'filter';
$sort = 'sort';

$result = $campaigns->getCampaigns($accountSlug, $page, $limit, $filter, $sort);
```

[Back to List of Controllers](#list_of_controllers)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~607 days

Total

3

Last Release

2162d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a54f562ec6cd3d50cef9f961183af5e579d12ebfaca114d30fae321099ae6a84?d=identicon)[alain@hlasolutionsgroup.com](/maintainers/alain@hlasolutionsgroup.com)

---

Top Contributors

[![alainhl](https://avatars.githubusercontent.com/u/1686340?v=4)](https://github.com/alainhl "alainhl (9 commits)")

---

Tags

friendsaffiliatesrefer a friendreferralaffiliatefriendgeniusreferralsreferral marketing programsword of mousepromotion programsreferral programspromotion campaignsreferral campaignsmarketing campaignsreferralsreferafiliationrefer friend

### Embed Badge

![Health badge](/badges/geniusreferrals-geniusreferrals/health.svg)

```
[![Health](https://phpackages.com/badges/geniusreferrals-geniusreferrals/health.svg)](https://phpackages.com/packages/geniusreferrals-geniusreferrals)
```

###  Alternatives

[bandwidth/sdk

Bandwidth's set of APIs

16948.8k1](/packages/bandwidth-sdk)[messagemedia/messages-sdk

The MessageMedia Messages API provides a number of endpoints for building powerful two-way messaging applications.

13390.6k](/packages/messagemedia-messages-sdk)[dawson/amazon-ecs

With Laravel, search and lookup Amazon products easily.

513.5k](/packages/dawson-amazon-ecs)[hypeit/tradetracker-api-client

TradeTracker API client

1020.9k](/packages/hypeit-tradetracker-api-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
