Code Monkey home page Code Monkey logo

awin-api-client's Introduction

Awin API client

Latest Stable Version Total Downloads License

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.

awin-api-client's People

Contributors

geertw avatar sanderbz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

kieste 001101 kbeat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.