Affiliates

Operations for affiliates

Fetch Affiliates

POST /v1/networks/affiliatestable

This is the main endpoint to extract a list of affiliates from the API. It’s possible to filter the affiliates returned by this endpoint using 2 different methods (which can be combined) :

  • Search Terms : equivalent to a text search (e.g. find affiliates with a name that contains the word “John”)
  • Query Filters : structured filters on predefined fields (e.g. find affiliates that are managed by Affiliate Manager John Doe)

Paging

This endpoint supports paging. Refer to our User Guide for usage.

This endpoint supports query filters.

search_terms object array
search_type string

The name of the field used for search. Only “name” is supported.

value string

The value to search.

filters object
account_status string

Filter affiliates based on a specific account status. Supported values are: “active”, “inactive”, “pending” and “suspended”.

account_manager_ids int array

Only include affiliates managed by the specified account managers.

network_account_executives_ids int array

Only include affiliates managed by the specified account executives.

billing_frequency string

Filter affiliates based on a specific billing frequency. Supported values are: “weekly”, “bimonthly”, “monthly”, “two_months”, “quarterly”, “manual” and “other”.

payment_type string

Filter affiliates based on a specific payment type. Supported values are: “none”, “pay”, “paypal”, “check”, “wire”, “direct_deposit”, “tipalti”, “paxum”, “veem”, “payoneer”, “bitcoin”, “webmoney”, “capitalist”, “transferwise”, “gift_card”, “masspay” and “skrill”.

labels string array

Only include affiliates matching the specified labels.

ran_traffic_in_last_hours int

Only include affiliates that ran traffic in the last amount of hours specified.

network_tracking_domain_ids int array

Only include affiliates running traffic on the specified tracking domains.

country_codes string array

Only include affiliates who’s address is in one of the countries specified

region_codes string array

Only include affiliates who’s address is in one of the regions specified. Note that region codes are not always globally unique so this filter is best used along with the country_codes filter.

Relationships

This endpoint supports the following additional relationships. Refer to our User Guide for usage.

Value Description
signup Includes the affiliate’s sign up information
users Includes the users that exist for the affiliate

The following examples are different variations of what you can pass as a payload in the following call :

cURL
curl --request POST 'https://api.eflow.team/v1/networks/affiliatestable' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT PAYLOAD>'

Example 1 : Fetch the active affiliates

{
  "filters": {
    "account_status": "active"
  },
}

To fetch, for example, the second page of 50 active affiliates and include their users, you would run the following call :

curl --request POST 'https://api.eflow.team/v1/networks/affiliatestable?page=2&page_size=50&relationship=users' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "filters": {
    "account_status": "active"
  },
}'

Example 2 : Fetch affiliates managed by affiliate manager with ID 2 that contain the word “Agency”

{
  "filters": {
    "account_manager_ids": [ 2 ]
  },
  "search_terms": [
    {
      "search_type": "name",
      "value": "Agency"
    }
  ]
}

Example 3 : Fetch active affiliates that have run traffic in the last 7 days :

{
  "filters": {
    "account_status": "active",
    "ran_traffic_in_last_hours": 168
  }
}
Response
{
  "affiliates":
  [
    {
      "network_affiliate_id": 7,
      "network_id": 1,
      "name": "Some Agency Inc.",
      "account_status": "active",
      "account_manager_id": 1,
      "account_manager_name": "John Doe",
      "account_executive_id": 0,
      "account_executive_name": "",
      "today_revenue": "$7.32",
      "time_created": 1664825245,
      "time_saved": 1664825245,
      "labels": [ "media_buyer" ],
      "balance": 0,
      "last_login": 1664985191,
      "global_tracking_domain_url": "",
      "network_country_code": "",
      "is_payable": false,
      "payment_type": "none"
    }
  ],
  "paging":
  {
    "page": 1,
    "page_size": 50,
    "total_count": 1
  }
}


Find By ID

GET /v1/networks/affiliates/:affiliateId

Relationships

This endpoint supports the following additional relationships. Refer to our User Guide for usage.

This endpoint supports additional relationships. You can ask for them using the relationship query parameter. Multiple relationships can be supplied repeating the relationship query parameter.

