Deals

Operations related to 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).

The “Deals” Object

Though different versions of the deals object are returned by the endpoints documented here, it can be defined as such :

network_advertiser_deal_id int

The deal’s unique identifier

network_id int

The identifier of the network associated with the deal

name string

The name of the deal as defined by the network

brand_name string

The name of the brand the deal is associated with. This is currently optional.

deal_type string

The deal type will be one of the following values : coupon, freeshipping, category_coupon, category_sale, product_coupon, product_sale, rebates, clearance, sale, offer, shipping_offer, newcustomer, gift, dollar, percent, dod, apofreeshipping, totallyfreeshipping, mobile, printable, fmtc_exclusive, local, friends_family, revtrax, bogo, category or free_trial

deal_status string

The deal status will be one of the following values : active, inactive or deleted

deal_categories string array

There must be at least one category (but there can be multiple) in the following values :

alcohol-beer, alcohol-beer-home-brewing, alcohol-beer-liquor-spirits, alcohol-beer-wine, animals-pet-supplies, animals-pet-supplies-bird-supplies, animals-pet-supplies-cat-supplies, animals-pet-supplies-dog-supplies, animals-pet-supplies-horse-supplies, arts-entertainment, arts-entertainment-event-tickets, arts-entertainment-event-tickets-adult-entertainment, arts-entertainment-hobbies-creative-arts, arts-entertainment-party-supplies, auctions, b2b, b2b-advertising-marketing, b2b-construction, b2b-food-service, b2b-janitorial, b2b-medical, b2b-retail, b2b-signage, b2b-web-hosting-domains, b2b-work-safety, babies-kids, babies-kids-baby-health, babies-kids-baby-safety, Babies-kids-baby-toys-activity-equipment, babies-kids-car-seats-carriers-strollers, babies-kids-diapering, babies-kids-nursing-feeding, babies-kids-potty-training, charity, clothing-apparel, clothing-apparel-accessories, clothing-apparel-baby-kids, clothing-apparel-costumes, clothing-apparel-men, clothing-apparel-women, clothing-apparel-work-uniforms, computers-accessories, computers-accessories-accessories, computers-accessories-data-storage, computers-accessories-desktops, computers-accessories-input-devices, computers-accessories-laptops, computers-accessories-monitors, computers-accessories-networking-products, computers-accessories-print-copy-scan-fax, computers-accessories-servers, computers-accessories-software, computers-accessories-tablets, consumer-electronics, consumer-electronics-audio, consumer-electronics-batteries, consumer-electronics-camera-optics, consumer-electronics-drones, consumer-electronics-ereaders, consumer-electronics-electronics-accessories, consumer-electronics-gps, consumer-electronics-home-security-systems, consumer-electronics-projectors, consumer-electronics-smart-home-devices, consumer-electronics-smart-watches, consumer-electronics-telephony, consumer-electronics-video, consumer-electronics-video-game-consoles-games, consumer-electronics-video-players-recorders, consumer-services, consumer-services-box-subscriptions, consumer-services-dating, consumer-services-internet-services, consumer-services-photo-canvas-services, consumer-services-tarot-readings-psychics, covid-related, curbside-pickup, department-stores, education, education-college, education-online-courses, education-school-supplies, erotic, erotic-books-magazines, erotic-clothing, erotic-dvds, erotic-games, erotic-sex-toys, financial, financial-credit-cards, financial-id-protection, financial-insurance, financial-legal, financial-loans, financial-tax-services, food-gourmet, food-gourmet-food-beverage, food-gourmet-restaurants, gambling, gifts, gifts-flowers, gifts-gift-baskets, gifts-gift-certificates, gifts-greeting-cards-stationery, gifts-personalized-gifts, gifts-photo-gifts, green-living-ecofriendly, group-discount, group-discount-age-segment-discount, group-discount-alumni-discount, group-discount-corporate-discount, group-discount-first-responder-discount, group-discount-healthcare-worker-discount, group-discount-hero-discount, group-discount-military-discount, group-discount-student-discount, group-discount-teacher-discount, hardware, hardware-building-supplies, hardware-tools, health-beauty, health-beauty-beauty-cosmetics, health-beauty-contacts-glasses, health-beauty-diet-fitness, health-beauty-fragrance-cologne, health-beauty-health-care, health-beauty-health-care-cdb, health-beauty-personal-care, health-beauty-vitamins-supplements, holidays-occasions, holidays-occasions-4th-of-july, holidays-occasions-april-fools-day, holidays-occasions-australia-day, holidays-occasions-back-to-school, holidays-occasions-black-friday, holidays-occasions-black-friday-in-july, holidays-occasions-boxing-day, holidays-occasions-canada-day, holidays-occasions-chinese-new-year, holidays-occasions-christmas, holidays-occasions-christmas-in-july, holidays-occasions-cinco-de-mayo, holidays-occasions-columbus-day, holidays-occasions-cyber-monday, holidays-occasions-earth-day, holidays-occasions-easter, holidays-occasions-fathers-day, holidays-occasions-free-shipping-day, holidays-occasions-giving-tuesday, holidays-occasions-graduation, holidays-occasions-green-monday, holidays-occasions-halloween, holidays-occasions-hanukkah, holidays-occasions-labor-day, holidays-occasions-leap-day, holidays-occasions-mardi-gras, holidays-occasions-martin-luther-king-day, holidays-occasions-memorial-day, holidays-occasions-mothers-day, holidays-occasions-new-years, holidays-occasions-pink-ribbon-shop, holidays-occasions-presidents-day, holidays-occasions-pride-day, holidays-occasions-prom, holidays-occasions-singles-day, holidays-occasions-st-patricks-day, holidays-occasions-tax-day, holidays-occasions-thanksgiving, holidays-occasions-valentines-day, holidays-occasions-veterans-day, holidays-occasions-weddings, household, household-appliances, household-bed-bath, household-furniture, household-home-decor, household-kitchen-dining, household-lighting, household-rugs-flooring, household-storage-and-organization, household-supplies, household-yard-garden, kids, local-deals, local-deals-apparel, local-deals-automotive, local-deals-babies-kids, local-deals-beauty-spas, local-deals-cannabis, local-deals-computers-electronics, local-deals-education, local-deals-entertainment, local-deals-financial, local-deals-food-drink, local-deals-gifts, local-deals-health-wellness, local-deals-holiday, local-deals-home-services, local-deals-jewelry, local-deals-legal-services, local-deals-nightlife, local-deals-pets, local-deals-photography, local-deals-professional-services, local-deals-public-services, local-deals-real-estate, local-deals-shopping, local-deals-sports-recreation, local-deals-travel, luggage-bags, luggage-bags-backpacks, media, media-books-magazines, media-movies, media-music, mens, office, office-equipment, office-furniture, office-school-supplies, office-supplies, sporting-goods, sporting-goods-athletics, sporting-goods-dance-gymnastics, sporting-goods-exercise-fitness, sporting-goods-indoor-games, sporting-goods-lacrosse, sporting-goods-outdoor-recreation, tobacco, tobacco-cigars, tobacco-ecigarettes-vaporizers, toys-games, toys-games-card-games, toys-games-games, toys-games-outdoor-play-equipment, toys-games-puzzles, toys-games-toys, toys-games-video-games, travel, travel-air, travel-car-rental, travel-cruises, travel-hotel, travel-vacation-packages, vehicles-parts, vehicles-parts-motor-vehicle-electronics, vehicles-parts-motor-vehicle-parts, vehicles-parts-vehicle-insurance, vehicles-parts-vehicle-maintenance-care-decor, vehicles-parts-vehicle-safety-security, vehicles-parts-vehicle-storage-cargo, vehicles-parts-watercraft-parts-accessories, weapons, womens

