Module: Infusionsoft::Client::Affiliate

Included in:
Infusionsoft::Client
Defined in:
lib/infusionsoft/client/affiliate.rb

Overview

Note:

To manage affiliate information (ie Name, Phone, etc.) you will need to use the Data service.

The Affiliate service 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 Affiliate service mirror the reports produced inside Infusionsoft.

Instance Method Summary collapse

Instance Method Details

#affiliate_clawbacks(affiliate_id, start_date, end_date) ⇒ Array

Used when you need to retrieve all clawed back commissions for a particular affiliate.

Parameters:

  • affiliate_id (Integer)

Returns:

  • (Array)

    all claw backs for the given affiliate that have occurred within the date range specified



17
18
19
# File 'lib/infusionsoft/client/affiliate.rb', line 17

def affiliate_clawbacks(affiliate_id, start_date, end_date)
  response = xmlrpc('APIAffiliateService.affClawbacks', affiliate_id, start_date, end_date)
end

#affiliate_commissions(affiliate_id, start_date, end_date) ⇒ Array

Used to retrieve all commissions for a specific affiliate within a date range.

Parameters:

  • affiliate_id (Integer)
  • start_date (Date)
  • end_date (Date)

Returns:

  • (Array)

    all sales commissions for the given affiliate earned within the date range specified



28
29
30
# File 'lib/infusionsoft/client/affiliate.rb', line 28

def affiliate_commissions(affiliate_id, start_date, end_date)
  response = xmlrpc('APIAffiliateService.affCommissions', affiliate_id, start_date, end_date)
end

#affiliate_payouts(affiliate_id, start_date, end_date) ⇒ Array

Used to retrieve all payments for a specific affiliate within a date range.

Parameters:

  • affiliate_id (Integer)
  • start_date (Date)
  • end_date (Date)

Returns:

  • (Array)

    a list of rows, each row is a single payout



38
39
40
# File 'lib/infusionsoft/client/affiliate.rb', line 38

def affiliate_payouts(affiliate_id, start_date, end_date)
  response = xmlrpc('APIAffiliateService.affPayouts', affiliate_id, start_date, end_date)
end

#affiliate_running_totals(affiliate_list) ⇒ Array

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

Parameters:

  • affiliate_list (Array)

Returns:

  • (Array)

    all sales commissions for the given affiliate earned within the date range specified



47
48
49
# File 'lib/infusionsoft/client/affiliate.rb', line 47

def affiliate_running_totals(affiliate_list)
  response = xmlrpc('APIAffiliateService.affRunningTotals', affiliate_list)
end

#affiliate_summary(affiliate_list, start_date, end_date) ⇒ Array<Hash>

Used to retrieve a summary of statistics for a list of affiliates.

Parameters:

  • affiliate_list (Array)
  • start_date (Date)
  • end_date (Date)

Returns:

  • (Array<Hash>)

    a summary of the affiliates information for a specified date range



57
58
59
# File 'lib/infusionsoft/client/affiliate.rb', line 57

def affiliate_summary(affiliate_list, start_date, end_date)
  response = xmlrpc('APIAffiliateService.affSummary', affiliate_list, start_date, end_date)
end