Value Description
reporting Includes reporting informations
billing Includes billing and invoicing informations
coupon_codes Includes a list of the affiliate’s coupon codes
users Includes the list of affiliate users
audits Includes the revision history of changes made to the affiliate
visibility Includes lists of visible, hidden and rejected offers
signup Includes the affiliate’s signup info
api Includes the affiliate’s API keys
traffic_source Includes the affiliate’s traffic sources
referral_link Includes the affiliate’s referral link
referrer Include the affiliate’s referer, if any
referral Includes the affiliate’s referral info
supply_partner Includes the affiliate’s EverXchange settings

Path Parameters

Parameter Description
affiliateId The ID of the affiliate you want to fetch

cURL
curl --request GET 'https://api.eflow.team/v1/networks/affiliates/1' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
 {
    "network_affiliate_id": 1,
    "network_id": 346,
    "name": "Google",
    "account_status": "active",
    "network_employee_id": 6,
    "internal_notes": "",
    "has_notifications": true,
    "network_traffic_source_id": 0,
    "account_executive_id": 0,
    "adress_id": 0,
    "default_currency_id": "USD",
    "is_contact_address_enabled": false,
    "enable_media_cost_tracking_links": true,
    "time_created": 1554517251,
    "time_saved": 1560453624,
    "relationship": {
        "labels": {
            "total": 1,
            "entries": [
                "Direct"
            ]
        },
        "account_manager": {
            "first_name": "Bob",
            "last_name": "Smith",
            "email": "my.everflow@gmail.com",
            "work_phone": "",
            "cell_phone": "",
            "instant_messaging_id": 1,
            "instant_messaging_identifier": "peter_mobaff"
        },
        "encoded_value": "28KL6"
    },
    "referrer_id": 0
}

Create

POST /v1/networks/affiliates

name string

The name of the affiliate

account_status string

The affiliate’s account status. Can either be active or inactive.

network_employee_id int

The employee id of the affiliate’s account manager.

internal_notes int

Internal notes for network usage

default_currency_id string

The affiliate’s default currency. Can be found using the metadata API

enable_media_cost_tracking_links boolean

Whether or not you want to allow affiliate to pass and override cost in their tracking links. Defaults to false.

referrer_id int

The id of the affiliate that referred the new affiliate. Defaults to 0 (none).

is_contact_address_enabled boolean

Whether or not you want to include a contact address for this affiliate. Defaults to false.

network_affiliate_tier_id int

The ID of the Affiliate Tier.

contact_address object

The affiliate’s contact address information. Only required if “is_contact_address_enabled” is set to true.

address_1 string

The address first line

address_2 string

The address second line

city string

The city name

region_code string

The region code. Can be found using the metadata API.

country_code string

The country code. Can be found using the metadata API.

zip_postal_code string

The ZIP or Postal code.

users object array

A list of affiliate users to be created along with the affiliate entity.

first_name string

The affiliate user’s first name

last_name string

The affiliate user’s last name

email string

The affiliate user’s email. Must be unique among all affiliate users. Is used to log in the platform.

account_status string

The affiliate user’s account status. Can be either active or inactive.

title string

The affiliate user’s title.

work_phone string

The affiliate user’s work phone number.

cell_phone string

The affiliate user’s cell phone number.

instant_messaging_id int

The id of an instant messaging platform. Allows you to save their identifier for further reference.

instant_messaging_identifier string

The affiliate user’s instant messaging identifier, if instant_messaging_id was different than 0.

language_id int

The affiliate user’s language id. This is limited to the value 1 (English).

timezone_id int

The affiliate user’s timezone id. Can be found using the metadata API.

currency_id string

The affiliate user’s currency id. Can be found using the metadata API

initial_password string

The affiliate user’s login password. If left empty, the affiliate will be sent an email asking to set their password. If supplied, the password must meet the following requirements :

  • At least 8 characters
  • One non-alphanumeric character
  • At least one uppercase
  • At least one lowercase
billing object

The affiliate’s billing information.

billing_frequency string

The affiliate’s invoicing frequency. Can be one of the following values: weekly, bimonthly, monthly, two_months, quarterly, manual or other.

payment_type string

