Documentation Advertiser Webservices (v4)

Introduction

Overview

The advertiser web services allow affilinet advertisers to access their program data without logging in to their account on the affilinet website. The API is a SOAP web service - data is returned as XML, which can then be processed by your application.
The API includes the following services with the corresponding methods:

  • Order Management
    In order to use the order management API in a correct way, you also should have a look at the chapter Order Validation!
    Methods:
    • CreateTransaction
    • UpdateTransaction
    • GetOrders
    • CreateBasket
    • UpdateBasket
    • UpdateBasketItem
    • GetBasketItems
    • GetTransactions (deprecated)
  • Statistics
    Methods:
    • GetStatisticsPerPublisher
  • Toolbox
    Methods:
    • GetCreativesPerType
    • GetRateList
    • GetChannels
    • GetPublisherSegments

Web service credentials

You need a web service user as well as a web service password to use the API. To manage your web service user accounts for authentication, head into your account page and scroll down to "Web service account management".

Request Rate Limiting

Requests are limited to 60 requests per minute per method by program ID. If you exceed the limit, you will receive an Exception:

"You sent too many requests. Please increase the timespan between your requests."

Authentication

Submit web service user and password in the SOAP header of each web service request for authentication (for PHP see code samples).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php 
 
// Set webservice endpoint 
$wsdl = "...";
 
// Set namespace and security utility for SOAP authentication
$namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
$created = date(DATE_ATOM);
 
// Set credentials
$username = ''; // enter your webservice user
$password = ''; // enter the password of your webservice user
 
// Put together SOAP header for authentication
$token = new stdClass;
$token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
$token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
$token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
$auth = new stdClass;
$auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
$soapHeader = new SoapHeader($namespace, 'Security', $auth, true);

// Create Soap Client object
...


    	



Below you will find the list of the available service methods. Please note, that the authentication code is always included in the code sample of every method.

Order Management

With this web service, you can get, create and edit transactions, baskets and basket items in the affilinet system.

Endpoint for all order management methods

https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl

CreateTransaction

With this method you can create transactions.

Please note:

  • Only standard transactions can be created with this method. For creating Baskets please use CreateBasket.

  • The creation is processed asynchronously. Whenever a new order is submitted to us, it is first created as a temporary order, then several checks are performed, e.g. if an active partnership between the advertiser and the publisher exists. Only if all checks succeed, the order is created. During peak times, these checks can take a couple of minutes.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php 
 
// Set webservice endpoint 
$wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl";
 
// Set namespace and security utility for SOAP authentication
$namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
$created = date(DATE_ATOM);
 
// Set credentials
$username = ''; // enter your webservice user
$password = ''; // enter the password of your webservice user
 
// Put together SOAP header for authentication
$token = new stdClass;
$token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
$token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
$token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
$auth = new stdClass;
$auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
$soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
// Create Soap Client object
$client = new SoapClient($wsdl);
 
// Set SOAP Header
$client->__setSoapHeaders($soapHeader);
 
/* 
 * Requesting Advertiser (mandatory)
 */
$params['ProgramId'] = ''; // enter your Program Id 
 
/*
 * Order Id (mandatory)
 * 
 * The identifier of the transaction in the advertiser’s system. Within the advertiser’s system, this OrderId must be unique.
 */
$params['OrderId'] = ''; // Identifier of the transaction in the advertiser’s system
 
/*
 * Referring publisher (mandatory)
 * 
 * If applicable the publisher Id can be suffixed with "-" and the SubId, which the publisher has submitted.
 */
$params['ReferrerToken'] = ''; // the Id of the publisher who triggered the transaction 
 
/* 
 * Rate Mode, Number (mandatory)
 */
$params['RateMode'] = 'PayPerSale'; // Can be "PayPerSale", "PayPerLead" or "PayPerClickOut"
$params['RateNumber'] = 1; // identifier or the rate
 
/* 
 * Click- and Order date (Format: 2015-09-24T12:34:56)
 */
$params['ClickDate'] = null; // Timestamp of the click that led to the order. If not specified "OrderDate" is used.
$params['OrderDate'] = date(DATE_ATOM); // Can go back 180 days maximum. If not specified the current timestamp is used.
 
/* 
 * Creative Type and number
 */
$params['CreativeType'] = 'Text'; // valid values are "Text", "Banner" and "HTML"
$params['CreativeNumber'] = 1; // the Id of the creative that was clicked
 
/* 
 * Net price 
 */
$params['NetPrice'] = '10.00'; // the value of the action, e.g. the shopping cart value
 
/*
 * Currency
 *
 * Depending on the program’s currency the value is set automatically. Values have to follow the ISO standard 4217 and can 
 * have 3-character-abbreviations like  "GBP" or "EUR", etc., case insensitive. If a submitted value cannot get 
 * recognized the whole basket is rejected.  
 */
$params['Currency'] = '';
 
/*
 * Voucher Code
 *
 * If in the shopping process, a voucher code was used, the advertiser can submit the involved voucher code to us here
 */
$params['VoucherCode'] = '';
 
/*
 * SubIds 
 
 * Along with each order you can specify SubIds for your own purposes. Currently we support the keys pSub1 and pSub2. 
 * Usage: [pSub1 = value, pSub2 = value]
 */
$params['SubIds'] = []; 
 

// Send request to Order Management service
$response = $client->CreateTransaction($params);
 
// Show response
print_r($response);
       

Parameters

This method generates a new transaction on the affilinet platform. That new transaction is in status “open” at first and can be changed using the method “UpdateTransaction”.

CreateTransactionRequest

Parameter Type Description
ClickDate DateTime Please enter here when the click took place, which led to this transaction. If not specified, then the OrderDate is used.

ClickDate has to be formatted like this: 2010-11-24T12:34:56
CreativeNumber Integer The Id of the creative, which was clicked on. The combination of ProgramId, CreativeType and CreativeNumber is unique throughout the affilinet system.
CreativeType Enum The type of the creative, which was clicked on. The combination of ProgramId, CreativeType and CreativeNumber is unique throughout the affilinet system. Possible values are:
  • Text
  • Banner
  • HTML
Currency String The currency which shall be applied to the monetary values specified in the call. At the time of the call, we convert this value into EUR or GBP, depending on the program’s currency. Values have to follow the ISO standard 4217 and can have 3-characterabbreviations like “CHF”, “GBP”, “USD”, “EUR”, etc., case insensitive. If a submitted value cannot get recognized, we reject the whole basket. We support all reference currencies of the ECB.
LeadMultiplier Integer

If the commission of a lead rate shall be assigned not once but n times for this publisher, you can specify n in the LeadMultiplier parameter.

Example: a customer orders a prepaid telephone card not once, but 5 times. Creating 5 independent transactions for this process is hardly possible because normally each Order ID can only be used for one transaction.

Can only be used if RateMode parameter is set to "PayPerLead", otherwise it is ignored.

Can be any integer > 0.

NetPrice Double The value of the action, which the customer has performed on the advertiser’s platform, e.g. his shopping cart value. For sale transactions, this price is used to calculate the commissions for sale rates and is mandatory.
OrderDate DateTime The timestamp on which the transaction was generated. Can be the current timestamp or anywhere in the last 180 days. If not specified, then the current timestamp is used.

OrderDate has to be formatted like this: 2010-11- 24T12:34:56
OrderId required String The identifier of the transaction in the advertiser’s system. Within the advertiser’s system, this OrderId must be unique. Can be an alphanumeric string with up to 40 characters, case insensitive. Special characters like é, è, í, %, §, etc. are not supported.
ProgramId required Integer The Id of the advertiser.
RateDescription String

Normally orders are displayed to the publisher together with the name of the commissioned rate. If you would like the order to get a different text instead, you can submit it using the RateDescription parameter.

Only works for transactions, not for baskets.

Can be an alphanumeric string with up to 50 characters.

Must be URL-encoded.

RateMode required Enum The mode of the rate, which shall be applied to this transaction. Possible values are:
  • PayPerClickOut
  • PayPerSale
  • PayPerLead
RateNumber required Integer The identifier of the rate, which shall be applied to this transaction.
ReferrerToken required String The information on the publisher, who triggered the transaction. The ReferrerToken contains the Id of the publisher and if applicable it is suffixed with “-” and the SubId, which the publisher has submitted.
SubIds Dictionary of [String, String] / Associative array (click here for more information)

Along with each order you can specify sub-Ids for your own purposes. Currently we support the keys pSub1 and pSub2.

Example: You can e.g. specify the payment method which the customer used, his time spent on your platform, a string representing his click sequence on your site, etc...

Usage: [pSub1 = value, pSub2 = value]

Both can be up to 30 characters, case insensitive. Special characters like é, è, í, %, §, etc. are not supported.

VoucherCode String

If in the shopping process, a voucher code was used, you can submit the involved voucher code here.

Publishers only get to see whether or not a voucher was used in the transaction, they don’t see the voucher string itself.

Can be an alphanumeric string with up to 25 characters, case insensitive.

Special characters like é, è, í, %, §, etc. are not supported.

Response

