The perfect starting point to integrate Profitshare functionality within your PHP project.
- Thin & minimal API client to interact with Profitshare's API
- Supports non blocking requests by default
- Full async methods implemented
- Easily configurable
First, install Profitshare PHP API Client via the composer package manager:
composer require catalin-ionut/profitshare-client
This package uses json-mapper to map the response to models for type validation and autocomplition.
Then, create the client:
$client = $client = new ProfitshareClient\Profitshare(
API_USER,
API_KEY
);
$advertisers = $client->getAdvertisers();
$campaigns = $client->getCampaign($page = 1);
/* full async non blocking */
$callback = function (array $campaigns) {
var_dump($campaigns);
};
$client->loopAllCampaigns($callback);
$products = $client->getProducts($advertiserID = 113725);
/* full async non blocking */
$callback = function (array $products) {
var_dump($products);
};
$client->loopAllProducts($advertiserID = 113725, $callback);
$filters = [
'status' => 'approved',
'date_from' => '2020-06-01',
'date_to' => '2020-06-23',
];
$commissions = $client->getCommissions($filters);
For full documentation, visit the Profitshare API.
Profitshare PHP API Client is an open-sourced software licensed under the MIT license.