PHPackages                             wecantrack/api - 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. wecantrack/api

ActiveLibrary[API Development](/categories/api)

wecantrack/api
==============

PHP wrapper for the WeCanTrack API

1.0.8(4y ago)062MITPHPPHP ^7.4|^8

Since Nov 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/vzangloo/wecantrack)[ Packagist](https://packagist.org/packages/wecantrack/api)[ Docs](https://github.com/vzangloo/wecantrack)[ RSS](/packages/wecantrack-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (11)Used By (0)

WeCanTrack PHP API
==================

[](#wecantrack-php-api)

WeCanTrack offers a software solution that helps (affiliate) publishers in their everday business activities, by providing them with insights on which content and campaigns are converting and how much revenue they are generating.

### Requirements

[](#requirements)

- PHP &gt;= 7.4

### Installation

[](#installation)

1. Install package using composer

```
$ composer require wecantrack/api
```

Basic Usage
-----------

[](#basic-usage)

#### ClickOut URL

[](#clickout-url)

```
use WeCanTrack\API\ClickOut;

$clickOut = (new ClickOut(API_KEY))
                    ->affiliateUrl('https://www.awin1.com/cread.php?awinmid=10921&awinaffid=211395&clickref2=MY&...')
                    ->clickoutUrl('https://your-clickout-url.com/clickout')
                    ->ipAddress('your-ip-address')
                    ->metadata([
                        'custom_1' => 'custom_data',
                        'custom_2' => 'custom_data2',
                    ])
                    ->get();

if($clickOut->isValid()) {
    echo $clickOut->getAffiliateUrl();
    echo $clickOut->getReference(); // return WCT reference. Example: wct200514135314e7x4d
} else {
    var_dump($clickOut->getErrors());
}
```

Documentation
-------------

[](#documentation)

See [Full Documentation](https://docs.wecantrack.com/)

#### All Network Accounts

[](#all-network-accounts)

```
use WeCanTrack\API\{Networks, NetworkAccounts};

$accounts = (new NetworkAccounts(API_KEY))->get();

foreach($accounts as $account) {
    echo $account['id'];
    echo $account['name'];
    echo $account['network_id'];
    echo $account['is_enabled'];
    ......
}

echo $accounts->getCount(); // return Accounts count

// get single account data by id
$account = $accounts->findById(123);
echo $account['id'];
echo $account['name'];
echo $account['network_id'];
echo $account['is_enabled'];
```

#### All Network Accounts with ID filter

[](#all-network-accounts-with-id-filter)

```
use WeCanTrack\API\{Networks, NetworkAccounts};

$networkAccounts = new NetworkAccounts(API_KEY);
$accounts = $networkAccounts->ids(12)->get(); // get account where its id = 12
// or
$accounts = $networkAccounts->ids([12, 123, 1234])->get(); // get accounts where its ids are 12, 123, 1234

foreach($accounts as $account) {
    echo $account['id'];
    echo $account['name'];
    echo $account['network_id'];
    echo $account['is_enabled'];
    ......
}

echo $accounts->getCount(); // return Accounts count
```

#### All websites

[](#all-websites)

```
use WeCanTrack\API\Websites

$websites = (new Websites(API_KEY))->get();

foreach($websites as $data) {
    echo $data['id'];
    echo $data['url'];
    echo $data['active'];
}
// get single website data by id
$data = $websites->findById(123);
echo $data['id'];
echo $data['url'];
echo $data['active'];
```

#### All Transactions

[](#all-transactions)

```
use WeCanTrack\API\Transactions;

$startDate = '2019-01-01';
$endDate = '2019-01-31';

$records = (new Transactions(API_KEY))->get($startDate, $endDate);

foreach($records as $row) {
    echo $row['transaction_id'];
    echo $row['reference']; // return wct200514135314e7x4d
    echo $row['order_date'];
    echo $row['validation_date'];
    echo $row['status'];
    echo $row['sale_amount'];
    echo $row['commission_amount'];
    var_dump($row['click_metadata']);
    ......
}

echo $records->getTotalCount(); // get all record count.
```

#### All Transactions With Filter

[](#all-transactions-with-filter)

```
use WeCanTrack\API\Transactions;

$startDate = '2019-01-01';
$endDate = '2019-01-31';

$records = (new Transactions(API_KEY))
            ->networkAccountId(123)
            ->status([
                Transactions::STATUS_PENDING,
                Transactions::STATUS_APPROVED,
            ])
            ->get($startDate, $endDate, Transactions::LAST_WCT_UPDATE);

foreach($records as $row) {
    echo $row['transaction_id'];
    echo $row['reference']; // return wct200514135314e7x4d
    ......
}

echo $records->getTotalCount(); // get all record count.
```

#### Get All Transactions With Limit

[](#get-all-transactions-with-limit)

```
use WeCanTrack\API\Transactions;

$startDate = '2019-01-01';
$endDate = '2019-01-31';

$records = (new Transactions(API_KEY))
            ->status([
                Transactions::STATUS_PENDING,
            ])
            ->get($startDate, $endDate);

// every page request return max 500 rows only
foreach($records->limit(500) as $row) {
    echo $row['transaction_id'];
    echo $row['reference']; // return wct200514135314e7x4d
    ......
}

echo $records->getTotalCount(); // get all record count.
```

#### Get All Transactions For a Page

[](#get-all-transactions-for-a-page)

```
use WeCanTrack\API\Transactions;

$startDate = '2019-01-01';
$endDate = '2019-01-31';

$records = (new Transactions(API_KEY))
            ->status([
                Transactions::STATUS_PENDING,
            ])
            ->get($startDate, $endDate);

// return max 600 rows from page 3 only.
foreach($records->limit(600)->page(3) as $row) {
    echo $row['transaction_id'];
    echo $row['reference']; // return wct200514135314e7x4d
    ......
}

echo $records->getTotalCount(); // get all record count.
echo $records->getCount(); // get the rows count for current page.
```

#### Utilities

[](#utilities)

```
use WeCanTrack\Helper\Utilities;

echo Utilities::extractReference($url); // return wct200514135314e7x4d
```

License
-------

[](#license)

The WeCanTrack PHP API is licensed under the MIT License. See the [LICENSE](LICENSE) file for details

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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 ~11 days

Recently: every ~23 days

Total

9

Last Release

1546d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c3e6315469b56ed1797318e31e05bcddb12dba268488a2fb0cd2b43971c9ac3?d=identicon)[vzangloo](/maintainers/vzangloo)

---

Top Contributors

[![vzangloo](https://avatars.githubusercontent.com/u/1908200?v=4)](https://github.com/vzangloo "vzangloo (3 commits)")

---

Tags

phpapiwecantrackwct

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[tustin/psn-php

PHP wrapper for the PlayStation API.

37237.8k1](/packages/tustin-psn-php)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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