Skip to content

Add Offer

POST /offer/add_offer

Description URL Response Format Request Method Authentication
Add new offer https://domain/api/offer/add_offer JSON POST HTTP headers

Parameters

Offer Parameters

Name Description Type Required
name Offer Name string yes
offer_description Description to display to affiliates string no
hidden 0 or 1. If set to 1, offer does not show up in the affiliate offer list. bool no
date_live Time when offer should become available to affiliates. String to time on the string provided. Default is empty. string no
date_expire Time when offer should stop being available to affiliates. String to time on the string provided. Default is empty. string no
featured Flags this as a featured offer. Default FALSE. bool no
expire_url External URL to redirect traffic to if the offer is expired string no
expire_landing_pageid ID of landing page to redirect traffic to if the offer is expired. string no
no_personal_member_info Prevent name and address information from being stored in the customer record string no
subject_lines Comma separated list of recommended subject lines for affiliates promoting via email. Only displayed when "Display Offer Email Fields" is enabled string no
from_addresses Comma separated list of recommended from addresses for affiliates promoting via email. Only displayed when "Display Offer Email Fields" is enabled string no
ip_lookup Set cookieless tracking to match on only IP instead of IP+Browser Details. Default FALSE. boolean no
ip_uniqueness_seconds Set the number of seconds before a repeat visit by the same visitor will trigger the 'unique' offer redirect condition. This does not affect them showing as unique in stats. Default is unset on the offer level and inheriting from the "Unique Visitor Time" configuration setting. integer no
offer_groups Accepts an existing offer group id, comma separated list of group ids, or array of group ids to associate with this offer. int, string, array no
marketing_types Accepts an existing marketing type id, comma separated list of marketing type ids, or array of marketing type ids to associate with this offer. int, string, array no
categories Accepts an existing category id or category name, comma separated list of ids/names, or array of ids/names to associate with this offer. Creates new categories if a category name is passed that does not exist. int, string, array no
authorized Accepts a comma separated list or array of 2 letter country codes where traffic is authorized to use this offer. Defaults to the 'Default Authorized Countries' configuration setting. string, array no
unauthorized Accepts a comma separated list or array of 2 letter country codes where traffic is not authorized to use this offer. Defaults to the 'Default Unauthorized Countries' configuration setting. string, array no
device_types Accepts an array of device types to accept. Default is null (no device restriction). Possible values: array no
0 - desktop
1 - mobile
2 - tablet
remove_ocode Remove ocode when sending surfer to landing page. Default FALSE to pass along. boolean no

Note

If no authorized or unauthorized countries are set even after checking the network configurations, the offer is authorized for all countries by default.

Advertiser Parameters

Name Description Type Required
advertiserid Loginid of advertiser account associated with this offer. Default none. integer no
advertiser_cost_type If there is an advertiser associated with this offer, how is offer revenue calculated. Default none. Options string no
conversion - flat amount per conversion
dynamic_conversion - uses the revenue passed with the conversion
sale - calculate a percentage of the gross sale amount reported by the advertiser
click - a flat amount per click
unique - a flat amount per unique click
advertiser_cost_flat Flat cost to advertisers. used with 'conversion','click','unique' string no
advertiser_cost_flat Percentage cost to advertiser used with 'sale' string no

Fraud Prevention Parameters

Name Description Type Required
ip_conversion_limit_flag Comma separated list of recommended from addresses for affiliates promoting via email. Only displayed when "Display Offer Email Fields" is enabled. Default 0. integer no
0 - Inherit from Network Configuration
1 - No Limit on this offer
2 - Specify Limimt on this offer
ip_conversion_limit Number of conversions allowed per IP to this offer in any 24 hour time period. Only checked if ip_conversion_limit_flag=2. Default 0. integer no
ip_conversion_group Controls the scope of ip_conversion_limit. Default is 0, this offer only. Specifying a group id will count all conversion for offers in that group integer no
0 - This offer only
x - Group id of any offer group.
prevent_cookie_dupes Checks a cookie to block surfers that have already converted on this offer during the cookie lifetime. Default FALSE. boolean no
pending_approval_lockout Minimum number of seconds that must pass between a click and a conversion for that conversion to be automatically approved. While this setting is in effect, all conversions on this offer are treated as pending. If the lockout period has been reached, the system will record both a pending conversion and an approved conversion automatically. Default 0 to disable. integer no

Revenue Parameters

Name Description Type Required
conversion_default Amount used if none is specified in the conversion. Default none. string no
conversion_default_type Specify if the amount specified in conversion_default is revenue or gross. Default: 1 for revenue integer no
1 - revenue
2 - gross
continuity_default Amount used if none is specified in the continuity. Default none. integer no
continuity_default_type Specify if the amount specified in continuity_default is revenue or gross. Default 1 for revenue string no
1 - revenue
2 - gross

Commission Parameters