When a transaction is created by calling the method CreateTransaction, that transaction is saved to a temporary table and a range of checks are being performed and only if these checks are successful, it is migrated to the final orders table: e.g. whether or not a partnership with the submitted publisher exists, whether or not the rate exists, what that rate is worth for this specific publisher…

These checks can take a couple of minutes, depending on the load on our servers.

CreateTransactionResponse

Property Type Description
ProcessingId String

The temporary Id, which was assigned to the transaction request.

RegisterSucceeded Bool

True if the creation of the temporary transaction was successful. Otherwise a FaultException will be thrown.

UpdateTransaction

With this method, an existing transaction can be edited: the status and the NetPrice of the transaction can be changed.

Please note:

  • Only transactions can be updated with this method. For updating BasketItems or Baskets, please use UpdateBasketItem or UpdateBasket.

  • The update is processed asynchronously. Several checks are performed to check if your updates are valid. Only if all checks succeed, the update is performed. During peak times, these checks can take a couple of minutes.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php 
 
// Set webservice endpoint 
$wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl";
 
// Set namespace and security utility for SOAP authentication
$namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
$created = date(DATE_ATOM);
 
// Set credentials
$username = ''; // enter your webservice user
$password = ''; // enter the password of your webservice user
 
// Put together SOAP header for authentication
$token = new stdClass;
$token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
$token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
$token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
$auth = new stdClass;
$auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
$soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
// Create Soap Client object
$client = new SoapClient($wsdl);
 
// Set SOAP Header
$client->__setSoapHeaders($soapHeader);
 
// Set requesting Advertiser
$params['ProgramId'] = ''; // your program Id
 
// Set Order Identifier (to identify which order has to be updated either a OrderId, RateMode and RateNumber or TransactionId must be submitted) 
$params['OrderId'] = ''; // unique identifier of the transaction in your system
$params['RateMode'] = 'PayPerSale'; // can be "PayPerClickOut", "PayPerSale" or "PayPerLead"
$params['RateNumber'] = 1; // identifier of the desired rate
 
// Set action (an order can be confirmed, (partially) cancelled or set to open (after it was already cancelled))
$params['Action'] = 'SetCancelled'; // Valid actions are "SetConfirmed", "SetCancelled", "SetNewNetPrice" and "SetOpen"
$params['CancellationReason'] = 'Item returned'; //  mandatory if an order is cancelled or its net price is changed
$params['NewNetPrice'] = '10.45'; // mandatory if action is set to "SetNewNetPrice"
 
// Send request to Order Management service
$response = $client->UpdateTransaction($params);
 
// Show response
print_r($response);
        

Parameters

With this method, an existing transaction can be edited: the status and the NetPrice of the transaction can be changed.

UpdateTransactionRequest

Parameter Type Description
Action required Enum This field defines the kind of change you wish to perform: to change the status of the transaction(s) or to change the NetPrice. Possible values are:
  • SetOpen (to give it the status “Open”)
  • SetCancelled (to give it the status “Cancelled”)
  • SetConfirmed (to give it the status “Confirmed”)
  • SetNewNetPrice (to change the NetPrice of the transaction)
CancellationReason String If a transaction is cancelled or its NetPrice is changed (if Action is SetCancelled or SetNewNetPrice), a reason for this change must be given. Must be a string of minimum length 5 non-empty characters. E.g.:
  • Failed credit check
  • Sale cancelled by customer
  • Item returned
  • Item out of stock
  • Duplicated order/li>
  • Breach of campaign terms and conditions
NewNetPrice Double Here you can specify a new NetPrice of the transaction. Must be a Double > 0.
OrderId String

This is the Id, which the advertiser has transmitted to affilinet for the order.

Please note:
either the OrderId, RateMode and RateNumber must be specified, or the TransactionId, because both are a unique identifier of the transaction in the affilinet system.

ProgramId required Integer The Id of the requesting advertiser
RateMode Enum The mode of the transaction. Possible values are:
  • PayPerClickOut
  • PayPerSale
  • PayPerLead
RateNumber Integer The identifier of the desired rate.
TransactionId Integer

The unique identifier, which affilinet has assigned to the desired transaction.

Please note:
either the OrderId, RateMode and RateNumber must be specified, or the TransactionId, because both are a unique identifier of the transaction in the affilinet system.

Response

UpdateTransactionResponse

Property Type Description
Successful Bool True if the update request has succeeded. Otherwise a FaultException will be thrown.

GetOrders

This method returns all orders (that is: transactions or baskets) on the affilinet platform, which match the given search criteria.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php 
 
// Set webservice endpoint 
$wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl";
 
// Set namespace and security utility for SOAP authentication
$namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
$created = date(DATE_ATOM);
 
// Set credentials
$username = ''; // enter your webservice user
$password = ''; // enter the password of your webservice user
 
// Put together SOAP header for authentication
$token = new stdClass;
$token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
$token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
$token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
$auth = new stdClass;
$auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
$soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
// Create Soap Client object
$client = new SoapClient($wsdl);
 
// Set SOAP Header
$client->__setSoapHeaders($soapHeader);
 
// Set your program Id (mandatory)
$params['ProgramId'] = ''; // enter your Program Id 
 
// Display settings (mandatory)
$params['Page'] = 1; 
$params['PageSize'] = 50; // max is 1000 
 
// Set the time range
$params['StartDate'] = strtotime("-1 day"); // (manadatory)
$params['EndDate'] = strtotime("today"); // (mandatory)
$params['ValuationType'] = 'RegistrationDate'; // specify wether start and end date refer to "RegistrationDate" or "LastStatusChangeDate"
 
// Limit results to specific transactions
$params['OrderId'] = ''; // limit results to the order with the specified OrderId 
$params['TransactionStatus'] = 'Confirmed'; // valid values are "Open", "Confirmed", "Cancelled" and "All"
$params['TransactionIds'] = []; // limit results to specified transaction IDs, max. 100 Ids
$params['BasketIds'] = []; // limit results to specific baskets, max 100 basket Ids
$params['CancellationReason'] = ''; // limit results to orders that contain this string in their cancellation reason
 
// Limit results to specific publishers 
$params['PublisherIds'] = []; // limit results to orders generated by specific publishers, max. 100 Ids
$params['Channel1'] = null; // limit results to publishers of a specific channel (use "GetChannels" to get a list of your channels)
$params['Channel2'] = null; // limit results to publishers of a specific channel (use "GetChannels" to get a list of your channels)
$params['PublisherSegment'] = null; // limit results to publishers in the given segment (use "GetPublisherSegments" to get a list of your publisher segments)
 
// Filter results depending on publisher commission and net price
$params['PublisherCommissionMin'] = '';
$params['PublisherCommissionMax'] = '';
$params['NetPriceMin'] = ''; 
$params['NetPriceMax'] = '';
 
// Limit results to transactions, where one of the defined rates was used for remuneration 
$params['RateMode'] = 'PayPerSale'; // valid values are "PayPerSale", "PayPerLead" and PayPerClickOut"
$params['RateNumber'] = 1; // limit results to orders with the set RateMode and this rate number
 
// Limit results to those orders triggered by the creative specified  
$params['CreativeInfo'] = [
  'CreativeType' => 'Banner', // valid values are "Banner", "Text", "HTML" and "Unknown"
  'CreativeNumber' => 1,
];  
 
// Send request to Order Management service
$response = $client->GetOrders($params);
 
// Show response
print_r($response);
        

Parameters

Parameter Type Description
BasketIds Array of Integer

If specified, only baskets are returned that have any of these Ids. The values given in the parameters Page and PageSize are ignored in this case.

Array can hold up to 100 Ids.

If specified, transactions are not returned, only baskets.

CancellationReason String Only those orders are returned, which contain this string in their cancellation reason.
Channel1 Integer Limits the results to publishers, which belong to this channel 1. Input can be generated with the method “GetChannels”.
Channel2 Integer Limits the results to publishers, which belong to this channel 2. Input can be generated with the method “GetChannels”.
CreativeInfo CreativeInfo Limits the results to orders, which have been triggered by the creative specified with these criteria.
EndDate required Date Only orders with this date or earlier will be returned. Depending on the property ValuationType, this date either considers the date when the order was recorded or edited. Time span between StartDate and EndDate cannot exceed 3 months.
NetPriceMax Double Only orders will be returned, whose total net price doesn’t exceed this limit.
NetPriceMin Double Only orders will be returned, whose total net price is at least this high.
OrderId String The identifier of the order, as it was submitted in the registersale call.
Page required Integer Defines which result page of the size PageSize shall be returned. Counting starts at 1. Please note the exception if TransactionIds is specified (see below).
PageSize required Integer Defines how many records each result page shall hold. Cannot be bigger than 1000. Please note the exception if TransactionIds is specified (see below).
ProgramId required Integer The Id of the requesting advertiser.
PublisherCommissionMax Double Only orders will be returned, through which the publisher earned this much or less.
PublisherCommissionMin Double Only orders will be returned, through which the publisher earned this much or more.
PublisherIds Array of Integer Restricts the orders to those, which have been generated through one of these publishers. If this is empty, the orders of all publishers are returned. Array can hold max. 100 elements.
PublisherSegment Integer Only orders triggered by publishers of this publisher segment will be returned. Input can be generated with the method “GetPublisherSegments”
RateMode Enum

The mode of the transaction. If not defined, transactions of any mode are returned. If specified, baskets are not returned, but only transactions.

Possible values are:

  • PayPerClickOut
  • PayPerSale
  • PayPerLead

RateNumber Integer The identifier of the desired rate. If specified, baskets are not returned, but only transactions.
StartDate required Date Only orders with this date or later will be returned. Depending on the property ValuationType, this date either considers the date when the order was recorded or edited. Time span between StartDate and EndDate cannot exceed 3 months.
TransactionIds Array of Integer If specified, only transactions are returned, which have any of these IDs. The entries in Page and PageSize are ignored in this case. Array can hold up to 100 IDs. If specified, baskets are not returned, but only transactions.
TransactionStatus required Enum

Restricts the returned orders to those which have this status.

Possible values of the enumeration are:

  • Open
  • Confirmed
  • Cancelled
  • All

ValuationType Enum

Defines whether you want the defined StartDate and EndDate to define the day when the orders were registered (RegistrationDate) or edited Advertiser Webservices Page 3 (LastStatusChangeDate).

Possible values are:

  • RegistrationDate
  • LastStatusChangeDate
  • Default is RegistrationDate.

Response

GetOrdersResponse

Property Type Description
OrderCollection Array of Order List of all found data sets. Each record stands for one transaction or basket.
ProgramId Integer The Id of the requesting advertiser.
TotalCount Integer The total amount of found data sets.

Order

Property Type Description
AutoOrderManagementAction Enum

This field tells whether or not the order is connected to automatic order management. And if so, to which status the transaction will be changed (Cancelled or Confirmed).

Possible values are:

  • Confirm
  • Cancel
  • (null)

AutoOrderManagementA ctionDate DateTime If an AutoOrderManagementAction is configured for this order, this field tells when the automatic action will take place or has taken place.
BasketInfo BasketInfo If the returned order is a shopping basket, this object contains summary information on the current status of that shopping basket, along with its Id (which can then be used e.g. in order to obtain the single basket items with GetBasketItems).
CancellationReason String If the order has been cancelled or its NetPrice has been changed, this field displays the reason that has been specified for this action.
ClickDate DateTime The timestamp when the click cookie was placed on the customer’s machine.
CookieSharing Program Integer If this program shares its cookies with a different program and the other program’s cookie was used when this order was created, then the Id of the program, whose cookie was used, is returned here.
CreativeInfo CreativeInfo Information through which creative the transaction was triggered.
LastStatusChangeDate DateTime The date when the transaction has last been edited.
NetPrice Double This is what has been transmitted as the net value of your customer’s action. For sale transactions, this is the base for the calculation of the commission. For lead transactions, NetPrice is optional.
NetworkFee Double The amount of money which has been remunerated to affilinet.
OrderId String The identifier of the order, as it was submitted by the advertiser.
PreviousPublisherIds Array of Integer If we know of other publishers, who generated a click before the remunerated publisher, those publishers’ Ids are returned here.
PublisherCommission Double The amount of money which has been remunerated to the publisher.
PublisherId Integer The ID of the publisher to whom this transaction is assigned.
RateInfo RateInfo Information on the rate, which applies to this transaction.
RegistrationDate DateTime The date when the transaction has been added to our database.
SubIds Dictionary of [String, String] Along with each order, advertisers can specify sub-Ids (like pSub1 or pSub2). If present for this order, they are returned here.
TransactionId Integer The internal Id which the transaction got in the affilinet platform.
TransactionStatus Enum

The status which the transaction currently has.

Possible values are:

  • Open
  • Confirmed
  • Cancelled

VoucherCode String If in the shopping process, a voucher code was used, the advertiser can submit the involved voucher code to us. If he did, it is returned here.

BasketInfo

Property Type Description
BasketId Integer The unique identifier of this basket within the affilinet system. Can be used e.g. in order to obtain the single basket items with GetBasketItems).
OpenBasketItemCount Integer The amount of not-cancelled basket items within this basket.
RegisteredNetPrice Double The total net price of all not-cancelled basket items within this basket.
TotalBasketItemCount Integer The total amount of basket items contained in this basket, cancelled or not-cancelled.

RateInfo

Parameter Type Description
IsTieredRate Bool Indicates whether or not the program is using a tiered rate system. If so, then its orders can only be confirmed by the automatic confirmation process, not manually or by a web service call.
RateDescription String The description of the rate. In most cases, it is the name of the default rate.
RateMode Enum

The mode of the transaction. Possible values are:

  • PayPerClickOut
  • PayPerSale
  • PayPerLead

RateNumber Integer The identifier of the rate.
RateValue Double The value of this rate. If the rate mode is PayPerSale, this is a percentage value, otherwise it is an absolute monetary value.

CreateBasket

As an alternative to the integration of a tracking pixel or something equivalent on the order confirmation page of the advertiser, new baskets can also be created with this method.

Please note:

  • The creation is processed asynchronously. Whenever a new basket is submitted to us, it is first created as a temporary order, then several checks are performed, e.g. if an active partnership between the advertiser and the publisher exists. Only if all checks succeed, the basket is created. During peak times, these checks can take a couple of minutes.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php 
 
// Set webservice endpoint 
$wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl";
 
// Set namespace and security utility for SOAP authentication
$namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
$created = date(DATE_ATOM);
 
// Set credentials
$username = ''; // enter your webservice user
$password = ''; // enter the password of your webservice user
 
// Put together SOAP header for authentication
$token = new stdClass;
$token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
$token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
$token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
$auth = new stdClass;
$auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
$soapHeader = new SoapHeader($namespace, 'Security', $auth, true);

// Create Soap Client object
$client = new SoapClient($wsdl);
 
// Set SOAP Header
$client->__setSoapHeaders($soapHeader);
 
/* Basket identifiers 
 *
 * The combination of ProgramId, CreativeType and CreativeNumber is unique throughout the affilinet system.
 */
$params['ProgramId'] = ''; // enter your Program Id (mandatory)
$params['CreativeType'] = 'Text'; // valid values are "Text", "Banner" and "HTML"
$params['CreativeNumber'] = 1; // the Id of the creative that was clicked
 
/*
 * Order Id 
 * 
 * The identifier of the transaction in the advertiser’s system. Within the advertiser’s system, this OrderId must be unique.
 */
$params['OrderId'] = ''; // Identifier of the transaction in the advertiser’s system
 
/*
 * Referring publisher
 * 
 * If applicable the publisher Id can be suffixed with "-" and the SubId, which the publisher has submitted.
 */
$params['ReferrerToken'] = ''; // the Id of the publisher who triggered the transaction 
 
/* 
 * Click- and Order date (Format: 2015-11-12T12:34:56)
 */
$params['ClickDate'] = null; // Timestamp of the click that led to the order. If not specified "OrderDate" is used.
$params['OrderDate'] = date(DATE_ATOM); // Can go back 180 days maximum. If not specified the current timestamp is used.
 
/*
 * Currency
 
 * Depending on the program’s currency the value is set automatically. Values have to follow the ISO standard 4217 and can 
 * have 3-character-abbreviations like  "GBP" or "EUR", etc., case insensitive. If a submitted value cannot get 
 * recognized the whole basket is rejected.  
 */
$params['Currency'] = '';
 
/*
 * Voucher Code
 
 * If in the shopping process, a voucher code was used, the advertiser can submit the involved voucher code to us here
 */
$params['VoucherCode'] = '';
 
/*
 * SubIds 
 
 * Along with each order you can specify SubIds for your own purposes. Currently we support the keys pSub1 and pSub2. 
 * Usage: [pSub1 = value, pSub2 = value]
 */
$params['SubIds'] = []; 
 
/* 
 * Basket Items
 * 
 * You can submit several basket items with one request
 */
 
// Example Basket Item 1
$basketItem1['ArticleNumber'] = '5345'; // the article number of this product (mandatory)
$basketItem1['Brand'] = 'Levis'; // the brand of the product
$basketItem1['Category'] = 'Kids > Pants > Jeans'; // The product category, incl. category path if available
$basketItem1['ProductName'] = 'Blue Jeans'; // the product name (mandatory)
$basketItem1['Properties'] = [['Key' => 'Property1', 'Value' => 'red']]; // Set additional product properties (up to 5 fields)
$basketItem1['Quantity'] = 1; // the count of bought articles with this ArticleNumber (mandatory)
$basketItem1['RateIdentifier']['RateMode'] = 'PayPerSale'; // Valid values are "PayPerClickOut", "PayPerSale" and "PayPerLead"
$basketItem1['RateIdentifier']['RateNumber'] = 1;
$basketItem1['SinglePrice'] = '30.00'; // the price of one item of this ArticleNumber (mandatory)
 