The affiliate’s payment type. Can be one of the following values: none, pay, paypal, check, wire, direct_deposit, tipalti, payum, veem, payoneer, bitcoin, webmoney, capitalist, transferwise, gift_card, masspay or skrill

tax_id string

The affiliate’s tax id.

is_invoice_creation_auto boolean

Configures automatic invoice creations for the affiliate. Defaults to “false”.

auto_invoice_start_date string

Configures automatic invoice creation start date. Dates are formatted “YYYY-mm-dd”. Required if is_invoice_creation_auto is set to true.

default_invoice_is_hidden boolean

Configures whether invoices are hidden from the affiliate by default. Defaults to “false”.

invoice_generation_days_delay boolean

Configures how many days to wait for invoice generation after the specified billing period. Defaults to 0.

invoice_amount_threshold double

Configures the minimal amount required for an invoice to be generated. Sums below the threshold are rolled over to the next billing period. Defaults to 0.

default_payment_terms int

Configures the number of days that will be used as the payment term on generated invoices. Defaults to 0.

details object

The affiliate’s billing frequency details. Required when “billing_frequency” is set to anything else than “manual” or “other”.

day_of_week int

Specifies the day of the week, starting on. Required when “billing_frequency” is set to “weekly”.

day_of_month_one int

Specifies first the day of the month. Required when “billing_frequency” is set to “bimonthly”.

day_of_month_two int

Specifies second the day of the month. Required when “billing_frequency” is set to “bimonthly”.

day_of_month int

Specifies day of the month. Required when “billing_frequency” is set to “monthly”, “two_months” or “quarterly”.

starting_month int

Specifies the month from which the cycle is set to begin. Required when “billing_frequency” is set to “two_months” or “quarterly”.

billing object

The affiliate’s payment method details. Required when “payment_type” is set to anything else than “none”.

paxum_id string

The affiliate’s paxum id. Required when “payment_type” is set to “paxum”.

paypal_reception_method string

The reception method used with Paypal. Can be either “email”, “phone” or “paypal_account”. Required when “payment_type” is set to “paypal”.

reception_identifier string

The affiliate’s paypal reception identifier. Required when “payment_type” is set to “paypal”.

email string

The affiliate’s email. Required when “payment_type” is set to “payoneer” or “veem”.

is_existing_payee boolean

Whether you want to assign an existing payee id to this affiliate. Required when “payment_type” is set to “tipalti”.

idap string

The payee’s IDAP (Payee ID). Required when “payment_type” is set to “tipalti” and is_existing_payee is set to true.

first_name string

The affiliate’s first name. Required when “payment_type” is set to “veem”.

last_name string

The affiliate’s last name. Required when “payment_type” is set to “veem”.

phone string

The affiliate’s phone number, must be international format. Required when “payment_type” is set to “veem”.

country_iso string

The affiliate’s country ISO code. Required when “payment_type” is set to “veem”.

bank_name string

The affiliate’s bank name. Required when “payment_type” is set to “wire” or “direct_deposit”.

bank_address string

The affiliate’s bank address. Required when “payment_type” is set to “wire” or “direct_deposit”.

account_name string

The affiliate’s bank account name. Required when “payment_type” is set to “wire” or “direct_deposit”.

account_number string

The affiliate’s bank account number. Required when “payment_type” is set to “wire” or “direct_deposit”.

routing_number string

The affiliate’s bank routing number. Required when “payment_type” is set to “wire” or “direct_deposit”.

swift_code string

The affiliate’s swift code. Required when “payment_type” is set to “wire” or “direct_deposit”.

{   
    "name": "Test Affiliate",
    "account_status": "active",
    "network_employee_id": 1,
    "internal_notes": "This is a test affiliate created using the API",
    "default_currency_id": "USD",
    "enable_media_cost_tracking_links": false,
    "referrer_id": 0,
    "is_contact_address_enabled": true,
    "contact_address": {
        "address_1": "105 Ocean Avenue",
        "address_2": "",
        "city": "Los Angeles",
        "region_code": "CA",
        "country_code": "US",
        "zip_postal_code": "GHGHGH"
    },
    "users": [
        {
            "first_name": "Bob",
            "last_name": "Smith",
            "email": "everflow.test@example.com",
            "account_status": "active",
            "initial_password": "J0hnD0e2020!",
            "language_id": 1,
            "timezone_id": 90,
            "currency_id": "USD"
        }
    ],
    "billing": {
        "billing_frequency": "monthly",
        "payment_type": "none",
        "tax_id": "XXXXX",
        "details": {
            "day_of_month": 1
        }
    }
}

