Class: HighLevel::Resources::AffiliateManager

Inherits:
Base
  • Object
show all
Defined in:
lib/high_level/resources/affiliate_manager.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from HighLevel::Resources::Base

Instance Method Details

#get_affiliate(location_id:, affiliate_id:, **_opts) ⇒ Object

Get Affiliate

Retrieve a single affiliate by id for a location.



24
25
26
27
28
29
30
# File 'lib/high_level/resources/affiliate_manager.rb', line 24

def get_affiliate(location_id:, affiliate_id:, **_opts)
  request(
    method: :get,
    path: "/affiliate-manager/#{location_id}/affiliates/#{affiliate_id}",
    security: ["bearer"]
  )
end

#list_affiliates(location_id:, query: nil, active: nil, campaign_id: nil, skip: nil, limit: nil, from_date: nil, to_date: nil, **_opts) ⇒ Object

List Affiliates

Retrieve the list of affiliates for a location.



12
13
14
15
16
17
18
19
# File 'lib/high_level/resources/affiliate_manager.rb', line 12

def list_affiliates(location_id:, query: nil, active: nil, campaign_id: nil, skip: nil, limit: nil, from_date: nil, to_date: nil, **_opts)
  request(
    method: :get,
    path: "/affiliate-manager/#{location_id}/affiliates",
    security: ["bearer"],
    params: { "query" => query, "active" => active, "campaignId" => campaign_id, "skip" => skip, "limit" => limit, "fromDate" => from_date, "toDate" => to_date }.compact
  )
end

#list_commissions(location_id:, campaign_id: nil, affiliate_id: nil, status: nil, query: nil, skip: nil, limit: nil, from_date: nil, to_date: nil, **_opts) ⇒ Object

List Commissions

Retrieve the list of commissions for a location.



47
48
49
50
51
52
53
54
# File 'lib/high_level/resources/affiliate_manager.rb', line 47

def list_commissions(location_id:, campaign_id: nil, affiliate_id: nil, status: nil, query: nil, skip: nil, limit: nil, from_date: nil, to_date: nil, **_opts)
  request(
    method: :get,
    path: "/affiliate-manager/#{location_id}/commissions",
    security: ["bearer"],
    params: { "campaignId" => campaign_id, "affiliateId" => affiliate_id, "status" => status, "query" => query, "skip" => skip, "limit" => limit, "fromDate" => from_date, "toDate" => to_date }.compact
  )
end

#list_payouts(location_id:, status: nil, query: nil, affiliate_id: nil, campaign_id: nil, skip: nil, limit: nil, start: nil, end_: nil, **_opts) ⇒ Object

List Payouts

Retrieve the list of payouts for a location.



35
36
37
38
39
40
41
42
# File 'lib/high_level/resources/affiliate_manager.rb', line 35

def list_payouts(location_id:, status: nil, query: nil, affiliate_id: nil, campaign_id: nil, skip: nil, limit: nil, start: nil, end_: nil, **_opts)
  request(
    method: :get,
    path: "/affiliate-manager/#{location_id}/payouts",
    security: ["bearer"],
    params: { "status" => status, "query" => query, "affiliateId" => affiliate_id, "campaignId" => campaign_id, "skip" => skip, "limit" => limit, "start" => start, "end" => end_ }.compact
  )
end