Deals
Deals are optional in Everflow but can exist at the offer level. There can be 0, 1 or more deals associated with any given offer.
The deals will only be accessible on offers on which you can currently run traffic (i.e. not blocked and not pending approval on the offer).
Get Offer Deals
/v1/affiliates/offers/:offerId/deals
This endpoint allows you to fetch the deals associated with an offer if they exist.
Returns an empty array if no deals exist.
Note that the date_valid_from
and date_valid_to
fields are optional and expressed as unix timestamps. They will be set to 0
if they are not specified.
Request Example
cURL
curl --request GET 'https://api.eflow.team/v1/offers/<offer_id>/deals' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'content-type: application/json'
Response
{
"deals": [
{
"network_advertiser_deal_id": 1,
"network_id": 1,
"name": "Example Deal",
"deal_type": "coupon",
"deal_status": "active",
"deal_categories": [
"computers-accessories-tablets",
"computers-accessories-software",
"computers-accessories-servers"
],
"description": "The description of the deal",
"restrictions": "Some Restrictions (in free text)",
"scope": "entire_store",
"coupon_code": "SUMMER23",
"coupon_code_discount_percentage": 0,
"coupon_code_discount_amount": 20,
"coupon_code_discount_currency_id": "USD",
"threshold_quantity": 0,
"threshold_amount": 1000,
"threshold_amount_currency_id": "USD",
"purchase_limit_quantity": 0,
"purchase_limit_amount": 0,
"purchase_limit_amount_currency_id": "",
"date_valid_from": 1690304400,
"date_valid_to": 0,
"date_valid_timezone_id": 80,
"relationship": {},
"time_saved": 1690302358,
"time_created": 1690301385,
"time_deleted": 0
}
]
}
Get All Deals
/v1/affiliates/deals
This endpoint allows you to fetch all deals available, with an optional filter of the offer ids.
Returns an empty array if no deals exist.
Paging
This endpoint supports paging. Refer to our User Guide for usage.
Body Params
An optional array of offers IDs for which you would like the deals returned.
Request Example
cURL
curl --request GET 'https://api.eflow.team/v1/affiliates/deals' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'content-type: application/json'
Example 1 : Fetch all deals related to offers with IDs 1 and 2
{
"filters": {
"network_offer_ids": [1, 2]
}
}
Response
{
"deals": [
{
"network_advertiser_deal_id": 1,
"network_id": 1,
"name": "Example Deal",
"deal_type": "coupon",
"deal_status": "active",
"deal_categories": [
"computers-accessories-tablets",
"computers-accessories-software",
"computers-accessories-servers"
],
"description": "The description of the deal",
"restrictions": "Some Restrictions (in free text)",
"scope": "entire_store",
"coupon_code": "SUMMER23",
"coupon_code_discount_percentage": 0,
"coupon_code_discount_amount": 20,
"coupon_code_discount_currency_id": "USD",
"threshold_quantity": 0,
"threshold_amount": 1000,
"threshold_amount_currency_id": "USD",
"purchase_limit_quantity": 0,
"purchase_limit_amount": 0,
"purchase_limit_amount_currency_id": "",
"date_valid_from": 1690304400,
"date_valid_to": 0,
"date_valid_timezone_id": 80,
"relationship": {
"offers": [
{
"network_offer_id": 1,
"network_id": 1,
"name": "Example Offer 1",
"offer_status": "active"
},
{
"network_offer_id": 2,
"network_id": 1,
"name": "Other Offer",
"offer_status": "active"
}
]
},
"time_saved": 1694616132,
"time_created": 1694616132,
"time_deleted": 0
}
],
"paging": {
"page": 1,
"page_size": 50,
"total_count": 1
}
}
Get Offer Deal by ID
/v1/affiliates/offers/:offerId/deals/:dealId
This endpoint allows you to fetch a specific offer deal.
Note that the date_valid_from
and date_valid_to
fields are optional and expressed as unix timestamps. They will be set to 0
if they are not specified.
Relationships
This endpoint supports the following additional relationships. Refer to our User Guide for usage.
Value | Description |
---|---|
locations | Includes the deal’s locations (if any) in the response |
products | Includes the deal’s products (if any) in the response |
resources | Includes the deal’s resources (if any) in the response |
trackings | Includes the offer’s tracking link in the response |
Request Example
cURL
curl --request GET 'https://api.eflow.team/v1/offers/<offer_id>/deals/<deal_id>?relationship=locations&relationship=resources&relationship=trackings' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'content-type: application/json'
Response
{
"network_advertiser_deal_id": 1,
"network_id": 1,
"name": "Example Deal",
"deal_type": "coupon",
"deal_status": "active",
"deal_categories": [
"computers-accessories-tablets",
"computers-accessories-software",
"computers-accessories-servers"
],
"description": "Public Description",
"restrictions": "Restrictions (free text)",
"scope": "entire_store",
"coupon_code": "SUMMER23",
"coupon_code_discount_percentage": 0,
"coupon_code_discount_amount": 20,
"coupon_code_discount_currency_id": "USD",
"threshold_quantity": 0,
"threshold_amount": 1000,
"threshold_amount_currency_id": "USD",
"purchase_limit_quantity": 0,
"purchase_limit_amount": 0,
"purchase_limit_amount_currency_id": "",
"date_valid_from": 1690304400,
"date_valid_to": 0,
"date_valid_timezone_id": 80,
"relationship": {
"deal_locations": [
{
"network_advertiser_deal_location_id": 4,
"network_advertiser_deal_id": 1,
"business_name": "Example business",
"street_adress": "",
"extended_address": "",
"city": "",
"region_id": 0,
"country_id": 0,
"postal_code": "",
"business_website": "www.example-biz.net"
}
],
"deal_products": [
{
"network_advertiser_deal_product_id": 6,
"network_advertiser_deal_id": 1,
"product_name": "Server",
"product_url": "www.example.test/server",
"before_discount_price": 549,
"after_discount_price": 399,
"retail_price": 599,
"discount_percentage": 0,
"price_currency_id": "USD"
},
{
"network_advertiser_deal_product_id": 5,
"network_advertiser_deal_id": 1,
"product_name": "Monitor",
"product_url": "www.example.test/monitor",
"before_discount_price": 379,
"after_discount_price": 299,
"retail_price": 399,
"discount_percentage": 0,
"price_currency_id": "USD"
}
],
"deal_resources": [
{
"network_advertiser_deal_resource_id": 1,
"network_advertiser_deal_id": 1,
"resource_type": "image",
"html_code": "",
"width": 200,
"height": 300,
"relationship": {
"assets": [
{
"network_asset_id": 2,
"content_type": "image/jpeg",
"filename": "d5a38e62-4da3-424f-a5d1-64e9b6c2f934.jpeg",
"url": "http://usercontent.everflowclient.io/1/advertisers/1/deal/0/resources/d5a38e62-4da3-424f-a5d1-64e9b6c2f934.jpeg",
"file_size": 574359,
"image_width": 200,
"image_height": 300,
"optimized_thumbnail_url": ""
}
]
}
}
],
"tracking_url": "http://www.servetrack.test/9W598/55M6S/"
},
"time_saved": 1690306387,
"time_created": 1690301385,
"time_deleted": 0
}