Update

PUT /v1/networks/affiliates/:affiliateId

You must specify all the fields, not only the ones you wish to update. Omitting a field that is not marked as required will result in its default value being used or in the field getting deleted entirely.

The Bulk Edit endpoint documented below allows you to update only certain fields on an affiliate, which is much less error prone.

Path Parameters

Parameter Description
affiliateId The ID of the affiliate you want to update

name string

The name of the affiliate

account_status string

The affiliate’s account status. Can either be active or inactive.

network_employee_id int

The employee id of the affiliate’s account manager.

internal_notes string

Internal notes for network usage

default_currency_id string

The affiliate’s default currency. Can be found using the metadata API (insert link)

enable_media_cost_tracking_links boolean

Whether or not you want to allow affiliate to pass and override cost in their tracking links. Defaults to false.

referrer_id int

The id of the affiliate that referred the new affiliate. Defaults to 0 (none).

is_contact_address_enabled boolean

Whether or not you want to include a contact address for this affiliate. Defaults to false.

network_affiliate_tier_id int

The ID of the Affiliate Tier.

contact_address object

The affiliate’s contact address information. Only required if “is_contact_address_enabled” is set to true.

address_1 string

The address first line

address_2 string

The address second line

city string

The city name

region_code string

The region code. Can be found using the metadata API.

country_code string

The country code. Can be found using the metadata API.

zip_postal_code string

The ZIP or Postal code.

billing object

The affiliate’s billing information.

billing_frequency string

The affiliate’s invoicing frequency. Can be one of the following values: weekly, bimonthly, monthly, two_months, quarterly, manual or other.

payment_type string

The affiliate’s payment type. Can be one of the following values: none, pay, paypal, check, wire, direct_deposit, tipalti, payum, veem, payoneer, bitcoin, webmoney, capitalist, transferwise, gift_card, masspay or skrill

tax_id string

The affiliate’s tax id.

is_invoice_creation_auto boolean

Configures automatic invoice creations for the affiliate. Defaults to “false”.

auto_invoice_start_date string

Configures automatic invoice creation start date. Dates are formatted “YYYY-mm-dd”. Required if is_invoice_creation_auto is set to true.

default_invoice_is_hidden boolean

Configures whether invoices are hidden from the affiliate by default. Defaults to “false”.

invoice_generation_days_delay boolean

Configures how many days to wait for invoice generation after the specified billing period. Defaults to 0.

invoice_amount_threshold double

Configures the minimal amount required for an invoice to be generated. Sums below the threshold are rolled over to the next billing period. Defaults to 0, which is none.

default_payment_terms int

Configures the number of days that will be used as the payment term on generated invoices. Defaults to 0.

details object

The affiliate’s billing frequency details. Required when “billing_frequency” is set to anything else than “manual” or “other”.

day_of_week int

Specifies the day of the week, starting on. Required when “billing_frequency” is set to “weekly”.

day_of_month_one int

Specifies first the day of the month. Required when “billing_frequency” is set to “bimonthly”.

day_of_month_two int

Specifies second the day of the month. Required when “billing_frequency” is set to “bimonthly”.

day_of_month int

Specifies day of the month. Required when “billing_frequency” is set to “monthly”, “two_months” or “quarterly”.

starting_month int

Specifies the month from which the cycle is set to begin. Required when “billing_frequency” is set to “two_months” or “quarterly”.

billing object

The affiliate’s payment method details. Required when “payment_type” is set to anything else than “none”.

paxum_id string

The affiliate’s paxum id. Required when “payment_type” is set to “paxum”.

paypal_reception_method string

The reception method used with Paypal. Can be either “email”, “phone” or “paypal_account”. Required when “payment_type” is set to “paypal”.

reception_identifier string

The affiliate’s paypal reception identifier. Required when “payment_type” is set to “paypal”.