// Example Basket Item 2
$basketItem2['ArticleNumber'] = '7657'; // the article number of this product (mandatory)
$basketItem2['Brand'] = 'Levis'; // the brand of the product
$basketItem2['Category'] = 'Kids > Pants > Jeans'; // The product category, incl. category path if available
$basketItem2['ProductName'] = 'Black Jeans'; // the product name (mandatory)
$basketItem2['Properties'] = [['Key' => 'Property2', 'Value' => 'blue']]; // Set additional product properties (up to 5 fields)
$basketItem2['Quantity'] = 1; // // the count of bought articles with this ArticleNumber (mandatory)
$basketItem2['RateIdentifier']['RateMode'] = 'PayPerSale'; // Valid values are "PayPerClickOut", "PayPerSale" and "PayPerLead"
$basketItem2['RateIdentifier']['RateNumber'] = 1;
$basketItem2['SinglePrice'] = '40.00'; // the price of one item of this ArticleNumber (mandatory)
 
// Set BasketItemCollection 
$params['BasketItemCollection']['RegisterBasketItemDataCollection'] = [$basketItem1, $basketItem2];
 
// Send request to Order Management service
$response = $client->CreateBasket($params);

// Show response
print_r($response);
        

Parameters

As an alternative to the integration of a tracking pixel or something equivalent on the order confirmation page of the advertiser, new baskets can also be created with this method.

CreateBasketRequest

Parameter Type Description
BasketItemCollection required RegisterBasketItemDataCollection

A container for the basket items.

You can submit several basket items with one request.

ClickDate DateTime

Please enter here when the click took place, which led to this order. If not specified, then the OrderDate is used.

ClickDate has to be formatted like this: 2010- 11-24T12:34:56

CreativeNumber Integer The Id of the creative, which was clicked on. The combination of ProgramId, CreativeType and CreativeNumber is unique throughout the affilinet system.
CreativeType Enum

The type of the creative, which was clicked on. The combination of ProgramId, CreativeType and CreativeNumber is unique throughout the affilinet system.

Possible values are:

  • Text
  • Banner
  • HTML

Currency String

The currency which shall be applied to the monetary values specified in the call. At the time of the call, we convert this value into EUR or GBP, depending on the program’s currency.

Values have to follow the ISO standard 4217 and can have 3-characterabbreviations like CHF, GBP, USD, EUR, etc., case insensitive.

If a submitted value cannot get recognized, we reject the whole basket. We support all reference currencies of the EZB.

OrderDate DateTime

The timestamp on which the order was generated. Can be the current timestamp or anywhere in the last 180 days.

If not specified, then the current timestamp is used. OrderDate has to be formatted like this: 2010- 11-24T12:34:56

OrderId String

The identifier of the transaction in the advertiser’s system. Within the advertiser’s system, this OrderId must be unique.

Can be an alphanumeric string with up to 40 characters, case insensitive. Special characters like é, è, í, %, §, etc. are not supported.

ProgramId required Integer The Id of the advertiser.
ReferrerToken String The information on the publisher, who triggered the transaction. The ReferrerToken contains the Id of the publisher and if applicable it is suffixed with “-” and the SubId, which the publisher has submitted.
SubIds Dictionary of [String, String] / Associative array (click here for more information)

Along with each order you can specify sub-Ids for your own purposes. Currently we support the keys pSub1 and pSub2.

Example: You can e.g. specify the payment method which the customer used, his time spent on your platform, a string representing his click sequence on your site, etc...

Usage: [pSub1 = value, pSub2 = value]

Both key and value can be up to 30 characters, case insensitive. Special characters like é, è, í, %, §, etc. are not supported.

VoucherCode String

If in the shopping process, a voucher code was used, the advertiser can submit the involved voucher code to us here.

Publishers only get to see whether or not a voucher was used in the transaction, they don’t see the voucher string itself.

Can be an alphanumeric string with up to 25 characters, case insensitive. Special characters like é, è, í, %, §, etc. are not supported.

RegisterBasketItemDataCollection

Parameter Type Description
RegisterBasketItemDataCollection required Array of RegisterBasketItemData Contains the detailed information on the single basket items involved.

RegisterBasketItemData

Parameter Type Description
ArticleNumber required String The SKU this item has within the advertiser’s system. Can be an alphanumerical string of up to 80 characters. Exceeding characters will be cut off.
Brand String The make of the bought product.
Category String

The category of the advertiser’s system, in which the bought product is located, including category path, if available. E.g. “Electronics > Portable devices > Mp3 players”.

Can be an alphanumerical string of up to 255 characters. Exceeding characters will be cut off.

ProductName required String The title of the product, e.g. “Apple iPod Nano 8 GB”. Can be an alphanumerical string of up to 255 characters. Exceeding characters will be cut off.
Properties Dictionary of [String, String] / Associative array (click here for more information)

Additional information on the bought product. Up to 5 additional fields can be specified. This information is also displayed to the publisher.

Typical use cases is product data, which only applies to a certain subset of products - e.g. in the case of clothing, you could submit here the size, colour, material of the product etc.. Each property can contain up to 255 characters.

Example: ['colour' => 'black', 'size' => 'XL']

Quantity required Integer

The count of bought articles with this ArticleNumber.

We multiply Quantity with SinglePrice to calculate the NetPrice, based on which the publisher’s commission is calculated.

If e.g. somebody bought the same article in the same order process 5 times, then this parameter Quantity must be set to 5. Can by any integer > 0.

RateIdentifier RateIdentifier If you wish to explicitly specify, which rate shall be used when remunerating the sale of this product, you can specify it here. If you don’t, then this program’s rate mapping settings will be applied.
SinglePrice required Double The price, which one item of this ArticleNumber costs. We multiply Quantity with SinglePrice to calculate the NetPrice, based on which the publisher’s commission is calculated. Cannot be negative, but can be 0.

RateIdentifier

Parameter Type Description
RateMode Enum

The mode of the rate, which shall be applied when remunerating the sale of this product.

Possible values are:

  • PayPerClickOut
  • PayPerSale
  • PayPerLead

RateNumber Integer The identifier of the rate, which shall be applied when remunerating the sale of this product.

Response

Property Type Description
BasketId Integer

The Id of the basket, which got created.

Please note:
several logical checks are performed after the basket got created, e.g. whether or not a partnership with the referring publisher exists. So although a CreateBasketRequest was syntactically OK, a basket might still not get created (e.g. if no partnership existed between the submitted program and publisher, or a non-existing rate was specified, etc.).

UpdateBasket

This method allows you to change the status of a basket.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php 
 
// Set webservice endpoint 
$wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl";
 
// Set namespace and security utility for SOAP authentication
$namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
$created = date(DATE_ATOM);
 
// Set credentials
$username = ''; // enter your webservice user
$password = ''; // enter the password of your webservice user
 
// Put together SOAP header for authentication
$token = new stdClass;
$token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
$token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
$token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
$auth = new stdClass;
$auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
$soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
// Create Soap Client object
$client = new SoapClient($wsdl);
 
// Set SOAP Header
$client->__setSoapHeaders($soapHeader);
 
// Set requesting Advertiser
$params['ProgramId'] = ''; // your program Id
 
// Set Basket Identifier (to identify which basket has to be updated BasketId or OrderId must be submitted) 
$params['BasketId'] = '';
 
// Set action (a basket can be confirmed, cancelled or set to open (after it was already cancelled))
$params['Action'] = 'SetCancelled'; // Valid actions are "SetConfirmed", "SetCancelled" and "SetOpen"
$params['CancellationReason'] = 'Items returned'; //  mandatory when a basket is cancelled, must be string (minimum 5 characters)
 
// Send request to Order Management service
$response = $client->UpdateBasket($params);
 
// Show response
print_r($response);
        

Parameters

Parameter Type Description
Action required Enum

This field defines the kind of change you wish to perform.

Possible values are:

  • SetOpen (to give it the status “Open”)
  • SetCancelled (to give it the status “Cancelled”)
  • SetConfirmed (to give it the status “Confirmed”)

BasketId Integer The unique identifier of a single basket within the affilinet system. In an UpdateBasketRequest, either BasketId or OrderId must be specified.
CancellationReason String If a basket is cancelled (that is: if Action is SetCancelled), a reason for this change must be given. Must be a string of minimum length 5 non-empty characters.
OrderId String

The unique identifier of the transaction in your system.

Can be an alphanumeric string with up to 40 characters, case insensitive. Special characters like é, è, í, %, §, etc. are not supported.

In an UpdateBasketRequest either BasketId or OrderId must be specified.

ProgramId required Integer The Id of the requesting advertiser.
PublisherId Integer The Id to which the basket is assigned. If multiple baskets exist with the same OrderId, the PublisherId can be used to tell them apart.

Response

Property Type Description
Successful Bool True if the update request has succeeded. Otherwise a FaultException will be thrown.

UpdateBasketItem

This method can be used in order to cancel a single item, which is part of a basket (or later un-cancel it again) by choosing the suitable CancellationReason, or to change the quantity of a single basket item.

Please note:
  • Basket items can only be updated when the basket, to which they are assigned, is in status “open”. Otherwise you will receive an error message.
  • The update is processed asynchronously. Several checks are performed to check if your updates are valid. Only if all checks succeed, the update is performed. During peak times, these checks can take a couple of minutes.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php 
 
