PDA

View Full Version : Affiliate Service API


andyc
23-01-08, 15:18
Hi,

I'd like to use the affiliate service API to refresh local tx records on say a daily basis and I'm trying to work out what getTransactionsList query I need to get the smallest set of transaction records back without missing anything.

For example, is it possible to get the set of new transaction records created since the last query by setting dStartDate to the last query's dEndDate for sDateType of transaction? For this to work the transactionDate would effectively need to be the transaction record creation timestamp. But I suspect the transaction date is set by the merchant to record when the transaction actually took place rather than when the transaction was entered into the affilate window system.

The same would apply for picking up validated transactions except that the validation date would effectively need to be the record update timestamp.

I can't see any way to get the set of transactions that have been paid since the last query.

I suspect that what's really needed to support this usage is a last_updated field in the transaction table (if there's not one already) and for the getTransactionList request sDateType parameter to include "updated". Any chance?

Whilst I'm on the topic, getTransactionList could do with a clickRef parameter!

Andy

jonnyplatt
25-01-08, 14:57
Hi Andy,

I seem to have been given a rather large quota on the affiliate api so I just loop through each month of the year and run a REPLACE on my table locally to ensure that commissions that have been confirmed or declined since last update are marked as so. It may be a long way round but it works for me. I guess you could use select and update statements to only update those that have changed, and then you can use a timestamp locally to see whats changed when checkking your own records.

I'm afraid I'm not sure whats wrong on your clickref query as I receive the clickref in the object returned by gettransactionlist. Might the problem be it's not getting set properly, or is it visible in your reports at AW?

$response= $oClient->call('getTransactionList', $params1);

$response=$response->getTransactionListReturn;
foreach ($response as $transaction) {
$clickref=$transaction->sClickref;
}

andyc
28-01-08, 10:36
Hi Jonny,

Thanks for your suggestion - nice and simple - which is good!

Regarding clickref, I meant that it would be good to have a click ref query parameter. If I had that I probably wouldn't have to maintain local transaction records. Curiously, getUntrackedTransactions does have a clickref query parameter.

Andy

Andy
28-01-08, 22:04
I use an MD5() hash made of the transactions data and add that to my DB table alongside the data

on updates, I check for the hash existing before I do any update, replace, insert.

works for me!