email string

The affiliate’s email. Required when “payment_type” is set to “payoneer” or “veem”.

is_existing_payee boolean

Whether you want to assign an existing payee id to this affiliate. Required when “payment_type” is set to “tipalti”.

idap string

The payee’s IDAP (Payee ID). Required when “payment_type” is set to “tipalti” and is_existing_payee is set to true.

first_name string

The affiliate’s first name. Required when “payment_type” is set to “veem”.

last_name string

The affiliate’s last name. Required when “payment_type” is set to “veem”.

phone string

The affiliate’s phone number, must be international format. Required when “payment_type” is set to “veem”.

country_iso string

The affiliate’s country ISO code. Required when “payment_type” is set to “veem”.

bank_name string

The affiliate’s bank name. Required when “payment_type” is set to “wire” or “direct_deposit”.

bank_address string

The affiliate’s bank address. Required when “payment_type” is set to “wire” or “direct_deposit”.

account_name string

The affiliate’s bank account name. Required when “payment_type” is set to “wire” or “direct_deposit”.

account_number string

The affiliate’s bank account number. Required when “payment_type” is set to “wire” or “direct_deposit”.

routing_number string

The affiliate’s bank routing number. Required when “payment_type” is set to “wire” or “direct_deposit”.

swift_code string

The affiliate’s swift code. Required when “payment_type” is set to “wire” or “direct_deposit”.

{   
    "name": "Test Affiliate",
    "account_status": "active",
    "network_employee_id": 1,
    "internal_notes": "This is a test affiliate created using the API",
    "default_currency_id": "USD",
    "enable_media_cost_tracking_links": false,
    "referrer_id": 0,
    "is_contact_address_enabled": true,
    "contact_address": {
        "address_1": "105 Ocean Avenue",
        "address_2": "",
        "city": "Los Angeles",
        "region_code": "CA",
        "country_code": "US",
        "zip_postal_code": "GHGHGH"
    },
    "billing": {
        "billing_frequency": "monthly",
        "payment_type": "none",
        "tax_id": "XXXXX",
        "details": {
            "day_of_month": 1,
        }
    }
}

Bulk Edit

PATCH /v1/networks/patch/affiliates/apply

This endpoint allows you to update selected fields of one or multiple affiliates at the same time. It does not require the entire affiliate object to be passed in the payload. Only the properties that need to be changed must be supplied.

Body Param

network_affiliate_ids int array

IDs of the affiliates to be patched.

fields object array

List of fields to patch. See here for the list of types and their corresponding values.

field_type string

Type of the field to patch. See here for the list of types.

field_value

Value of the field to patch. See here for the list of values.

operator string

Operator determining how the field will be used to modify the affiliates. Can be one of the following values: overwrite, append, delete, or clear. Not all options are possible for every field. append, delete and clear only apply for fields that contain multiple values.

Body Example

{
    "network_affiliate_ids": [
        3,
        12
    ],
    "fields": [
        {
            "field_type": "account_status",
            "field_value": "inactive",
            "operator": "overwrite"
        }
    ]
}

cURL
curl --request PATCH 'https://api.eflow.team/v1/networks/patch/affiliates/apply' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'

Example 1 : Deactivate multiple affiliates at the same time :

{
    "network_affiliate_ids": [
        3,
        12
    ],
    "fields": [
        {
            "field_type": "account_status",
            "field_value": "inactive",
            "operator": "overwrite"
        }
    ]
}

Example 2 : Add a label (without removing existing labels) to existing affiliates

{
    "network_affiliate_ids":
    [
        24,
        26
    ],
    "fields":
    [
        {
            "field_value":
            [
                "New Label"
            ],
            "field_type": "labels",
            "operator": "append"
        }
    ]
}
Response
{
  "result": true
}

Patch Preview

POST /v1/networks/patch/affiliates/submit

This endpoint works exactly the same way the Bulk Edit endpoint documented above does, with the important difference that it does not actually change anything. Rather, the endpoint will return of a preview of the changes and will flag any errors.

network_affiliate_ids int array

IDs of the affiliates to be patched.

fields object array

List of fields to patch. See here for the list of types and their corresponding values.

field_type string