// Set webservice endpoint 
$wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl";
 
// Set namespace and security utility for SOAP authentication
$namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
$created = date(DATE_ATOM);
 
// Set credentials
$username = ''; // enter your webservice user
$password = ''; // enter the password of your webservice user
 
// Put together SOAP header for authentication
$token = new stdClass;
$token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
$token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
$token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
$auth = new stdClass;
$auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
$soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
// Create Soap Client object
$client = new SoapClient($wsdl);
 
// Set SOAP Header
$client->__setSoapHeaders($soapHeader);
 
// Set requesting Advertiser
$params['ProgramId'] = ''; // your program Id
 
// Set Basket Identifier (to identify which basket has to be updated either BasketId and PositionNumber or OrderId and ArticleNumber must be submitted) 
$params['BasketId'] = ''; // 
$params['PositionNumber'] = ''; // position of the item in the basket (int)
 
// Cancel basket item by setting CancellationReason
$params['CancellationReason'] = 'ItemReturned'; //  
 
// If you don't want to cancel an item but change the quantity set the Quantity parameter
$params['Quantity'] = ''; 
 
 
// Send request to Order Management service
$response = $client->UpdateBasketItem($params);
 
// Show response
print_r($response);
        

Parameters

This method can be used in order to cancel a single item, which is part of a basket (or later uncancel it again) by choosing the suitable CancellationReason, or to change the quantity of a single basket item.

UpdateBasketItemRequest

Parameter Type Description
ArticleNumber String

The SKU this item has within your system.

Can be an alphanumerical string of up to 80 characters.

Either BasketId and PositionNumber or OrderId and ArticleNumber must be specified.

BasketId Integer The affilinet-wide unique identifier of the basket, to which the affected basket item belongs. In an UpdateBasketItemRequest, either BasketId and PositionNumber or OrderId and ArticleNumber must be specified.
CancellationReason Enum

If an item is cancelled, a reason for this change must be given.

Possible values are:

  • NotCancelled
  • FailedCreditCheck
  • SaleCancelledByCustomer
  • ItemReturned
  • ItemOutOfStock
  • DuplicatedOrder
  • BreachOfCampaignTermsAndConditions
  • Other

OrderId String

The unique identifier of the order in your system.

Can be an alphanumeric string with up to 40 characters, case insensitive. Special characters like é, è, í, %, §, etc. are not supported.

In an UpdateBasketItemRequest either BasketId and PositionNumber or OrderId and ArticleNumber must be specified.

PositionNumber Integer The position of the affected item within the basket (can be obtained through GetBasketItems). In an UpdateBasketItemRequest, either BasketId and PositionNumber or OrderId and ArticleNumber must be specified.
ProgramId required Integer The Id of the requesting advertiser.
Quantity Integer The count of bought articles with this ArticleNumber. We multiply Quantity with SinglePrice to calculate the NetPrice, based on which the publisher’s commission is calculated.

Response

Property Type Description
Successful Bool True if the update request has succeeded. Otherwise a FaultException will be thrown.

GetBasketItems

Through this method, single products, which are part of a shopping basket, can be obtained.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php 
 
// Set webservice endpoint 
$wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl";
 
// Set namespace and security utility for SOAP authentication
$namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
$created = date(DATE_ATOM);
 
// Set credentials
$username = ''; // enter your webservice user
$password = ''; // enter the password of your webservice user
 
// Put together SOAP header for authentication
$token = new stdClass;
$token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
$token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
$token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
$auth = new stdClass;
$auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
$soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
// Create Soap Client object
$client = new SoapClient($wsdl);
 
// Set SOAP Header
$client->__setSoapHeaders($soapHeader);
 
// Set your program Id (mandatory)
$params['ProgramId'] = ''; // enter your Program Id 
 
// Set the time range (time span between StartDate and EndDate cannot exceed 3 months) (optional)
$params['StartDate'] = strtotime("-1 day"); 
$params['EndDate'] = strtotime("today"); 
 
// Limit results to the items of a specific a specific basket/order (optional)
$params['BasketId'] = null; 
$params['OrderId'] = null; 
 
// Limit results to specific basket items (optional)
$params['ArticleNumber'] = ''; 
$params['Category'] = ''; // must be string, exact matching, case sensitive
$params['PositionNumber'] = null; // specify the position that the requested item has within the basket
$params['Status'] = 'Open'; // limit results to basket items with the specified status. Valid values are "Open" and "Cancelled"
 
// Limit results to those basket items renumerated by the specified rate
$params['RateQuery'] = [
  'RateMode' => 'PayPerSale', // valid values are "PayPerClickOut", "PayPerSale" and "PayPerLead"
  'RateNumber' => 1, 
];  
 
// Set DisplaySettings params
$displaySettings = [
  'CurrentPage' => 1,
  'PageSize' => 10 // max 150
];
 
// Send request to Order Management service
$response = $client->GetBasketItems([
  'DisplaySettings' => $displaySettings,
  'BasketItemsQuery' => $params
]);
 
// Show response
print_r($response);
       

Parameters

Parameter Type Description
BasketItemsQuery required BasketItemsQuery Search criteria which the desired basket items ought to fulfil.
DisplaySettings required DisplaySettings Allows you to define the paging of the results.

DisplaySettings

Parameter Type Description
CurrentPage required Integer Defines which result page of the size PageSize shall be returned. Counting starts at 1.
PageSize required Integer Defines how many records each result page shall hold. Cannot be bigger than 150.

BasketItemsQuery

Parameter Type Description
ArticleNumber String If specified, then only basket items with this ArticleNumber are returned.
BasketId Integer The unique identifier of a single basket within the affilinet system. If specified, then only basket items are returned, which belong to this basket.
Category String If specified, then only basket items are returned, which were created with exactly this category information (exact matching, case sensitive).
EndDate DateTime If specified, only basket items will be returned, which were created with this date or earlier. Time span between StartDate and EndDate cannot exceed 3 months.
OrderId String The identifier of the order, as it was submitted in the registersale call.
PositionNumber Integer In order to access one single basket item, you can specify here the position, which the desired item has within the basket.
ProgramId required Integer The Id of the requesting advertiser.
RateQuery RateQuery If specified, then only those basket items get returned, which were remunerated with this rate.
StartDate DateTime If specified, only basket items will be returned, which were created with this date or later. Time span between StartDate and EndDate cannot exceed 3 months.
Status Enum

If specified, lets you restrict to the status of the desired basket items.

Possible values are:

  • cancelled
  • not cancelled

RateQuery

Parameter Type Description
RateMode required Enum

Defines the type of remuneration.

Possible values are:

  • PayPerClickOut
  • PayPerSale
  • PayPerLead

Default is PayPerClickOut.

RateNumber required Integer The identifier of the desired rate.

Response

GetBasketItemsResponse

Property Type Description
BasketItemCollection Array of BasketItem The collection of basket items, which match the given search criteria.
TotalCount Integer The total amount of basket items, which match the given search criteria.

BasketItem

Property Type Description
ArticleNumber String The SKU, which this product has within the advertiser’s system.
BasketId Integer The affilinet-wide unique Id of the basket, to which this basket item belongs.
Brand String The make of the bought product.
CancellationReason Enum

The specific reason, why this item got cancelled (if it was is cancelled).

Possible values are:

  • NotCancelled
  • FailedCreditCheck
  • SaleCancelledByCustomer
  • ItemReturned
  • ItemOutOfStock
  • DuplicatedOrder
  • BreachOfCampaignTermsAndConditions
  • Other

Category String The category, in which this product is kept in the advertiser’s system.
IsLocked Bool This flag indicates whether or not this item can still be edited - that is: whether or not the basket, to which this item belongs, is still in status “open”.
OriginalQuantity Integer This quantity was specified when this item got created - later changes to the quantity are reflected in the field Quantity.
PositionNumber Integer The position, which this item has within its basket.
ProductName String The title of the product.
Properties Dictionary of [String, String] Each of these 5 separate optional parameters can be used to submit additional information for this basket item. This information is also displayed to the publisher. Typical use cases is product data, which only applies to a certain subset of products - e.g. in the case of clothing, size, colour, material,... of a product can be submitted as properties.
Quantity Integer The current quantity of this article within this basket. Based on Quantity and SinglePrice, the net price is calculated, which is used to calculate the publisher’s commission.
RateInfo RateInfo Information on the rate, which is used to remunerate this basket item.
SinglePrice Double The price, which one article of this ArticleNumber costs. Based on Quantity and SinglePrice, the net price is calculated, which is used to calculate the publisher’s commission.
Status Enum

The current status of this basket item.

Possible values are:

  • NotCancelled
  • FailedCreditCheck
  • SaleCancelledByCustomer
  • ItemReturned
  • ItemOutOfStock
  • DuplicatedOrder
  • BreachOfCampaignTermsAndConditions
  • Other

TotalPrice Double The total value of this basket item, calculated as Quantity * SinglePrice.
TransactionId Integer Internally, this basket item belongs to a transaction. This is that transaction’s Id.

GetTransactions

Please note:
This method is deprecated - please use "GetOrders" instead.

Statistics