description string

Optional deal description

restrictions string

Optional restrictions on the deal (expressed as free text)

scope string

The deal scope can be one of the following : entire_store, category or product

coupon_code string

An optional coupon code associated with the deal

coupon_code_discount_percentage int

Only relevant if a coupon code is specified. The coupon code will either be a percentage discount or an amount discount but cannot be both

coupon_code_discount_amount int

Only relevant if a coupon code is specified. The coupon code will either be a percentage discount or an amount discount but cannot be both

coupon_code_discount_currency_id string

Only relevant if a coupon code is specified. The currency specified here is associated with the coupon_code_discount_amount

threshold_quantity int

An optional quantity required to trigger the deal. The threshold can be either an amount or a quantity but cannot be both.

threshold_amount int

An optional amount required to trigger the deal. The threshold can be either an amount or a quantity but cannot be both.

threshold_amount_currency_id string

Only relevant if a threshold_amount is specified. The currency specified here is associated with the threshold_amount

purchase_limit_quantity int

An optional quantity limit associated with the deal. The limit can be either an amount or a quantity but cannot be both.

purchase_limit_amount int

An optional amount limit associated with the deal. The limit can be either an amount or a quantity but cannot be both.

purchase_limit_amount_currency_id string

Only relevant if a purchase_limit_amount is specified. The currency specified here is associated with the purchase_limit_amount

