This document provides an overview of the affiliate conversion api. The conversion report is the most flexible way to extract a list of conversions and post-conversion events. It allows you to fetch a list of conversions and post-conversion events while specifying filters to narrow down the scope of the set of data you are pulling.
Retrieve Conversions
API Endpoint
POST https://api.eflow.team/v1/affiliates/reporting/conversions
Each request must contain :
- from and to dates (format can be YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)
- The timezone_id used for the request. A full list of IDs can be retrieved using the /v1/meta/timezones endpoint. Common IDs include:
- America/Los_Angeles - ID 90
- America/Phoenix - 89
- America/Denver - ID 87
- America/Chicago - ID 85
- America/New_York - ID 80
- UTC - ID 67
- A show_conversions boolean value that determines whether base conversions are returned (true / false)
- A show_events boolean value that determines whether post-conversion events are returned (true / false)
Please note that the conversion report is limited to the prior 365 days only. Requests outside of this range will result in an error.
Sample Request
curl --request POST \
--url 'https://api.eflow.team/v1/affiliates/reporting/conversions?page=1&page_size=5&order_field=&order_direction=' \
--header 'Content-Type: application/json' \
--header 'x-eflow-api-key: <Your API Key>' \
--data '{
"timezone_id": 90,
"from": "2023-12-01",
"to": "2023-12-31",
"show_events": true,
"show_conversions": true,
"query": {
"filters": [],
"search_terms": []
}
}'
Sample Response
{
"conversions": [
{
"conversion_id": "f9d3fa7e86d241afbec4a6c6c3fe2580",
"conversion_unix_timestamp": 1661970244,
"sub1": "internal",
"sub2": "",
"sub3": "facebook",
"sub4": "",
"sub5": "",
"source_id": "",
"revenue_type": "CPA",
"revenue": 0.8,
"session_user_ip": "217.66.156.135",
"conversion_user_ip": "",
"country": "Russia",
"region": "Sankt-peterburg",
"city": "St Petersburg",
"dma": 0,
"carrier": "MTS Russia",
"platform": "macOS",
"os_version": "",
"device_type": "PC",
"brand": "Apple",
"browser": "Safari",
"language": "en",
"http_user_agent": "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_7_2 rv:5.0) Gecko/20111121 Firefox/5.0.1",
"is_event": false,
"event": "",
"transaction_id": "a22f8a1b5fde4801a2ed3dceabf4f8a3",
"click_unix_timestamp": 1661970238,
"isp": "mts ojsc",
"referer": "",
"app_id": "",
"idfa": "",
"idfa_md5": "",
"idfa_sha1": "",
"google_ad_id": "",
"google_ad_id_md5": "",
"google_ad_id_sha1": "",
"android_id": "",
"android_id_md5": "",
"android_id_sha1": "",
"currency_id": "USD",
"is_view_through": false,
"order_id": "",
"adv1": "facebook",
"adv2": "",
"adv3": "",
"adv4": "",
"adv5": "",
"relationship": {
"offer": {
"network_offer_id": 3,
"network_id": 1,
"name": "Daily Car",
"offer_status": "active",
"network_tracking_domain_id": 1
},
"events_count": 0,
"offer_url": {
"network_offer_url_id": 100,
"network_id": 1,
"network_offer_id": 3,
"name": "Alternate Offer URL",
"preview_url": "https://example-shop.com"
}
}
},
// ...
],
"paging": {
"page": 1,
"page_size": 5,
"total_count": 140
}
}
Paging
The conversion endpoint returns paginated responses. In the example above, the body of the response will include a paging object. The page is a 1-based index (the first page is 1, not 0).
When paging information is not specified in the request, the first page is returned with a page_size of 50. The maximum page size is typically 2000.
To request a specific page / page size, you must use the page and page_size in the query string of your request.
In the example above
https://api.eflow.team/v1/affiliates/reporting/conversions?page=1&page_size=5&order_field=&order_direction=
The resulting response will include the first 5 conversions on page 1. To get the next page, the page parameter should be changed to 2 like
https://api.eflow.team/v1/affiliates/reporting/conversions?page=2&page_size=5&order_field=&order_direction=
Query Filters
Query filters allow you to limit the scope of the report returned by the API. You could create a filter to limit the reporting data to a single partner for example. You can use multiple filters in a request.
Filters that apply to the same resource_type will act as OR operators. Different resource_type work with an AND operator.
The resource_type used in the query filters can take the following values :
offer, offer_creative, transaction_id, campaign, sub1, sub2, sub3, sub4, sub5, source_id, country, offer_url, browser, carrier, coupon_code, dma, device_brand, device_type, language, os_version, platform, and region.
Example: Filter conversions by sub1 value
The example call below will return conversions which have “sub1” set to “internal” from 2023-12-01 to 2023-12-31.
curl --request POST \
--url 'https://api.eflow.team/v1/affiliates/reporting/conversions?page=1&page_size=5&order_field=&order_direction=' \
--header 'Content-Type: application/json' \
--header 'x-eflow-api-key: <Your API Key>' \
--data '{
"timezone_id": 90,
"from": "2023-12-01",
"to": "2023-12-31",
"show_events": true,
"show_conversions": true,
"query": {
"filters": [
{
"resource_type": "sub1",
"filter_id_value": "internal"
}
]
}
}'
Example: Filter conversions by country value
The example call below will return conversions which have “country” set to “United States” from 2023-12-01 to 2023-12-31.
curl --request POST \
--url 'https://api.eflow.team/v1/affiliates/reporting/conversions?page=1&page_size=5&order_field=&order_direction=' \
--header 'Content-Type: application/json' \
--header 'x-eflow-api-key: <Your API Key>' \
--data '{
"timezone_id": 90,
"from": "2023-12-01",
"to": "2023-12-31",
"show_events": true,
"show_conversions": true,
"query": {
"filters": [
{
"resource_type": "country",
"filter_id_value": "United States"
}
]
}
}'
Example: Filter conversions by multiple resource type
The example call below will return conversions which have “country” set to “United States” and “sub1” set to “internal” from 2023-12-01 to 2023-12-31.
curl --request POST \
--url 'https://api.eflow.team/v1/affiliates/reporting/conversions?page=1&page_size=5&order_field=&order_direction=' \
--header 'Content-Type: application/json' \
--header 'x-eflow-api-key: <Your API Key>' \
--data '{
"timezone_id": 90,
"from": "2023-12-01",
"to": "2023-12-31",
"show_events": true,
"show_conversions": true,
"query": {
"filters": [
{
"resource_type": "country",
"filter_id_value": "United States"
},
{
"resource_type": "sub1",
"filter_id_value": "internal"
}
]
}
}'
Example: Filter conversions by multiple similar resource types
Filters that apply to the same resource_type will act as OR operators so if we want to filter conversions by multiple country filter, we would do the following:
curl --request POST \
--url 'https://api.eflow.team/v1/affiliates/reporting/conversions?page=1&page_size=5&order_field=&order_direction=' \
--header 'Content-Type: application/json' \
--header 'x-eflow-api-key: <Your API Key>' \
--data '{
"timezone_id": 90,
"from": "2023-12-01",
"to": "2023-12-31",
"show_events": true,
"show_conversions": true,
"query": {
"filters": [
{
"resource_type": "country",
"filter_id_value": "United States"
},
{
"resource_type": "country",
"filter_id_value": "Canada"
},
{
"resource_type": "country",
"filter_id_value": "Russia"
}
]
}
}'
The result of the call above will only include conversions from the United States, Canada and Russia.