PHPackages                             jakuborava/scaleo-io-client - 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. jakuborava/scaleo-io-client

ActiveLibrary[API Development](/categories/api)

jakuborava/scaleo-io-client
===========================

API client for Scaleo.io

2.1.1(3mo ago)062[2 PRs](https://github.com/jakuborava/scaleo-io-client/pulls)MITPHPPHP ^8.4CI passing

Since Jan 20Pushed 2mo agoCompare

[ Source](https://github.com/jakuborava/scaleo-io-client)[ Packagist](https://packagist.org/packages/jakuborava/scaleo-io-client)[ Docs](https://github.com/jakuborava/scaleo-io-client)[ GitHub Sponsors](https://github.com/JakubOrava)[ RSS](/packages/jakuborava-scaleo-io-client/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (12)Versions (6)Used By (0)

Scaleo.io API Client for PHP
============================

[](#scaleoio-api-client-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4dc481d1d69e649cf375def02197ec3bc7f977c65c75fc8d18689355ee0261d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a616b75626f726176612f7363616c656f2d696f2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jakuborava/scaleo-io-client)[![GitHub Tests Action Status](https://camo.githubusercontent.com/8724c923d19fc2965d135ab2c585feac472f144001fdafe536a39c8087bbd9b8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a616b75626f726176612f7363616c656f2d696f2d636c69656e742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/jakuborava/scaleo-io-client/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/dfedd0362000c2e6c94bc6a5d907cef1a7dbb5463553078a1e2bc2f7b490805b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a616b75626f726176612f7363616c656f2d696f2d636c69656e742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/jakuborava/scaleo-io-client/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3e83cd797ed6d105d36ce704f07ce6c419ea482a394a9f99199d23c23b4fa59f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a616b75626f726176612f7363616c656f2d696f2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jakuborava/scaleo-io-client)

A comprehensive PHP client for the Scaleo.io Affiliate Network API. This package provides a clean, fluent interface for interacting with all Scaleo.io API endpoints including dashboard statistics, offers, reports, billing, and more.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require jakuborava/scaleo-io-client
```

Configuration
-------------

[](#configuration)

You can configure the API client in two ways:

### Option 1: Environment Variables (Recommended for Laravel applications)

[](#option-1-environment-variables-recommended-for-laravel-applications)

Set your API credentials in `.env`:

```
SCALEO_API_KEY=your_api_key_here
SCALEO_BASE_URL=https://your-domain.scaletrk.com
```

Then instantiate the client without parameters:

```
use JakubOrava\ScaleoIoClient\ScaleoIoClient;

$client = new ScaleoIoClient();
```

**Best for:** Laravel applications where credentials are managed through environment configuration.

### Option 2: Direct Configuration (Recommended for standalone usage)

[](#option-2-direct-configuration-recommended-for-standalone-usage)

Pass credentials directly to the constructor:

```
use JakubOrava\ScaleoIoClient\ScaleoIoClient;

$client = new ScaleoIoClient(
    apiKey: 'your_api_key_here',
    baseUrl: 'https://your-domain.scaletrk.com'
);
```

**Best for:**

- Standalone PHP applications
- Multiple API accounts in the same application
- Testing with different credentials
- Dynamic credential management

### Mixed Configuration

[](#mixed-configuration)

You can also mix both approaches - constructor parameters take priority over environment variables:

```
// Use environment variables as defaults, but override API key
$client = new ScaleoIoClient(
    apiKey: 'different-api-key',
    baseUrl: null // Will use SCALEO_BASE_URL from environment
);
```

Usage
-----

[](#usage)

### Basic Setup

[](#basic-setup)

```
use JakubOrava\ScaleoIoClient\ScaleoIoClient;

// Using environment variables
$client = new ScaleoIoClient();

// OR using direct configuration
$client = new ScaleoIoClient(
    apiKey: 'your_api_key_here',
    baseUrl: 'https://your-domain.scaletrk.com'
);
```

### Dashboard

[](#dashboard)

Get network summary statistics:

```
use JakubOrava\ScaleoIoClient\Requests\NetworkSummaryRequest;
use Carbon\Carbon;

// Get network summary for last 7 days
$summary = $client->affiliate()->dashboard()->networkSummary(
    NetworkSummaryRequest::create()
        ->preset('last_7_days')
);

foreach ($summary as $metric) {
    echo $metric->label . ': ' . $metric->total . PHP_EOL;
}
```

### Offers

[](#offers)

List and manage offers:

```
use JakubOrava\ScaleoIoClient\Requests\OffersListRequest;

// List offers with filters
$offers = $client->affiliate()->offers()->list(
    OffersListRequest::create()
        ->search('casino')
        ->countries(['US', 'GB'])
        ->categories([1, 2])
        ->onlyFeatured()
        ->page(1)
        ->perPage(20)
);

foreach ($offers->items as $offer) {
    echo $offer->title . ' - ' . $offer->status . PHP_EOL;
}

// Get single offer
$offer = $client->affiliate()->offers()->get(123);
echo "Payout: {$offer->defaultPayout} {$offer->defaultPayoutCurrency}" . PHP_EOL;

// Access offer visibility settings
foreach ($offer->visibleTypeSelected as $visibleType) {
    echo "Visibility: {$visibleType->title}" . PHP_EOL;
}

// Access live statistics (if available)
if ($offer->liveStats !== null) {
    echo "Stats Key: {$offer->liveStats->key}" . PHP_EOL;
    echo "Current Total: {$offer->liveStats->current->total}" . PHP_EOL;
    echo "Previous Total: {$offer->liveStats->previous->total}" . PHP_EOL;
}

// Access offer links with rules
foreach ($offer->links as $link) {
    echo "Link: {$link->url}" . PHP_EOL;
    if (!empty($link->rules)) {
        echo "Has validation rules" . PHP_EOL;
    }
}

// Download offer assets
$zipPath = $client->affiliate()->offers()->downloadAsset(
    offerId: 123,
    assetId: 456
);
```

### Offer Requests

[](#offer-requests)

Manage offer requests:

```
// List offer requests
$requests = $client->affiliate()->offerRequests()->list();

// List pending requests
$pending = $client->affiliate()->offerRequests()->pending();

// Create new request
$response = $client->affiliate()->offerRequests()->create([
    'offer_id' => 123,
    'message' => 'I would like to promote this offer',
]);
```

### Reports

[](#reports)

#### Statistics Report

[](#statistics-report)

```
use JakubOrava\ScaleoIoClient\Requests\StatisticsReportRequest;
use Carbon\Carbon;

$report = $client->affiliate()->reports()->statistics()->list(
    StatisticsReportRequest::create()
        ->rangeFrom(Carbon::now()->subDays(7))
        ->rangeTo(Carbon::now())
        ->columns(['offer_id', 'clicks', 'conversions', 'revenue'])
        ->breakdowns(['day'])
        ->page(1)
        ->perPage(50)
);

foreach ($report->items as $row) {
    $stats = $row->statistics;
    echo "Date: {$row->day_timestamp}" . PHP_EOL;
    echo "Clicks: {$stats->clicks}" . PHP_EOL;
    echo "Conversions: {$stats->conversions}" . PHP_EOL;
    echo "Revenue: {$stats->revenue}" . PHP_EOL;
}

// Get available columns and breakdowns
$columns = $client->affiliate()->reports()->statistics()->options();
$breakdowns = $client->affiliate()->reports()->statistics()->breakdowns();
```

#### Conversions Report

[](#conversions-report)

```
use JakubOrava\ScaleoIoClient\Requests\ConversionsReportRequest;

$conversions = $client->affiliate()->reports()->conversions()->list(
    ConversionsReportRequest::create()
        ->rangeFrom(Carbon::now()->subDays(7))
        ->rangeTo(Carbon::now())
        ->columns(['offer_id', 'status', 'payout'])
);
```

#### Clicks Report

[](#clicks-report)

```
use JakubOrava\ScaleoIoClient\Requests\ClicksReportRequest;

$clicks = $client->affiliate()->reports()->clicks()->list(
    ClicksReportRequest::create()
        ->rangeFrom(Carbon::now()->subDays(1))
        ->rangeTo(Carbon::now())
        ->columns(['offer_id', 'country', 'device'])
);
```

#### Referrals Report

[](#referrals-report)

```
use JakubOrava\ScaleoIoClient\Requests\ReferralsReportRequest;

$referrals = $client->affiliate()->reports()->referrals()->list(
    ReferralsReportRequest::create()
        ->rangeFrom(Carbon::now()->subDays(30))
        ->rangeTo(Carbon::now())
);
```

### Billing

[](#billing)

#### Get Balance

[](#get-balance)

```
$balance = $client->affiliate()->billing()->balances()->get();
echo "Current Balance: {$balance->currentBalance} {$balance->currency}" . PHP_EOL;
```

#### Payment Methods

[](#payment-methods)

```
// List payment methods
$methods = $client->affiliate()->billing()->paymentMethods()->list();

// Get specific payment method details
$method = $client->affiliate()->billing()->paymentMethods()->get('USD');

// Create or update payment method
$client->affiliate()->billing()->paymentMethods()->createOrUpdate([
    'currency' => 'USD',
    'payment_method_id' => 1,
    'fields' => [
        'account_number' => '1234567890',
        'bank_name' => 'Example Bank',
    ],
]);

// Delete payment method
$client->affiliate()->billing()->paymentMethods()->delete(123);
```

#### Invoices

[](#invoices)

```
use JakubOrava\ScaleoIoClient\Requests\InvoicesListRequest;

// List invoices
$invoices = $client->affiliate()->billing()->invoices()->list(
    InvoicesListRequest::create()->status('paid')
);

// Get specific invoice
$invoice = $client->affiliate()->billing()->invoices()->get(123);

// Download invoice PDF
$pdfPath = $client->affiliate()->billing()->invoices()->downloadPdf(123);
```

#### Payment Request

[](#payment-request)

```
$request = $client->affiliate()->billing()->paymentRequest()->create(
    currency: 'USD',
    attachmentFile: '/path/to/invoice.pdf',
    amount: 1000.00
);
```

### Profile

[](#profile)

```
$profile = $client->affiliate()->profile()->get();
echo "Name: {$profile->firstname} {$profile->lastname}" . PHP_EOL;
echo "Email: {$profile->email}" . PHP_EOL;
echo "Manager: {$profile->managerName}" . PHP_EOL;
```

### Postbacks

[](#postbacks)

```
$postbacks = $client->affiliate()->postbacks()->list();

foreach ($postbacks->items as $postback) {
    echo "Postback: {$postback->url}" . PHP_EOL;
}
```

### Leads

[](#leads)

```
// Standard lead creation
$lead = $client->affiliate()->leads()->create([
    'offer_hash' => 'abc123',
    'click_id' => 'xyz789',
    'email' => 'customer@example.com',
]);

// Create lead by offer ID
$lead = $client->affiliate()->leads()->createByOfferId([
    'offer_id' => 123,
    'click_id' => 'xyz789',
    'email' => 'customer@example.com',
]);

// Create lead upon (success delivery only)
$lead = $client->affiliate()->leads()->createUpon([
    'offer_hash' => 'abc123',
    'click_id' => 'xyz789',
    'email' => 'customer@example.com',
]);
```

### Players

[](#players)

```
use JakubOrava\ScaleoIoClient\Requests\BaseRequest;

$players = $client->affiliate()->players()->list(
    BaseRequest::create()
        ->page(1)
        ->perPage(50)
);
```

### Traders

[](#traders)

```
$traders = $client->affiliate()->traders()->list(
    BaseRequest::create()->page(1)
);
```

### Common Lists

[](#common-lists)

The client provides access to common lists used throughout the Scaleo platform. All common endpoints support pagination through BaseRequest:

#### Countries

[](#countries)

Get a list of all supported countries:

```
use JakubOrava\ScaleoIoClient\Requests\BaseRequest;

// Get countries with default settings
$countries = $client->common()->countries()->list();

foreach ($countries->results as $country) {
    echo "{$country->id}: {$country->title}" . PHP_EOL;
    // Example: CZ: Czech Republic
}

echo "Total countries: {$countries->count}" . PHP_EOL;

// Get countries with custom pagination
$countries = $client->common()->countries()->list(
    (new BaseRequest)->page(2)->perPage(50)
);
```

#### Tags

[](#tags)

Get a list of available tags:

```
use JakubOrava\ScaleoIoClient\Requests\BaseRequest;

// Get tags with default settings
$tags = $client->common()->tags()->list();

foreach ($tags->results as $tag) {
    echo "{$tag->id}: {$tag->title}" . PHP_EOL;
    // Example: 1: Exclusive
}

echo "Total tags: {$tags->count}" . PHP_EOL;

// Get tags with custom pagination
$tags = $client->common()->tags()->list(
    (new BaseRequest)->page(1)->perPage(100)
);
```

#### Goal Types

[](#goal-types)

Get a list of available goal types:

```
use JakubOrava\ScaleoIoClient\Requests\BaseRequest;

// Get goal types with default settings
$goalTypes = $client->common()->goalTypes()->list();

foreach ($goalTypes->results as $goalType) {
    echo "{$goalType->id}: {$goalType->title}" . PHP_EOL;
    // Example: sale: Sale
}

echo "Total goal types: {$goalTypes->count}" . PHP_EOL;

// Get goal types with custom pagination
$goalTypes = $client->common()->goalTypes()->list(
    (new BaseRequest)->page(1)->perPage(20)
);
```

### Error Handling

[](#error-handling)

The client throws specific exceptions for different error types:

```
use JakubOrava\ScaleoIoClient\Exceptions\AuthenticationException;
use JakubOrava\ScaleoIoClient\Exceptions\ValidationException;
use JakubOrava\ScaleoIoClient\Exceptions\ApiErrorException;
use JakubOrava\ScaleoIoClient\Exceptions\UnexpectedResponseException;

try {
    $offers = $client->affiliate()->offers()->list();
} catch (AuthenticationException $e) {
    // Handle authentication errors (401)
} catch (ValidationException $e) {
    // Handle validation errors (422)
    print_r($e->getErrors());
} catch (ApiErrorException $e) {
    // Handle other API errors
    echo "Error ({$e->getStatusCode()}): " . $e->getMessage();
} catch (UnexpectedResponseException $e) {
    // Handle unexpected response format
}
```

### Pagination

[](#pagination)

All list endpoints return a `PaginatedResponse` object:

```
$offers = $client->affiliate()->offers()->list(
    OffersListRequest::create()->page(1)->perPage(20)
);

// Access pagination metadata
echo "Total items: {$offers->totalItems}" . PHP_EOL;
echo "Current page: {$offers->currentPage}" . PHP_EOL;
echo "Total pages: {$offers->totalPages}" . PHP_EOL;

// Access items (Collection)
foreach ($offers->items as $offer) {
    // Process each offer
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Jakub Orava](https://github.com/jakuborava)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance83

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.1% 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 ~21 days

Total

3

Last Release

116d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd9a8a8fbd18b949158e9deccfcc947caab53f11bc8ad8bda576faf0af359126?d=identicon)[jakuborava](/maintainers/jakuborava)

---

Top Contributors

[![jakuborava](https://avatars.githubusercontent.com/u/9501966?v=4)](https://github.com/jakuborava "jakuborava (33 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laraveljakuboravascaleo-io-client

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jakuborava-scaleo-io-client/health.svg)

```
[![Health](https://phpackages.com/badges/jakuborava-scaleo-io-client/health.svg)](https://phpackages.com/packages/jakuborava-scaleo-io-client)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k9.9M90](/packages/dedoc-scramble)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M42](/packages/spatie-laravel-pdf)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[spatie/laravel-github-webhooks

Handle GitHub webhooks in a Laravel application

93157.3k5](/packages/spatie-laravel-github-webhooks)

PHPackages © 2026

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