date_valid_from int

Certain deals are only valid for a given period of time. An optional unix timestamp that expresses the date after which the deal becomes valid.

date_valid_to int

Certain deals are only valid for a given period of time. An optional unix timestamp that expresses the date after which the deal has ended.

date_valid_timezone_id int

Only relevant if date_valid_from or date_valid_to are specified. Since both are expressed as unix timestamps via the API this field is not overly relevant in the API. However, it determines how the date is displayed in the UI and can be used as such here.


Get Offer Deals

GET /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.

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",
			"brand_name": "Some brand",
			"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

POST /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.

filters object
network_offer_ids int array

An optional array of offers IDs for which you would like the deals returned.

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",
			"brand_name": "Some brand",
			"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,
			"has_products": true,
			"has_locations": true,
			"relationship": {
				"deal_resources": [
					{
						"network_advertiser_deal_resource_id": 2,
						"network_advertiser_deal_id": 1,
						"resource_type": "thumbnail",
						"html_code": "",
						"width": 0,
						"height": 0,
						"relationship": {
							"assets": [
								{
									"network_asset_id": 2,
									"content_type": "image/png",
									"filename": "thumb.png",
									"url": "http://usercontent.everflowclient.io/1/advertisers/1/deal/5/resources/thumb.png",
									"file_size": 11516,
									"image_width": 0,
									"image_height": 0,
									"optimized_thumbnail_url": ""
								}
							]
						}
					},
					{
						"network_advertiser_deal_resource_id": 1,
						"network_advertiser_deal_id": 1,
						"resource_type": "image",
						"html_code": "",
						"width": 0,
						"height": 0,
						"relationship": {
							"assets": [
								{
									"network_asset_id": 1,
									"content_type": "image/png",
									"filename": "slack-preview.png",
									"url": "http://usercontent-dev.everflowclient.io/1/advertisers/1/deal/5/resources/some-image.png",
									"file_size": 274508,
									"image_width": 0,
									"image_height": 0,
									"optimized_thumbnail_url": ""
								}
							]
						}
					}
				],
				"offers": [
					{
						"network_offer_id": 1,
						"network_id": 1,
						"name": "Example Offer",
						"offer_status": "active",
						"tracking_url": "http://www.tracking-link.test/9W598/2CTPL/",
						"redirect_tracking_url": "",
						"impression_tracking_url": ""
					},
					{
						"network_offer_id": 2,
						"network_id": 1,
						"name": "Other offer",
						"offer_status": "active",
						"tracking_url": "http://www.tracking-link.test/9W598/3QQG7/",
						"redirect_tracking_url": "",
						"impression_tracking_url": ""
					}
				],
			},
			"time_saved": 1694616132,
			"time_created": 1694616132,
			"time_deleted": 0
		}
	],
	"paging": {
		"page": 1,
		"page_size": 50,
		"total_count": 1
	}
}

Get Offer Deal by ID

GET /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

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",
	"brand_name": "Some brand",
	"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
}