Retrieve an affiliate by code
Request parameters
Parameter
Type / Description
Request sample
<?php
$apiVersion = '6.0';
// $apiHost = "http://api.secure.avangate.local";
$apiHost = "http://api.sandbox34.avangate.local";
$host = $apiHost."/soap/" . $apiVersion . "/";
$client = new SoapClient($host."?wsdl", array('location' => $host, 'cache_wsdl' => WSDL_CACHE_NONE));
$client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');
// $merchantCode = "AKULAJQW";
// $key = "P5LX&a&9=4Z)1!2L2*0N";
$merchantCode = "lucian";
$key = "SECRET_KEY";
$date = gmdate('Y-m-d H:i:s');
$string = strlen($merchantCode) . $merchantCode . strlen($date) . $date;
$hash = hash_hmac('md5', $string, $key);
try {
$sessionID = $client->login($merchantCode, $date, $hash);
} catch (SoapFault $e) {
echo $e->getMessage();
}
var_dump("session: ". $sessionID);
$affiliateId = "79396127BA";
// Active:
// 1295 - 964CF2AF42
// 11541 - E4B69882C2
// 12951 - E8A1DB473C
// 12950 - 44857BFE94
// Pending:
// 13639 - F56BCF1E2E
// Rejected
// 65602 - 79396127BA
try {
$response = $client->getAffiliate($sessionID, $affiliateId);
print_r(json_encode($response));
} catch (SoapFault $e) {
echo $e->getMessage();
}
// print_r($response);Response parameters
Parameter
Description
Response sample
Last updated
Was this helpful?