Edit Affiliate
PATCH /affiliate/edit_affiliate
Description | URL | Response Format | Request Method | Authentication |
---|---|---|---|---|
Edits an existing affiliate account | https://domain/api/affiliate/edit_affiliate | JSON | PATCH | HTTP headers |
Parameters
Parameters must be sent with the request body. The examples below show the parameters sent as x-www-form-urlencoded.
Name | Description | Type | Required |
---|---|---|---|
loginid | Id of affiliate to edit | string | yes |
password | Affiliate Password | string | no |
payvia | Payvia type id of the payvia type to use with this affiliate | integer | no |
Email address for this affiliate | string | no | |
status | ID of the account status for this affiliate | integer | no |
firstname | string | no | |
lastname | string | no | |
company | string | no | |
url | string | no | |
tel | string | no | |
icq | string | no | |
aim | string | no | |
msn | string | no | |
address1 | affiliate address line 1 | string | no |
address2 | affiliate address line 2 | string | no |
city | affiliate city | string | no |
state | affiliate state | string | no |
country | affiliate country | string | no |
zip_code | affiliate zip code | string | no |
tax_id_or_ssn | affiliate zip code | string | no |
ref | Tracking code to identifier who referred this affiliate | string | no |
minimum_payout | Threshold for generating affiliate payouts. Affiliate will not be paid until they earn at least this much. | string | no |
join_ip | string | no | |
custom1 | An additional custom value to store with this affiliate. (255 max) | string | no |
custom2 | An additional custom value to store with this affiliate. (255 max) | string | no |
custom3 | An additional custom value to store with this affiliate. (255 max) | string | no |
custom4 | An additional custom value to store with this affiliate. (255 max) | string | no |
custom5 | An additional custom value to store with this affiliate. (255 max) | string | no |
affiliate_manager_loginid | loginid of the Affiliate Manager to assign to the affiliate. Will add to existing, not replace | string | no |
Note
Possible values for status parameter are:
- 0 - Active
- 1 - Disabled
- 2 - Banned
- 3 - Wait on Verify
- 4 - Pending
- 5 - Denied
Example Request
PATCH
http://domain/api/affiliate/edit_affiliate
loginid = 4002
password = apitest
firstname = hello
lastname = test
email = hello@trackfinity.com
company = Trackfinity
url = trackfinity.com
tel = 666-666-6666
icq = 666666666
aim = sixsixsix
msn = sixsixtysix
address1 = 666 666 st
address2 =
city = My City
state = My State
country = USA
zip_code = 12345
Response:
[{"result":"Success","}]
Example Code
php
<?php
$curl = curl_init();
$url = 'http://domain/api/affiliate/edit_affiliate';
$headers = array(
'api-key: 44b5498dbcb481a0d00b404c0169af62',
'api-username: productsupport'
);
$data = array(
'loginid' => 4002,
'password' => 'apitest',
'firstname' => 'hello',
'lastname' => 'test',
'email' => 'hello3@trackfinity.com',
'company' => 'Trackfinity',
'url' => 'trackfinity.com',
'tel' => '666-666-6666',
'icq' => '666666666',
'aim' => 'sixsixsix',
'msn' => 'sixsixtysix',
'address1' => '666 666 st',
'address2' => '',
'city' => 'My City',
'state' => 'My State',
'country' => 'USA',
'zip_code' => '12345',
'join_ip' => '192.168.1.1',
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
$resp = curl_exec($curl);
//dumps an associative array representation of the json response
$output = json_decode($resp, true);
if($output !== NULL) {
//json was valid. Dump the decoded array
print_r($output);
}
else {
//invalid json, just dump the raw response
print_r($resp);
}
// Close request to clear up some resources
curl_close($curl);
?>