This web service is intended to obtain statistical data from the affilinet system.

GetStatisticsPerPublisher

This method returns all transactions on the affilinet platform, grouped by publisher ID. It has a similar functionality like the page you find on the advertiser platform under Statistics > By Publisher (see screenshot below)

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/Statistics.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php 
 
// Set webservice endpoint 
$wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/Statistics.wsdl";
 
// Set namespace and security utility for SOAP authentication
$namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
$created = date(DATE_ATOM);
 
// Set credentials
$username = ''; // enter your webservice user
$password = ''; // enter the password of your webservice user
 
// Put together SOAP header for authentication
$token = new stdClass;
$token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
$token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
$token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
$auth = new stdClass;
$auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
$soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
// Create Soap Client object
$client = new SoapClient($wsdl);
 
// Set SOAP Header
$client->__setSoapHeaders($soapHeader);
 
// Set your program Id (mandatory)
$params['ProgramId'] = ''; // enter your Program Id 
 
// Detail view setting
$params['ShowDetails'] = false; // Set this flag to true to receive detailed information on the single transactions 
 
// Set the time range
$params['StartDate'] = strtotime("-1 day"); // (manadatory)
$params['EndDate'] = strtotime("today"); // (mandatory)
$params['ValuationType'] = 'Registration'; // specify wether start and end date refer to "Registration" or "Confirmation"
 
// Limit results to specific publishers 
$params['PublisherId'] = ''; // limit results to a single publisher
$params['Channel1'] = ''; // limit results to publishers of a specific channel (use "GetChannels" to get a list of your channels)
$params['Channel2'] = ''; // limit results to publishers of a specific channel (use "GetChannels" to get a list of your channels)
$params['PublisherSegment'] = ''; // limit results to publishers in the given segment (use "GetPublisherSegments" to get a list of your publisher segments)
$params['PublisherURL'] = ''; // limit results to publishers, whose URLs contain the specified string
 
// Filter results depending on publisher performance (see PDF documentation for more details)
$params['VolumeType'] = 'PublisherActivity'; 
$params['VolumeMin'] = 1;
$params['VolumeMax'] = PHP_INT_MAX;
$params['VolumeTypeRateNumber'] = ''; // only relevant if "VolumeType" is set to SalesByRate or LeadsByRate
 
// Limit results to transactions triggered by specific creatives
$params['CreativeType'] = 'Banner'; // Valid values are "Banner", "Text" and "HTML"
$params['CreativeNumber'] = 1; // 
  
// Limit results to transactions, where one of the defined rates was used for remuneration 
$params['RateQueryCollection'] = [
  [
    'RateMode' => 'Sale', // valid values are "Sale", "Lead", "Click" and "ClickOut", default is "Click"
    'RateNumber' => 1,
  ],
  [
    'RateMode' => 'Lead', // valid values are "Sale", "Lead", "Click" and "ClickOut", default is "Click"
    'RateNumber' => 1,
  ]
];
 
// Set DisplaySettings params
$displaySettings = [
  'CurrentPage' => 1,
  'PageSize' => 10 // max 150
];
 
// Send request to Statistics Service 
$response = $client->GetStatisticsPerPublisher([
  'DisplaySettings' => $displaySettings,
  'GetStatisticsPerPublisherQuery' => $params 
]);
 
// Show response
print_r($response);
        

Parameters

Parameter Type Description
DisplaySettings required DisplaySettings Allows you to define the paging of the results
GetStatisticsPerPublisherQuery required GetStatisticsPerPublisherQuery The filter settings of the statistics request

DisplaySettings

Parameter Type Description
CurrentPage required Integer Defines which result page of the size PageSize shall be returned. Counting starts at 1.
PageSize required Integer Defines how many records each result page shall hold. Cannot be bigger than 150.

GetStatisticsPerPublisherQuery

Parameter Type Description
Channel1 Integer Limits the results to publishers, which belong to this channel 1. Input can be generated with the method “GetChannels”
Channel2 Integer Limits the results to publishers, which belong to this channel 2. Input can be generated with the method “GetChannels”
CreativeNumber Integer Limits the results to transactions, which have been triggered by the creative specified with this CreativeNumber and this CreativeType. Please note that ProgramID, CreativeType and CreativeNumber form a unique identifier. If you specify the CreativeNumber, you also have to specify the Advertiser Webservices Page 2 CreativeType. Input can be generated with the method “GetCreativesPerType”
CreativeType Enum

Limits the results to transactions, which have been triggered by the creative specified with this CreativeNumber and this CreativeType.

Please note that ProgramID, CreativeType and CreativeNumber form a unique identifier.

Possible values are:

  • Text
  • Banner
  • HTML

If you specify the CreativeType, you also have to specify the CreativeNumber.

EndDate required DateTime Only transactions with this date or earlier will be considered for the statistics. Time span between StartDate and EndDate cannot exceed 3 months.
ProgramId required Integer The ID of the requesting advertiser.
PublisherId Integer Limits the results to this single publisher
PublisherName String Limits the results to publishers, whose names contain this string
PublisherSegment Integer Only transactions triggered by publishers of this publisher segment will be considered for the statistics. Input can be generated with the method “GetPublisherSegments”
PublisherURL String Limits the results to publishers, whose URLs contain this string.
RateQueryCollection RateQueryCollection Limits the statistics to transactions, where one of these rates was used for remuneration. Input can be generated with the method “GetRateList”.
ShowDetails Bool Set this flag to true if you would like to receive detail information on the single leads. If set to “false”, the “LeadRateDetails” property of the returned leads will be empty. Please note that setting this to “true” can lead to performance issues in large result sets. Default is “false”.
StartDate required DateTime Only transactions with this date or later will be considered for the statistics. Time span between StartDate and EndDate cannot exceed 3 months.
ValuationType Enum

Defines whether you want the defined StartDate and EndDate to define the day when the transactions were registered or confirmed.

Possible values are:

  • Registration
  • Confirmation

Default is Registration.

VolumeMax Integer Limits the statistics to publishers who have this much or less of whatever is defined in VolumeType. If VolumeMax is specified, VolumeType also needs to be filled.
VolumeMin Integer Limits the statistics to publishers who have this much or more of whatever is defined in VolumeType. If VolumeMin is specified, VolumeType also needs to be filled.
VolumeType Enum

Defines the statistical figure, which shall be applied to VolumeMax and/or VolumeMin.

Possible values are:

  • TotalViews
  • TotalClicks
  • TotalClickOuts
  • TotalSales
  • TotalLeads
  • TotalBonusPayments
  • TotalCommission
  • OpenCommission
  • ViewsRevenue
  • ClicksRevenue
  • SalesByRate
  • LeadsByRate
  • PublisherActivity *

*: PublisherActivity is a combination of TotalViews, TotalClicks, TotalClickOuts, TotalSales and TotalLeads. If you set VolumeType to “PublisherActivity” and specify a VolumeMin of e.g. 1, then all publishers, who did not generate a single view, click, clickOut, sale or lead in the given timespan, are NOT returned by this method – this can dramatically decrease the size of the response and is strongly recommended. Default of VolumeType is NULL.

VolumeTypeRateNumber Integer If VolumeType is set to “SalesByRate” or “LeadsByRate”, this field specifies, which sale rate resp. lead rate shall be considered.

RateQueryCollection

Parameter Type Description
RateQueryCollection Array of RateQuery Limits the statistics to transactions, where one of these rates was used for remuneration. Input can be generated with the method “GetRateList”.

RateQuery

Parameter Type Description
RateMode Enum

Defines the type of remuneration.

Possible values are:

  • Click
  • ClickOut
  • Sale
  • Lead

Default is Click.

RateNumber Integer The identifier of the desired rate.

Response

GetStatisticsPerPublisherResponse

Property Type Description
PublisherStatisticsRecordCollection Array of PublisherStatisticsRecord List of all found data sets. Each record stands for one publisher.
TotalCount Integer The total amount of found data sets

PublisherStatisticsRecord

Property Type Description
Bonus Bonus Detailed information on the bonus payments granted to this publisher.
ClickOuts RateModeSummary The publisher’s ClickOuts, which meet the set filter criteria.
Clicks TrafficSummary The publisher’s Clicks, which meet the set filter criteria.
Currency String The currency which must be applied to all commission values.
Leads RateModeSummary Information on the leads of this publisher, summed up by their status (“Open”, “Confirmed” or “Cancelled”).
NetPriceSummary PriceSummary Information on the turnover which this publisher is responsible for (based on the parameter “price” of the registersale-call), summed up by the status of the transactions (“Open”, “Confirmed” or “Cancelled”).
NetworkFeeSummary PriceSummary Information on the network commission which is due to the transactions of this publisher, summed up by the status of the transactions (“Open”, “Confirmed” or “Cancelled”).
PublisherCommissionSummary PriceSummary Information on the publisher commission, summed up by the status of the transactions (“Open”, “Confirmed” or “Cancelled”).
PublisherId Integer The ID of the publisher represented in this data set
PublisherURL String The URL of the publisher represented in this data set
Sales RateModeSummary This publisher’s sales, which meet the set filter criteria
Views TrafficSummary The publisher’s Views, which meet the set filter criteria.

Bonus

Property Type Description
Count TransactionSummary The total number of bonus payments to this publisher, summed up by their status (“Open”, “Confirmed” or “Cancelled”)
NetworkFee PriceSummary The total monetary value of network fees calculated for bonus payments, summed up by their status (“Open”, “Confirmed” or “Cancelled”)
PublisherCommission PriceSummary The total monetary value of all bonus payments to this publisher, summed up by their status (“Open”, “Confirmed” or “Cancelled”)

CommissionSummary

Property Type Description
CancelledCommission Double The total commission value of all cancelled transactions of this publisher
ConfirmedCommission Double The total commission value of all confirmed transactions of this publisher
OpenCommission Double The total commission value of all open transactions of this publisher

PriceSummary

Property Type Description
CancelledValue Double The sum of net prices in cancelled transactions
ConfirmedValue Double The sum of net prices in confirmed transactions
OpenValue Double The sum of net prices in open transactions

RateDetails

Property Type Description
TransactionSummary TransactionSummary The number of transactions for the given search criteria, split up by status
Price PriceSummary The total NetValue (normally: shopping cart value) of all transactions matching the given search criteria, split up by status
PublisherCommission PriceSummary The publisher commission assigned to all transactions matching the given search criteria, split up by status
RateNumber Integer The rate number on which these figures are based. Details on this RateNumber can be found using the method “GetRateList”.
NetworkFee PriceSummary The network fee calculated for the transactions contained in TransactionSummary, split up by status

RateDetailsCollection

Property Type Description
RateDetailsCollection Array of RateDetails The Id and the amounts of open, confirmed and cancelled transactions of this lead

RateModeSummary

Property Type Description
RateDetailsCollection Array of RateDetails The amount of sales, total NetPrice, PublisherCommission and NetworkFee for each single rate number.
TotalCount TransactionSummary The total amount of transactions of this RateMode, summed up by their status (“Open”, “Confirmed” or “Cancelled”).
TotalNetPrice PriceSummary The total NetPrice value of transacions of this RateMode, summed up by their status (“Open”, “Confirmed” or “Cancelled”).
TotalNetworkFee PriceSummary The sum of NetworkFees of all transactions of this RateMode, summed up by their status (“Open”, “Confirmed” or “Cancelled”).
TotalPublisherCommission PriceSummary The sum of PublisherCommissions, summed up by their status (“Open”, “Confirmed” or “Cancelled”).

TrafficSummary

Property Type Description
GrossCount Long The amount of clicks or views before filtering was applied.
NetCount Long The amount of clicks or views after filtering.
NetworkFee Double The network commission due to these clicks or views.
PublisherCommission Double The publisher commission due to these clicks or views.

TransactionSummary

Property Type Description
CancelledCount Long The amount of transactions in status “Cancelled”.
ConfirmedCount Long The amount of transactions in status “Confirmed”.
OpenCount Long The amount of transactions in status “Open”.

Creative

GetCreativesPerType

Several web services expect creative identifiers as an input parameter. This method provides you with the necessary input.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/Toolbox.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php 
 
    // Set webservice endpoint 
    $wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/Toolbox.wsdl";
 
    // Set namespace and security utility for SOAP authentication
    $namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
    $wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
    $created = date(DATE_ATOM);
 
    // Set credentials
    $username = ''; // enter your webservice user
    $password = ''; // enter the password of your webservice user
    
    // Put together SOAP header for authentication
    $token = new stdClass;
    $token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
    $token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
    $token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
    $auth = new stdClass;
    $auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
    $soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
    // Create Soap Client object
    $client = new SoapClient($wsdl);
 
    // Set SOAP Header
    $client->__setSoapHeaders($soapHeader);
 
    $response = $client->GetCreativesPerType(array(
      'ProgramId' => '', // enter your Program Id
      'CreativeType' => 'Banner' // valid values are "Text", "Banner" and "HTML"
    ));
 
    // Show response
    print_r($response);
        

Parameters

Parameter Type Description
CreativeType required Enum

The basic type of the requested creatives.

Possible values are:

  • Text
  • Banner
  • HTML

ProgramId required Integer The ID of the requesting advertiser

Response

Property Type Description
CreativeCollection Array of Creative List of all creatives of the requested creative type

Creative

Property Type Description
CreativeNumber Integer The Id of the found creative. Please note that the combination of ProgramId, CreativeType and CreativeNumber form a unique identifier.
CreativeName String The name of the found creative

Rate Management

GetRateList

Several web services expect rate identifiers as an input parameter. This method provides you with the necessary input.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/Toolbox.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php 
 
    // Set webservice endpoint 
    $wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/Toolbox.wsdl";
 
    // Set namespace and security utility for SOAP authentication
    $namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
    $wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
    $created = date(DATE_ATOM);
 
    // Set credentials
    $username = ''; // enter your webservice user
    $password = ''; // enter the password of your webservice user
    
    // Put together SOAP header for authentication
    $token = new stdClass;
    $token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
    $token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
    $token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
    $auth = new stdClass;
    $auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
    $soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
    // Create Soap Client object
    $client = new SoapClient($wsdl);
 
    // Set SOAP Header
    $client->__setSoapHeaders($soapHeader);
 
    $response = $client->GetRateList(array(
      'ProgramId' => '', // enter your Program Id
    ));
 
    // Show response
    print_r($response);
        

Parameters

Parameter Type Description
ProgramId required Integer The ID of the requesting advertiser

Response

Property Type Description
RateCollection Array of Rate List of all rates which the requesting program has defined

Rate

Property Type Description
RateNumber Integer The number of the found rate – the combination of rate mode, rate number and the program ID is a unique identifier.
RateMode Enum

The commission mode which is used to remunerate the transaction.

Possible values are:

  • Click
  • ClickOut
  • Sale
  • Lead

RateName String The name of the found rate

Publisher Management

GetChannels

Programs can organize their publishers in two separate channel groups. Each channel group can have multiple channels. This method provides you with the channels, which have been defined for this program.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/Toolbox.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php 
 
    // Set webservice endpoint 
    $wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/Toolbox.wsdl";
 
    // Set namespace and security utility for SOAP authentication
    $namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
    $wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
    $created = date(DATE_ATOM);
 
    // Set credentials
    $username = ''; // enter your webservice user
    $password = ''; // enter the password of your webservice user
    
    // Put together SOAP header for authentication
    $token = new stdClass;
    $token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
    $token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
    $token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
    $auth = new stdClass;
    $auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
    $soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
    // Create Soap Client object
    $client = new SoapClient($wsdl);
 
    // Set SOAP Header
    $client->__setSoapHeaders($soapHeader);
 
    $response = $client->GetChannels(array(
      'ProgramId' => '', // enter your Program Id
      'ChannelGroup' => 'ChannelGroup1' // possible values are "ChannelGroup1" and "ChannelGroup2"
    ));
 
    // Show response
    print_r($response);
        

Parameters

Parameter Type Description
ChannelGroup required Enum

In this parameter, you can define, of which channel group you wish to receive the single channels.

Possible values are:

  • ChannelGroup1
  • ChannelGroup2

ProgramId required Integer The ID of the requesting advertiser

Response

Property Type Description
ChannelCollection Array of Channel List of all channels of the requested channel group

Channel

Property Type Description
ChannelId Integer The ID of the found channel
ChannelName String The name of the found channel

GetPublisherSegments

Programs can organize their publishers freely in any number of publisher segments for various uses, e.g. statistics, business models, mailings, etc... Several web services expect publisher segment identifiers as an input parameter. This method provides you with these identifiers.

Endpoint

https://advertiser-webservices.affili.net/V4/WSDLFactory/Toolbox.wsdl

Sample Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php 
 
    // Set webservice endpoint 
    $wsdl = "https://advertiser-webservices.affili.net/V4/WSDLFactory/Toolbox.wsdl";
 
    // Set namespace and security utility for SOAP authentication
    $namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
    $wssecurity = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
    $created = date(DATE_ATOM);
 
    // Set credentials
    $username = ''; // enter your webservice user
    $password = ''; // enter the password of your webservice user
    
    // Put together SOAP header for authentication
    $token = new stdClass;
    $token->Username = new SoapVar($username, XSD_STRING, null, null, null, $namespace);
    $token->Password = new SoapVar($password, XSD_STRING, null, null, null, $namespace);
    $token->Created = new SoapVar($created, XSD_STRING, null, null, null, $wssecurity); 
    $auth = new stdClass;
    $auth->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $namespace);
    $soapHeader = new SoapHeader($namespace, 'Security', $auth, true);
 
    // Create Soap Client object
    $client = new SoapClient($wsdl);
 
    // Set SOAP Header
    $client->__setSoapHeaders($soapHeader);
 
    $response = $client->GetPublisherSegments(array(
      'ProgramId' => '', // enter your Program Id
    ));
 
    // Show response
    print_r($response);
        

Parameters

Parameter Type Description
ProgramId required Integer The ID of the requesting advertiser

Response

Property Type Description
PublisherSegmentCollection Array of PublisherSegment List of all publisher segments which the requesting program has defined

PublisherSegment

Property Type Description
SegmentId Integer The ID of the found publisher segment
SegmentName String The name of the found publisher segment
Description String A description on the found publisher segment

Order Validation

Method Overview

affilinet provides a SOAP API to automate the validation of orders. Please use the following endpoint to send requests: https://advertiser-webservices.affili.net/V4/WSDLFactory/OrderManagement.wsdl

The following functionality is provided:

Retrieving lists of orders and basket items

Method GetOrders

This method provides all orders (and baskets) that fit the selected search parameters.

Method GetBasketItems

This method returns the basket items that are part of the requested basket.

Validation of orders und baskets

Method UpdateTransaction

With this method, an existing transaction can be edited: the status and the net price of the transaction can be changed.

Method UpdateBasketItem

This method can be used in order to update (e.g. change the quantity) or cancel a single item of a basket. Basket items can only be updated if the appendant basket has the status „Open“.

Method UpdateBasket

With this method the status of a basket can be changed.

Validation of orders

The following process is suggested to validate orders:

  1. Identification of those orders you want to validate
  2. Validation of the orders

Identification of orders via GetOrders

Using the method GetOrders you can identify the orders you want to validate with the help of several filters:

Optional parameters:

  • OrderId, TransactionId, BasketId:
    get orders that have a specific Order ID, Transaction ID or Basket ID

  • TransactionStatus:
    get orders that have a specific status

  • Channel1, Channel2:
    get orders generated by publishers of a specific channel

  • PublisherSegment:
    get orders generated by publishers of a specific publisher segment

  • PublisherIds:
    get orders generated by specific publishers, submitting their IDs

  • CreativeInfo:
    get orders that were triggered via a specific creative

  • NetPriceMin, NetPriceMax:
    get orders within a specific price range

  • PublisherCommissionMin, PublisherCommissionMax:
    get orders within a specific publisher commission range

  • RateMode, RateNumber:
    get orders hat were remunerated with a specific rate

  • CancellationReason:
    get orders cancelled for a specific CancellationReason

Mandatory parameters:

  • ProgramId
  • StartDate & EndDate
  • Page & PageSize

Find the method documentation above on this site: GetOrders (v4)

Validation of orders

Using the method UpdateTransaction the identified orders can be validated by confirming or cancelling the order. In addition UpdateTransaction provides the possibility to update the net price of an order and reopen an order in case its status is cancelled. You can update one order per request.

Order identifiers

To identify the orders that you want to validate the following parameters can be used:
OrderId, RateMode and RateNumber

or as an alternative:

TransactionId

The combination of OrderId, RateMode and RateNumber as well as TransactionId are unique identifiers of an order within the affilinet system. All these properties (OrderId, RateMode, RateNumber and TransactionId) are part of the response of GetOrders.

Possible Actions

By using the request parameter Action you can define what kind of update to do. The following values can be set as Action:

  • SetConfirmed (to set the order status to “Confirmed”)
  • SetCancelled (to set the order status to “Cancelled“)
  • SetNewNetPrice (to change the net price of the order (partial cancellation))
  • SetOpen (to reset the order status from „Cancelled“ to „Open)

Order Confirmation

To confirm an order Action = “SetConfirmed” is submitted.

Mandatory parameters

  • OrderId, RateMode & RateNumber or TransactionId
  • ProgramId
  • Action

Order Cancellation

To cancel an order Action = “SetCancelled” is submitted. Additionally you have to submit a CancellationReason (as free text).

Mandatory parameters

  • OrderId, RateMode & RateNumber or TransactionId
  • ProgramId
  • Action
  • CancellationReason

Net price adjustment (partial cancellation)

To change the net price of an order Action = “SetNewNetPrice” has to be submitted. The new price is set using the parameter NewNetPrice. Additionally you have to submit a CancellationReason (as free text).

Mandatory parameters

  • OrderId, RateMode & RateNumber or TransactionId
  • ProgramId
  • Action
  • NewNetPrice
  • CancellationReason

Reopen an order

To reopen an order (set order status to „Open“) Action = “SetOpen” is submitted.

Mandatory parameters

  • OrderId, RateMode & RateNumber or TransactionId
  • ProgramId
  • Action
  • NewNetPrice
  • CancellationReason

Response

As response the property successful is returned (bool): if the request has succeeded successful=“true” is returned, otherwise an exception is thrown.

Via the method GetOrders you can check if the order updates were processed successfully by comparing the actual with the expected order status.

Find the method documentation above on this site: UpdateTransaction (v4)

Validation of baskets

The following process is suggested to validate baskets:

  1. Identification of the basket items you want to adjust before validating the basket
  2. Update of the identified basket items
  3. Check if the basket items were updated successfully
  4. Validation of the basket as soon as all basket items have the expected status

Identification of basket items via GetBasketItems

Using the method GetBasketItems you can identify the basket items you want to update with the help of several filters:

Optional parameters:

  • OrderId, BasketId:
    get basket items that have a specific Order ID or Basket ID

  • ArticleNumber:
    get basket items that have a specific article number

  • PositionNumber:
    get the basket item that has a specific position in the basket

  • Category:
    get basket items of a specific category

  • RateQuery:
    get basket items that are remunerated with a specific rate

  • StartDate & EndDate:
    get basket items created within a specified time range

  • Status:
    get basket items that have a specific status (“Open” or “Cancelled”)

Mandatory parameters:

  • ProgramId
  • CurrentPage & PageSize

Find the method documentation above on this site: GetBasketItems (v4)

Updating basket items

With the method UpdateBasketItem the identified basket items can be updated, one item per request.

Basket item identifiers

The following parameters can be used to identify which basket item to update:

BasketId and PositionNumber

or alternatively:

OrderId and ArticleNumber

The combination of BasketId and PositionNumber as well as the combination of OrderId and ArticleNumber are used as unique identifiers of a basket item within the affilinet system. BasketId, PositionNumber and ArticleNumber are returned as part of the response of the method GetBasketItems.

Possible actions

The method UpdateBasketItem provides two possible actions:

  • Cancellation of a basket item
  • Changing the quantity of a basket item

Cancellation of a basket item

To cancel a basket item the parameter CancellationReason has to be submitted, using one of the following values:

  • NotCancelled
  • FailedCreditCheck
  • SaleCancelledByCustomer
  • ItemReturned
  • ItemOutOfStock
  • DuplicatedOrder
  • BreachOfCampaignTermsAndConditions
  • Other

Mandatory parameters:

  • BasketId & PositionNumber or OrderId & ArticleNumber
  • ProgramId
  • CancellationReason

Changing the quantity of a basket item

To change the quantity of a basket item the parameter Quantity has to be submitted.

Mandatory parameters:

  • OrderId, RateMode & RateNumber or TransactionId
  • ProgramId
  • Quantity

Response

In case the request has succeeded technically Successful = true is returned as response. Otherwise an Exception is thrown.

The response only refers to the successfully submitted request on a technical level.

Find the documentation here: UpdateBasketItem (v4)

Check of the basket item updates via GetBasketItems

When updating basket items via UpdateBasketItem the response consists of the information if the request was successfully submitted.

After an update request is successfully submitted an asynchronous process is started to validate the request and actually perform the basket item updates in case validation passes. To check if the updates were successfully made you can check the status of the concerned basket items using GetBasketItems and compare the actual with the expected status.

Find the documentation here: GetBasketItems (v4)

Validation of baskets

As soon as all basket items of a basket have the expected status (Status check see here) the basket can be validated in a final step using UpdateBasket by confirming or cancelling the basket. In addition UpdateBasket provides the possibility to reopen a basket in case it has the status “cancelled”.

Basket identifiers

To identify the basket that you wish to validate you can use the following parameters:

BasketId

or alternatively:

OrderId and PublisherId (As several baskets with the same OrderId can exist, the PublisherId has to be submitted in addition to the OrderId)

Possible actions

By using the request parameter Action you can define what kind of update to do. The following values can be set as Action:

  • SetConfirmed (to set the basket status to „Confirmed”)
  • SetCancelled (to set the basket status to “Cancelled”)
  • SetOpen (to reopen the basket (set the status from “Cancelled” to “Open”)

Confirmation of a basket

To confirm a basket “SetConfirmed” is submitted as Action.

Mandatory parameters

  • BasketId or OrderId & PublisherId (optional)
  • ProgramId
  • Action

Cancellation of a basket

To confirm a basket “SetCancelled” is submitted as Action. In addition the parameter CancellationReason has to be submitted (as free text).

Mandatory parameters

  • BasketId or OrderId & PublisherId (optional)
  • ProgramId
  • Action
  • CancellationReason

Resetting a basket to „Open“

To reset a basket to the status “Open” after it was already cancelled „SetOpen” is submitted as Action.

Mandatory parameters

  • BasketId or OrderId & PublisherId (optional)
  • ProgramId
  • Action

Response

In case the request has succeeded technically Successful = true is returned as response. Otherwise an Exception is thrown.

The response only refers to the successfully submitted request on a technical level.

Find the documentation here: UpdateBasket (v4)