Home

PHP

Offers

If you would like to query for deals against the api you can use the following to search or browse through all available deals in our catalog.

API Function: get_offers

Parameters:

Name Type Description
username string Your API username. You should have received this with your account
subscription_id string Your Subscription ID. You can copy or regenerate it from your API management interface.
network_id numeric The ID of the desired affiliate network. You can use this parameter to get offers available on a specific network. Please read the Networks section to find out how to obtain a list of networks IDs.
merchant_id numeric The ID of the desired merchant. You can use this parameter to get offers provided by a specific merchant. To obtain a list of merchants please read the "Merchants" section.
category_id numeric The ID of the desired category. Use this to obtain offers belonging to a single category. To obtain a list of categories please read the "Categories" section.
country_id numeric You can use this parameter to query our catalog for offers available in a country. To obtain a list of countries please read the "Countries" section.
start_date / end_date string These parameters will allow you to filter results based on date. You can use these parameters to display offers who are valid between a set start and expiration date. You can input any date string accepted by PHP but we recomed you use the "Y-m-D H:i:s" format.
offer_type string Can be one of the following values {offer, code, daily_deal}  . This parameter is used to filter the offers after their types
has_postback numeric This parameter is used to filter the offers . If you set it to 1 will be returned only offers which support postback reporting

 

Response fields:

Name Type Description
offer_id numeric The unique ID associated with the offer
country_id numeric The ID of the country in which this offer is active
merchant_id numeric The ID of the merchant who is supplying this offer
program_id numeric The ID of the merchant's affiliate program
category_id numeric The Category ID associated with the offer
subcategory_id numeric The Subcategory ID asociated eith the offer
network_id numeric The ID of the affiliate network who is supplying the offer
offer_title string Title
offer_description string Offer details
offer_start_date string Starting date
offer_end_date string Expiration date
offer_affiliate_url string The offer's URL. It can be a affiliate or direct link.
offer_voucher_code string If the offer has a voucher code associated with it, this field will display the code.
offer_price numeric Price of the offer
offer_discount numeric Offer Discount
offer_currency string Currency ID for the offer price
is_holiday_offer string Flag that says if the offer is a holiday offer
offer_large_img_url string Offer big image, used for daily deals offers
offer_location string national or local
offer_image string Offer small image, used for daily deals offers

 

                    
                    

                    
                    

                    
                    
                                            
<?php   
$api_username      = '*******';
$api_subscription  = '*******';

$api_network_id    = 0;   // replace with your network id
$api_merchant_id   = 0;   // replace with your country id
$api_category_id   = 0;   // replace with your category id
$api_country_id    = 221; // replace with your country id

$api_start_date    = '';  // replace with start date
$api_end_date      = '';  // replace with end date
$api_offer_type    = '';  // replace with offer type
$api_has_postback  = 0;   // replace with has postback

try
{
        $client    = new SoapClient('https://synced.io/api/v2?wsdl');
        $offers    = $client->get_offers($api_username, $api_subscription, $api_network_id, $api_merchant_id, $api_category_id, $api_country_id, $api_start_date, $api_end_date, $api_offer_type, $api_has_postback);			
}
catch(Exception $e)
{
        echo $e->getMessage();
}    


if(!empty($offers))
{
    print_r($offers);
}
?>