Skip to content

Thin & Minimal API client to interact with Profitshare's API

License

Notifications You must be signed in to change notification settings

Catalin-Ionut/profitshare-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The perfect starting point to integrate Profitshare functionality within your PHP project.

Total Downloads License PHPStan Enabled

✨ Features

  • Thin & minimal API client to interact with Profitshare's API
  • Supports non blocking requests by default
  • Full async methods implemented
  • Easily configurable

💡 Getting Started

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

$advertisers = $client->getAdvertisers();

Campaigns

$campaigns = $client->getCampaign($page = 1);

/* full async non blocking */
$callback = function (array $campaigns) {
    var_dump($campaigns);
};
$client->loopAllCampaigns($callback);

Products

$products = $client->getProducts($advertiserID = 113725);

/* full async non blocking */
$callback = function (array $products) {
    var_dump($products);
};
$client->loopAllProducts($advertiserID = 113725, $callback);

Commissions

$filters = [
    'status' => 'approved',
    'date_from' => '2020-06-01',
    'date_to' => '2020-06-23',
];
$commissions = $client->getCommissions($filters);

For full documentation, visit the Profitshare API.

📄 License

Profitshare PHP API Client is an open-sourced software licensed under the MIT license.

About

Thin & Minimal API client to interact with Profitshare's API

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages