AffiliateService API

AffiliateService API

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.


AffiliateService.affClawbacks

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

Required Parameters

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

Sample Request

<?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>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><array><data/></array></value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$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);

AffiliateService.affCommissions

This method is used to retrieve all commissions for a specific affiliate within a date range

Required Parameters

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

Sample Request

<?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>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><array><data/></array></value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$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.

Required Parameters

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

Sample Request

<?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>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><array><data/></array></value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$affiliateId = 123;
$links = $app->getRedirectLinksForAffiliate($affiliateId)

AffiliateService.affPayouts

This method is used to retrieve all payments for a specific affiliate within a date range

Required Parameters

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

Sample Request

<?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>

Sample Response

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><array><data/></array></value>
    </param>
  </params>
</methodResponse>

PHP iSDK Sample

$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);

AffiliateService.affRunningTotals

The affRunningTotals method is used to retrieve the current balances for Amount Earned, Clawbacks, and Running Balance.

Required Parameters

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

Sample Request

<?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>

Sample Response

<?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>

PHP iSDK Sample

$affiliateIds = array(123,456,789);
$totals = $app->affPayouts($affiliateIds);

AffiliateService.affSummary

The affSummary method is used to retrieve a summary of statistics for a list of affiliates

Required Parameters

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

Sample Request

<?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>

Sample Response

<?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>

PHP iSDK Sample

$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);