HasOffers networks that are affiliates for other HasOffers networks can leverage our affiliate and network APIs to programmatically import new offers from their advertiser into their network.
There are two parts to this process:
- First, retrieve the offers data from your affiliate account using the affiliate API. You can only use this process if you have an API key for your advertiser's network.
- Second, import the offers data into your network account using the network API. The network API is available to Enterprise-level clients and higher.
- This document briefly outlines the relevant API calls and key parameters to use. It requires users to modify the network and affiliate API calls to retrieve what's necessary, as well as writing the software solution to turn the data retrieved from your advertisers into calls to your network API. For further details on each call, follow the links to their developer documentation.
Retrieving & Importing Core Offer Data
This returns a JSON array of Offer model objects.
To retrieve the offer category, geo-targeting information, and the offer thumbnails, append
&contain=OfferCategory&contain=Country&contain=Thumbnail to the call.
Payout Details & Tracking Links
Two other calls are needed to retrieve payout details and tracking links: Affiliate_Offer::getPayoutDetails and Affiliate_Offer::generateTrackingLink. You must run these calls for each individual offer.
Finding the Default Currency
If you need to check your advertiser's default currency, use the Affiliate_AffiliateUser::getContext call to return a collection of arrays containing preferences. Your advertiser's default currency is the value of network_currency in the BrandPreferences array.
Importing into Your Network
Note: the required fields for Offer.create data parameter are: name, offer_url, preview_url, protocol, and expiration_date. We recommend setting the payout and revenue fields as well.
That’s all you need for importing basic offers from your advertiser into your network. The following section covers advanced offer settings.
Importing Offers that Require Approval
Some advertisers have offer approval processes in place. Those offers have their require_approval parameter set to "1", which you can find from Affiliate_Offer.findAll. If this feature is enabled, the advertiser may require you answer questions when you request access to the offer. You can check for these questions with Affiliate_Offer::getApprovalQuestions. To request access to the offer using the API, use Affiliate_Offer::requestOfferAccess.
Retrieving & Importing Additional Offer Settings
Use the following methods to retrieve and import deeper offer settings.
Advertisers have offer goals enabled on a given offer if that offer's has_goals_enabled parameter is "1", which you can find from Affiliate_Offer.findAll. Use Affiliate_Goal::findAll to retrieve offer goal information for those offers.
When creating an offer in your network that uses advanced targeting rules, set has_goals_enabled to "1" and default_goal_name to the order's default goal name in your Offer.create call. Then use Goal::create to add goals to an offer once the offer is created in your network
Creative Files & Thumbnails
Some advertisers categorize their offers for affiliates. To retrieve these categories as part of your Affiliate_Offer.findall call, append
&contain=OfferCategory to your the call.
Once an offer is created in your network, use Offer::setCategories to apply the categories you wish—whether you mirror your advertisers or have your own structure. You must know the matching category IDs in your network to automate the process.
To retrieve the geo-targeting rules on your advertiser's offers, append
&contain=Country to your Affiliate_Offer.findall call.
When creating an offer in your network that uses geo-targeting rules, set enforce_get_targeting to "1" in your Offer.create call. Then use Offer::setTargetCountries to add geo-targeting rules to an offer once the offer is created in your network. If you need to set target regions within countries, use Offer::addTargetCountryRegion.
Retrieving and setting advanced targeting rules works similarly to geo-targeting rules. To retrieve advanced targeting rules on an advertiser's offer, use Affiliate_OfferTargeting.getRuleTargetingForOffer.
When creating an offer in your network that uses advanced targeting rules, set use_target_rules to "1" in your Offer.create call. Then use OfferTargeting::addTargetRuleToOffer to add advanced targeting rules to an offer once the offer is created in your network. See the documentation on OfferTargeting::findTargetRules for more information.
Offers must be in an offer group for advanced targeting to function. Use Offer::setGroups to put offers into your offer groups.