Type of the field to patch. See here for the list of types.

field_value

Value of the field to patch. See here for the list of values.

operator string

Operator determining how the field will be used to modify the affiliates. Can be one of the following values: overwrite, append, delete, or clear.

Response
changes object array
network_affiliate object

An affiliate part of the patch submission.

network_affiliate_id int

ID of the affiliate.

name string

Name of the affiliate.

change_status string

Status of the change. Can be one of the following values: ok, no_change or error.

current_field object
field_type string

Type of the field before the patch. See here for the list of types.

field_value

Value of the field before the patch. See here for the list of values.

changed_field object
field_type string

Type of the field after the patch. See here for the list of types.

field_value

Value of the field after the patch. See here for the list of values.

error_message string

Error message for that particular field. Only filled when change_status is error.

related_changes string

Message detailing other changes that will happen as a consequence of the particular change.

resource_errors object array

If some of the affiliates that are part of the patch are not in a valid state prior to the patch, the patch will not be attempted and instead a list of the affiliates errors will be returned here.

id int

ID of the invalid affiliate.

label string

Name of the invalid affiliate.

message string

Message indicating in which way the affiliate is invalid.


Patchable Fields

The fields below are to be used in the Bulk Edit and Patch Preview endpoints documented above.

network_employee_id int

The employee ID of the affiliate’s account manager.

account_executive_id int

The employee ID of the affiliate’s account executive.

referrer_id int

The affiliate ID of the affiliate’s account that referred the target affiliate(s).

labels string array

The list of labels associated with the affiliate.

account_status string

Status of the affiliate. Can be one of the following values: active, inactive or suspended.

default_currency_id string

The affiliate’s default currency. Possible values can be found using the metadata API. Can be overwritten at the affiliate user level.

has_notifications boolean

Whether or not the affiliate can receive notifications.

enable_media_cost_tracking_links boolean

Determines whether the cost parameter will be processed or ignored when received on clicks.

network_traffic_source_id int

An optional tracking source ID that can be used for the affiliate.

internal_notes string

Internal notes are not visible

billing_payment_method string

The billing method used by the affiliate. Note that this field can only be used in conjunction with Everflow Pay, so the only possible value is pay. The account must be integrated with Everflow Pay in the first place.

billing_billing_frequency string

Affiliate billing frequency. Possible values are : weekly, bimonthly, monthly, two_months, quaterly, manual, other. Note that when setting the frequency, you must also set the rest of the frequency setting. For example, if you set the billing_billing_frequency to weekly, you must also set the billing_weekly property described below.

billing_weekly string

Only relevant when frequency is set to weekly. Possible values are monday, tuesday, wednesday, thursday, friday, saturday, sunday.

billing_bimonthly object

Only relevant when frequency is set to bimonthly.

day_of_month_one int

Specifies first day of the month.

day_of_month_two int

Specifies second day of the month.

billing_monthly object

Only relevant when frequency is set to monthly.

day_of_month int

Specifies day of the month.

billing_two_months object

Only relevant when frequency is set to two_months.

starting_month int

First month of the 2 months interval

day_of_month int

Day of the month

billing_quarterly object

Only relevant when frequency is set to quaterly.

starting_month int

First month of the quarter period

day_of_month int

Day of the month

billing_is_invoice_creation_auto boolean

Determines whether invoices are generated automatically or not.

billing_invoice_amount_threshold double

Minimum amount that must be reached before an invoice is generated.

billing_auto_invoice_start_date date

Only relevant when invoices are generated automatically. Date of the lookback window.

billing_invoice_generation_days_delay int

Number of days after the beginning of the billing period before the invoice is generated.

billing_default_payment_terms int

Number of days before the payment is sent

billing_default_invoice_is_hidden boolean

Determines whether invoices are hidden to affiliates or not by default.

referral_is_enabled boolean

Determines if referral commissions are enabled or not

referral_method string

Referral commission method. Possible values are flat_fee or percentage

referral_value double

Value of the referral commission

referral_commission_basis string

Determines if the commission is based on payout, revenue or profit.

referral_minimum_threshold double

Minimum amount that must be reached before a commission is paid.

referral_duration double

Number of days during which the referral commission is effective.