APIAffiliateService is used to pull commission data and activities for affiliates. With this service, you have access to Clawbacks, Commissions, Payouts, Running Totals, and the Activity Summary. The methods in the APIAffiliateService mirror the reports produced inside Infusionsoft. To manage affiliate information (ie Name, Phone, etc.) you will need to use the DataService.
The affClawbacks method is used when you need to retrieve all clawed back commissions for a particular affiliate. Claw backs typically occur when an order has been refunded to the customer
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
affiliateId | int | The Id number for the affiliate record you would like the claw backs for |
filterStartDate | dateTime | The starting date for the date range which you would like affiliate claw backs for |
filterEndDate | dateTime | The ending date for the date range which you would like the affiliate claw backs for |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>APIAffiliateService.affClawbacks</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>affiliateId</int></value> </param> <param> <value><dateTime.iso8601>startDate</dateTime.iso8601></value> </param> <param> <value><dateTime.iso8601>endDate</dateTime.iso8601></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value><array><data/></array></value> </param> </params> </methodResponse>
$affiliateId = 123; $start = date('Ymd\TH:i:s',mktime(00,00,00,09,01,2008)); $finish = date('Ymd\TH:i:s',mktime(00,00,00,09,30,2008)); $claws = $app->affClawbacks($affiliateId, $start, $finish);
This method is used to retrieve all commissions for a specific affiliate within a date range
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
affiliateId | int | The Id number for the affiliate record you would like the claw backs for |
filterStartDate | dateTime | The starting date for the date range which you would like affiliate commissions for |
filterEndDate | dateTime | The ending date for the date range which you would like the affiliate commissions for |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>APIAffiliateService.affCommissions</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>affiliateId</int></value> </param> <param> <value><dateTime.iso8601>startDate</dateTime.iso8601></value> </param> <param> <value><dateTime.iso8601>endDate</dateTime.iso8601></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value><array><data/></array></value> </param> </params> </methodResponse>
$affiliateId = 123; $start = date('Ymd\TH:i:s',mktime(00,00,00,09,01,2008)); $finish = date('Ymd\TH:i:s',mktime(00,00,00,09,30,2008)); $comms = $app->affCommissions($affiliateId, $start, $finish);
Gets a list of the Redirect Links for the specified Affiliate.
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
affiliateId | int | The Id number for the affiliate record you would like the redirect links for |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>AffiliateService.getRedirectLinksForAffiliate</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>affiliateId</int></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value><array><data/></array></value> </param> </params> </methodResponse>
$affiliateId = 123; $links = $app->getRedirectLinksForAffiliate($affiliateId)
This method is used to retrieve all payments for a specific affiliate within a date range
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
affiliateId | int | The Id number for the affiliate record you would like the claw backs for |
filterStartDate | dateTime | The starting date for the date range which you would like affiliate payments for |
filterEndDate | dateTime | The ending date for the date range which you would like the affiliate payments for |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>APIAffiliateService.affPayouts</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>affiliateId</int></value> </param> <param> <value><dateTime.iso8601>startDate</dateTime.iso8601></value> </param> <param> <value><dateTime.iso8601>endDate</dateTime.iso8601></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value><array><data/></array></value> </param> </params> </methodResponse>
$affiliateId = 123; $start = date('Ymd\TH:i:s',mktime(00,00,00,09,01,2008)); $finish = date('Ymd\TH:i:s',mktime(00,00,00,09,30,2008)); $pays = $app->affPayouts($affiliateId, $start, $finish);
The affRunningTotals method is used to retrieve the current balances for Amount Earned, Clawbacks, and Running Balance.
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
affiliateIds | array | An integer array of the affiliate Id numbers that you would like the balances for |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>APIAffiliateService.affRunningTotals</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><array> <data> <value><int>affList1</int></value> <value><int>affList2</int></value> <value><int>affList3</int></value> </data> </array></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <array> <data> <value> <struct> <member> <name>Clawbacks</name> <value><double>0.0</double></value> </member> <member> <name>AmountEarned</name> <value><double>0.5483</double></value> </member> <member> <name>Payments</name> <value><double>0.0</double></value> </member> <member> <name>RunningBalance</name> <value><double>0.5483</double></value> </member> <member> <name>AffiliateId</name> <value><i4>2</i4></value> </member> </struct> </value> <value> <struct> <member> <name>Clawbacks</name> <value><double>0.0</double></value> </member> <member> <name>AmountEarned</name> <value><double>0.0</double></value> </member> <member> <name>Payments</name> <value><double>0.0</double></value> </member> <member> <name>RunningBalance</name> <value><double>=0.0</double></value> </member> <member> <name>AffiliateId</name> <value><i4>4</i4></value> </member> </struct> </value> <value> <struct> <member> <name>Clawbacks</name> <value><double>0.0</double></value> </member> <member> <name>AmountEarned</name> <value><double>0.0</double></value> </member> <member> <name>Payments</name> <value><double>0.0</double></value> </member> <member> <name>RunningBalance</name> <value><double>0.0</double></value> </member> <member> <name>AffiliateId</name> <value><i4>6</i4></value> </member> </struct> </value> </data> </array> </value> </param> </params> </methodResponse>
$affiliateIds = array(123,456,789); $totals = $app->affPayouts($affiliateIds);
The affSummary method is used to retrieve a summary of statistics for a list of affiliates
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
affiliateId | int | An array of Affiliate Id numbers you would like stats for |
filterStartDate | dateTime | The starting date for the date range which you would like affiliate stats for |
filterEndDate | dateTime | The ending date for the date range which you would like the affiliate stats for |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>APIAffiliateService.affSummary</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><array> <data> <value><int>affList1</int></value> <value><int>affList2</int></value> <value><int>affList3</int></value> </data> </array></value> </param> <param> <value><dateTime.iso8601>startDate</dateTime.iso8601></value> </param> <param> <value><dateTime.iso8601>endDate</dateTime.iso8601></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <array> <data> <value> <struct> <member> <name>Clawbacks</name> <value><double>0.0</double></value> </member> <member> <name>AmountEarned</name> <value><double>0.0</double></value> </member> <member> <name>Balance</name> <value> <double>0.0</double></value> </member> <member> <name>AffiliateId</name> <value><i4>2</i4></value> </member> </struct> </value> <value> <struct> <member> <name>Clawbacks</name> <value><double>0.0</double></value> </member> <member> <name>AmountEarned</name> <value><double>0.0</double></value> </member> <member> <name>Balance</name> <value><double>0.0</double></value> </member> <member> <name>AffiliateId</name> <value><i4>4</i4></value> </member> </struct> </value> <value> <struct> <member> <name>Clawbacks</name> <value><double>0.0</double></value> </member> <member> <name>AmountEarned</name> <value><double>0.0</double></value> </member> <member> <name>Balance</name> <value><double>0.0</double></value> </member> <member> <name>AffiliateId</name> <value><i4>6</i4></value> </member> </struct> </value> </data> </array> </value> </param> </params> </methodResponse>
$affiliateIds = array(123,456,789); $start = date('Ymd\TH:i:s',mktime(00,00,00,09,01,2008)); $finish = date('Ymd\TH:i:s',mktime(00,00,00,09,30,2008)); $pays = $app->affSummary($affiliateIds, $start, $finish);