whitelabeled / awin-api-client
Awin API client
Installs: 6 212
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 5
Forks: 3
Open Issues: 0
Requires
- guzzlehttp/guzzle: ^7.8
This package is auto-updated.
Last update: 2024-11-15 12:08:12 UTC
README
Library to retrieve sales from the Awin publisher API.
Usage:
<?php require 'vendor/autoload.php'; $publisher = 12345678; $token = 'authtoken'; $client = new \whitelabeled\AwinApi\AwinClient($token, $publisher); $transactions = $client->getTransactions(new DateTime('28 days ago'), new DateTime('now'));
Example data
Array
(
[0] => whitelabeled\AwinApi\Transaction Object
(
[id] => 193452706
[transactionDate] => DateTime Object
(
[date] => 2017-09-09 01:14:00.000000
[timezone_type] => 3
[timezone] => Europe/Berlin
)
[clickDate] => DateTime Object
(
[date] => 2017-09-08 18:58:00.000000
[timezone_type] => 3
[timezone] => Europe/Berlin
)
[validationDate] =>
[advertiserId] => 8389
[clickDevice] => iPhone
[transactionDevice] => Android Mobile
[commissionStatus] => pending
[declineReason] =>
[clickRefs] => Array
(
[clickRef6] => http://www.example.com/example
)
[commissionAmount] => 50
[totalCommissionAmount] => 50
[sharedCommission] =>
[commissionPercentage] => 100
[orderReference] =>
[saleAmount] => 694.21
[siteName] => http://www.example.com/
[url] =>
[paid] =>
[transactionParts] => Array
(
[0] => whitelabeled\AwinApi\TransactionPart Object
(
[commissionGroupId] => 134159
[commissionGroup] =>
[amount] => 694.21
[commissionAmount] => 50
)
)
[transactionType] => Commission group transaction
)
[1] => whitelabeled\AwinApi\Transaction Object
(
[id] => 193450524
[transactionDate] => DateTime Object
(
[date] => 2017-09-12 02:04:00.000000
[timezone_type] => 3
[timezone] => Europe/Berlin
)
[clickDate] => DateTime Object
(
[date] => 2017-09-11 17:52:00.000000
[timezone_type] => 3
[timezone] => Europe/Berlin
)
[validationDate] =>
[advertiserId] => 8313
[clickDevice] => iPhone
[transactionDevice] => iPhone
[commissionStatus] => pending
[declineReason] =>
[clickRefs] => Array
(
[clickRef] =>
[clickRef2] => ex_80909
[clickRef3] => www.example.net
)
[commissionAmount] => 12.5
[totalCommissionAmount] => 25
[sharedCommission] => 1
[commissionPercentage] => 50
[orderReference] =>
[saleAmount] => 13
[siteName] => http://www.example.com
[url] => http://www.example.com/
[paid] =>
[transactionParts] => Array
(
[0] => whitelabeled\AwinApi\TransactionPart Object
(
[commissionGroupId] => 136539
[commissionGroup] =>
[amount] => 13
[commissionAmount] => 25
)
)
[transactionType] => Commission group transaction
)
)
License
© Keuze.nl BV
MIT license, see LICENSE.txt for details.