Affiliates
Fetch Affiliates
/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.
Body Params
This endpoint supports query filters.
The name of the field used for search. Only “name” is supported.
The value to search.
Filter affiliates based on a specific account status. Supported values are: “active”, “inactive”, “pending” and “suspended”.
Only include affiliates managed by the specified account managers.
Only include affiliates managed by the specified account executives.
Filter affiliates based on a specific billing frequency. Supported values are: “weekly”, “bimonthly”, “monthly”, “two_months”, “quarterly”, “manual” and “other”.
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”.
Only include affiliates matching the specified labels.
Only include affiliates that ran traffic in the last amount of hours specified.
Only include affiliates running traffic on the specified tracking domains.
Only include affiliates who’s address is in one of the countries specified
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 |
Examples
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
/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 |
Request Example
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
/v1/networks/affiliates
Body Params
The name of the affiliate
The affiliate’s account status. Can either be active
or inactive
.
The employee id of the affiliate’s account manager.
Internal notes for network usage
The affiliate’s default currency. Can be found using the metadata API
Whether or not you want to allow affiliate to pass and override cost in their tracking links. Defaults to false.
The id of the affiliate that referred the new affiliate. Defaults to 0 (none).
Whether or not you want to include a contact address for this affiliate. Defaults to false.
The ID of the Affiliate Tier.
The affiliate’s contact address information. Only required if “is_contact_address_enabled” is set to true.
The address first line
The address second line
The city name
The region code. Can be found using the metadata API.
The country code. Can be found using the metadata API.
The ZIP or Postal code.
Used to associate labels to affiliate.
A list of affiliate users to be created along with the affiliate entity.
The affiliate user’s first name
The affiliate user’s last name
The affiliate user’s email. Must be unique among all affiliate users. Is used to log in the platform.
The affiliate user’s account status. Can be either active
or inactive
.
The affiliate user’s title.
The affiliate user’s work phone number.
The affiliate user’s cell phone number.
The id of an instant messaging platform. Allows you to save their identifier for further reference.
The affiliate user’s instant messaging identifier, if instant_messaging_id was different than 0.
The affiliate user’s language id. This is limited to the value 1
(English).
The affiliate user’s timezone id. Can be found using the metadata API.
The affiliate user’s currency id. Can be found using the metadata API
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
The affiliate’s billing information.
The affiliate’s invoicing frequency. Can be one of the following values: weekly
, bimonthly
, monthly
, two_months
, quarterly
, manual
or other
.
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
The affiliate’s tax id.
Configures automatic invoice creations for the affiliate. Defaults to “false”.
Configures automatic invoice creation start date. Dates are formatted “YYYY-mm-dd”. Required if is_invoice_creation_auto is set to true.
Configures whether invoices are hidden from the affiliate by default. Defaults to “false”.
Configures how many days to wait for invoice generation after the specified billing period. Defaults to 0.
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.
Configures the number of days that will be used as the payment term on generated invoices. Defaults to 0.
The affiliate’s billing frequency details. Required when “billing_frequency” is set to anything else than “manual” or “other”.
Specifies the day of the week, starting on. Required when “billing_frequency” is set to “weekly”.
Specifies first the day of the month. Required when “billing_frequency” is set to “bimonthly”.
Specifies second the day of the month. Required when “billing_frequency” is set to “bimonthly”.
Specifies day of the month. Required when “billing_frequency” is set to “monthly”, “two_months” or “quarterly”.
Specifies the month from which the cycle is set to begin. Required when “billing_frequency” is set to “two_months” or “quarterly”.
The affiliate’s payment method details. Required when “payment_type” is set to anything else than “none”.
The affiliate’s paxum id. Required when “payment_type” is set to “paxum”.
The reception method used with Paypal. Can be either “email”, “phone” or “paypal_account”. Required when “payment_type” is set to “paypal”.
The affiliate’s paypal reception identifier. Required when “payment_type” is set to “paypal”.
The affiliate’s email. Required when “payment_type” is set to “payoneer” or “veem”.
Whether you want to assign an existing payee id to this affiliate. Required when “payment_type” is set to “tipalti”.
The payee’s IDAP (Payee ID). Required when “payment_type” is set to “tipalti” and is_existing_payee is set to true.
The affiliate’s first name. Required when “payment_type” is set to “veem”.
The affiliate’s last name. Required when “payment_type” is set to “veem”.
The affiliate’s phone number, must be international format. Required when “payment_type” is set to “veem”.
The affiliate’s country ISO code. Required when “payment_type” is set to “veem”.
The affiliate’s bank name. Required when “payment_type” is set to “wire” or “direct_deposit”.
The affiliate’s bank address. Required when “payment_type” is set to “wire” or “direct_deposit”.
The affiliate’s bank account name. Required when “payment_type” is set to “wire” or “direct_deposit”.
The affiliate’s bank account number. Required when “payment_type” is set to “wire” or “direct_deposit”.
The affiliate’s bank routing number. Required when “payment_type” is set to “wire” or “direct_deposit”.
The affiliate’s swift code. Required when “payment_type” is set to “wire” or “direct_deposit”.
Payload Example
{
"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"
},
"labels":["test",
"type 1"],
"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
/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 |
Body Params
The name of the affiliate
The affiliate’s account status. Can either be active
or inactive
.
The employee id of the affiliate’s account manager.
Internal notes for network usage
The affiliate’s default currency. Can be found using the metadata API (insert link)
Whether or not you want to allow affiliate to pass and override cost in their tracking links. Defaults to false.
The id of the affiliate that referred the new affiliate. Defaults to 0 (none).
Whether or not you want to include a contact address for this affiliate. Defaults to false.
The ID of the Affiliate Tier.
The affiliate’s contact address information. Only required if “is_contact_address_enabled” is set to true.
The address first line
The address second line
The city name
The region code. Can be found using the metadata API.
The country code. Can be found using the metadata API.
The ZIP or Postal code.
Used to associate labels to affiliate.
The affiliate’s billing information.
The affiliate’s invoicing frequency. Can be one of the following values: weekly
, bimonthly
, monthly
, two_months
, quarterly
, manual
or other
.
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
The affiliate’s tax id.
Configures automatic invoice creations for the affiliate. Defaults to “false”.
Configures automatic invoice creation start date. Dates are formatted “YYYY-mm-dd”. Required if is_invoice_creation_auto is set to true.
Configures whether invoices are hidden from the affiliate by default. Defaults to “false”.
Configures how many days to wait for invoice generation after the specified billing period. Defaults to 0.
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.
Configures the number of days that will be used as the payment term on generated invoices. Defaults to 0.
The affiliate’s billing frequency details. Required when “billing_frequency” is set to anything else than “manual” or “other”.
Specifies the day of the week, starting on. Required when “billing_frequency” is set to “weekly”.
Specifies first the day of the month. Required when “billing_frequency” is set to “bimonthly”.
Specifies second the day of the month. Required when “billing_frequency” is set to “bimonthly”.
Specifies day of the month. Required when “billing_frequency” is set to “monthly”, “two_months” or “quarterly”.
Specifies the month from which the cycle is set to begin. Required when “billing_frequency” is set to “two_months” or “quarterly”.
The affiliate’s payment method details. Required when “payment_type” is set to anything else than “none”.
The affiliate’s paxum id. Required when “payment_type” is set to “paxum”.
The reception method used with Paypal. Can be either “email”, “phone” or “paypal_account”. Required when “payment_type” is set to “paypal”.
The affiliate’s paypal reception identifier. Required when “payment_type” is set to “paypal”.
The affiliate’s email. Required when “payment_type” is set to “payoneer” or “veem”.
Whether you want to assign an existing payee id to this affiliate. Required when “payment_type” is set to “tipalti”.
The payee’s IDAP (Payee ID). Required when “payment_type” is set to “tipalti” and is_existing_payee is set to true.
The affiliate’s first name. Required when “payment_type” is set to “veem”.
The affiliate’s last name. Required when “payment_type” is set to “veem”.
The affiliate’s phone number, must be international format. Required when “payment_type” is set to “veem”.
The affiliate’s country ISO code. Required when “payment_type” is set to “veem”.
The affiliate’s bank name. Required when “payment_type” is set to “wire” or “direct_deposit”.
The affiliate’s bank address. Required when “payment_type” is set to “wire” or “direct_deposit”.
The affiliate’s bank account name. Required when “payment_type” is set to “wire” or “direct_deposit”.
The affiliate’s bank account number. Required when “payment_type” is set to “wire” or “direct_deposit”.
The affiliate’s bank routing number. Required when “payment_type” is set to “wire” or “direct_deposit”.
The affiliate’s swift code. Required when “payment_type” is set to “wire” or “direct_deposit”.
Payload Example
{
"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"
},
"labels":["test",
"type 1"],
"billing": {
"billing_frequency": "monthly",
"payment_type": "none",
"tax_id": "XXXXX",
"details": {
"day_of_month": 1,
}
}
}
Bulk Edit
/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.
Request Body
Body Param
IDs of the affiliates to be patched.
List of fields to patch. See here for the list of types and their corresponding values.
Type of the field to patch. See here for the list of types.
Value of the field to patch. See here for the list of values.
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"
}
]
}
Request Examples
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
/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.
Body Params
IDs of the affiliates to be patched.
List of fields to patch. See here for the list of types and their corresponding values.
Type of the field to patch. See here for the list of types.
Value of the field to patch. See here for the list of values.
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
An affiliate part of the patch submission.
ID of the affiliate.
Name of the affiliate.
Status of the change. Can be one of the following values: ok
, no_change
or error
.
Error message for that particular field. Only filled when change_status
is error
.
Message detailing other changes that will happen as a consequence of the particular change.
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 of the invalid affiliate.
Name of the invalid affiliate.
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.
Fields
The employee ID of the affiliate’s account manager.
The employee ID of the affiliate’s account executive.
The affiliate ID of the affiliate’s account that referred the target affiliate(s).
The list of labels associated with the affiliate.
The name of the affiliate
Status of the affiliate. Can be one of the following values: active
, inactive
or suspended
.
The affiliate’s default currency. Possible values can be found using the metadata API. Can be overwritten at the affiliate user level.
Whether or not the affiliate can receive notifications.
Determines whether the cost
parameter will be processed or ignored when received on clicks.
An optional tracking source ID that can be used for the affiliate.
Internal notes are not visible
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.
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.
Only relevant when frequency is set to weekly
. Possible values are monday
, tuesday
, wednesday
, thursday
, friday
, saturday
, sunday
.
Only relevant when frequency is set to bimonthly
.
Specifies first day of the month.
Specifies second day of the month.
Only relevant when frequency is set to monthly
.
Specifies day of the month.
Only relevant when frequency is set to two_months
.
First month of the 2 months interval
Day of the month
Only relevant when frequency is set to quaterly
.
First month of the quarter period
Day of the month
Determines whether invoices are generated automatically or not.
Minimum amount that must be reached before an invoice is generated.
Only relevant when invoices are generated automatically. Date of the lookback window.
Number of days after the beginning of the billing period before the invoice is generated.
Number of days before the payment is sent
Determines whether invoices are hidden to affiliates or not by default.
Determines if referral commissions are enabled or not
Referral commission method. Possible values are flat_fee
or percentage
Value of the referral commission
Determines if the commission is based on payout
, revenue
or profit
.
Minimum amount that must be reached before a commission is paid.
Number of days during which the referral commission is effective.