Name Description Type Required
percentage_commission_source Specify whether revenue or gross should be used as the base when affiliate are paid a percentage. Default 0 for revenue integer no
0 - revenue
1 - gross
hide_payout_string Hide the automatically generated commission description and use the description in 'commission_description' instead. boolean no
commission_description Custom description displayed to affiliates to explain how commissions are calculated for this offer. string no
commission_description Custom description displayed to affiliates to explain how commissions are calculated for this offer. string no
commission_type Specify what type of commission this offer will pay. Options are: string no
cpa - Flat per CPA. Works with flat_amount_per_conversion and flat_amount_per_continuity
cps - Percentage of Sale. Works with percentage_of_customer_conversion and percentage_of_customer_continuity
click - Flat per Click. Works with flat_amount_per_click and flat_amount_per_visitor
hybrid - Hybrid. Works with all fields.
flat_amount_per_click Flat commission paid for every raw click. Works with click or hybrid decimal no
flat_amount_per_visitor Flat commission paid for every unique click. Works with click or hybrid decimal no
flat_amount_per_conversion Flat commission paid for every conversion. Works with cpa or hybrid decimal no
flat_amount_per_continuity Flat commission paid for every continuity. Works with cpa or hybrid decimal no
percentage_of_customer_conversion Percentage of conversion revenue to pay as commission. Works with cps or hybrid decimal no
percentage_of_customer_continuity Percentage of continuity revenue to pay as commission. Works with cps or hybrid decimal no
retro_payout All transactions for a customer will use the commission settings in place at the time of the first transaction. bool no
hide_deductions Only show voids / chargebacks in affiliate statistics if they affected affiliate commissions. bool no
hide_continuities Only show continuities in affiliate statistics if they affected affiliate commissions. bool no
hide_conversions Only show conversions in affiliate statistics if they affected affiliate commissions. bool no
deduct_voids When enabled, voids will reverse the commission paid to the affiliate on the original transaction that is being voided bool no
deduct_chargebacks When enabled, chargebacks will reverse the commission paid to the affiliate on the original transaction that is being charged back bool no
min_deduct_date Date for stringtotime. Transactions before this date will never have their commissions removed by a void or chargeback. string no
deduct_window If a void or chargeback is reported more than this many days after the original transaction, the affiliate will not have their commission removed even if deduct_voids or deduct_chargebacks is enabled. int no

Landing Page Parameters

Name Description Type Required
url Landing Page url string yes
preview_url Clean url to display to affiliates string no
tracking_domain One of your already defined tracking domains string no
thumb_url Url of offer thumbnail image. string no
force_url Url to screenshot for thumbnail. string no
language id of one of your defined languages from the offers admin. int no
conversion_type options: iframe, post, image. Type of conversion to use for this offer string no
postback_ips Comma separated list of ips that are allowed to post conversions to this offer. Default is no restriction. string no
hostnpost_ips Comma separated list of ips that are allowed to post hostandpost conversions to this offer. Default is no restriction. string no
void_ips Comma separated list of ips that are allowed to post voids to this offer. Default is deny all. string no
private TRUE means the default landing page for the new offer will be private. Default is FALSE. boolean no
requestable TRUE means the default landing page for the new offer will be requestable if it is also private. Default is FALSE. boolean no
internal_desc Landing page description for the new offer that is only in the admin interface. Default is empty. string no
redirect_hash Matching field for identifying what landing page to use when geo redirecting within an offer group. Default is empty. string no
disable_url_sanitization Uses landing page url exactly as provided without encoding any invalid url characters. Default is false, encoding invalid url characters in the landing page. boolean no
disable_deep_linking Discards any extra path and variables specified by the affiliate on the tracking link. Default is false, allowing the affiliate to affect the landing page url. boolean no

Example Request

POST

http://domain/api/offer/add_offer
name=API TEST OFFER
url=http://example.com/?id=%%click_hash%%
preview_url=http://example.com/
authorized=DE,ES
advertiserid=1
advertiser_cost_type=conversion
advertiser_cost_flat=20
commission_type=201
flat_amount_per_conversion=15
flat_amount_per_continuity=5

Response:

{
    "result":"Success",
    "message":{
      "landing_pageid":"432",
      "offerid":"400"
    }
}

Example Code

php

<?php 
$url = 'http://domain/api/offer/add_offer';
$curl = curl_init(); 

$headers = array( 
    'api-key: 44b5498dbcb481a0d00b404c0169af62', 
    'api-username: productsupport' 
);

 $data = Array(
    'name' => 'API TEST Offer',
    'url' => 'http://example.com/?id=%%click_hash%%',
    'preview_url' => 'http://example.com/',
    'authorized' => 'DE,ES',
    'advertiserid' => 1,
    'advertiser_cost_type' => 'conversion',
    'advertiser_cost_flat'=> 20,
    'commission_type' => 201,
    'flat_amount_per_conversion' => 15,
    'flat_amount_per_continuity' => 5,
); 

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); 
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));

$resp = curl_exec($curl); 
//dumps an associative array representation of the json response
$output = json_decode($resp, true);
if($output !== NULL) {
    //json was valid. Dump the decoded array
    print_r($output);
}
else {
    //invalid json, just dump the raw response
    print_r($resp);
}
// Close request to clear up some resources 
curl_close($curl); 
?>