PHP code example of catalin-ionut / profitshare-client

1. Go to this page and download the library: Download catalin-ionut/profitshare-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

catalin-ionut / profitshare-client example snippets


$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);