Skip to main content
07399 456 959 admin@uconvert.co.uk

Product Deals Filtering
Last updated: December 07 2018 05:56 PM

Filter Parameters Available For Product Deals

Parameter Type Operators Values Description and examples
filter[networks]
optional
string eq Any Network Name or Network ID

Use the following endpoint to return all the available networks. https://api.uconvert.co.uk/deals/v1/networks/.

Alternatively use the 'List all networks' query in the 'Getting Started' folder in our postman collection.
Returns deals filtered for a particular network or networks.

/?filter[networks]=eq{ee}
/?filter[networks]=eq{1}
/?filter[networks]=eq{vodafone,three}
/?filter[networks]=eq{3,12}
filter[offers]
optional
string eq gifts or cashback Returns deals filtered by free gifts and/or cashback

/?filter[offers]=eq{gifts}
/?filter[offers]=eq{cashback}
filter[dealType]
optional
string eq consumer or upgrade or existing Returns deals filtered for a particular customer segment

/?filter[dealType]=eq{existing}
/?filter[dealType]=eq{consumer}
/?filter[dealType]=eq{upgrade}
filter[upfrontCost]
optional
string eq / lt /gt any numeric value Returns deals filtered by upfront cost

/?filter[upfrontCost]=gt{40}
/?filter[upfrontCost]=lt{30}
/?filter[upfrontCost]=eq{45}
filter[dataAllowance]
optional
string eq / lt / gt any numeric value Returns deals filtered by data allowance

/?filter[dataAllowance]=lt{1000}
/?filter[dataAllowance]=gt{10000}
/?filter[dataAllowance]=eq{3000}
filter[monthlyCost]
optional
string eq / lt / gt any numeric value Returns deals filtered by contract price

/?filter[monthlyCost]=lt{40}
/?filter[monthlyCost]=gt{50}
/?filter[monthlyCost]=eq{25}

Product Deals Filtering Example

Filtering products deals

GET
https://api.uconvert.co.uk/deals/v1/products/2203/?expand=products(deals)&filter[condition]=eq{new}&filter[upfrontCost]=lt{50}&sort=deals(data-allowance-asc)
{
  "products": [
    {
      "id": "2203",
      "name": "Samsung Galaxy S9 Plus 128GB Coral Blue",
      "slug": "samsung-galaxy-s9-plus-128gb-coral-blue",
      "cheapestUpfrontCost": "0.00",
      "cheapestContractPrice": "43.00",
      "condition": "New",
      "colour": "Coral Blue",
      "hexColour": "#377ea3",
      "capacity": "128GB"
    }
  ]
  "deals": [
    {
      "contractName": "Vodafone Essentials Plan",
      "contractLength": "24",
      "contractSupplierId": "4",
      "contractSupplierName": "Vodafone",
      "smallNetworkImage": "https://static.uconvert.co.uk/img/badges/network-small-4.png",
      "mediumNetworkImage": "https://static.uconvert.co.uk/img/badges/network-medium-4.png",
      "largeNetworkImage": "https://static.uconvert.co.uk/img/badges/network-4.png",
      "largeRetailerImage": "https://static.uconvert.co.uk/img/badges/retailer-5.png",
      "friendlyContractLength": "24 Month Contract",
      "dataAllowance": "250",
      "friendlyDataAllowance": "250Mb",
      "callAllowance": "250",
      "friendlyCallAllowance": "250",
      "textAllowance": "999999",
      "friendlyTextAllowance": "Unlimited",
      "dealLink": "https://deals.uconvert.co.uk/deal_redirect/5/258071140/",
      "dealType": "Consumer",
      "condition": "New",
      "totalDealCost": "1266.99",
      "supplierId": "5",
      "supplierName": "Mobile Phones Direct",
      "productUpfrontCost": "834.99",
      "supplierContractPrice": "18.00",
      "giftImg": "https://static.uconvert.co.uk/img/gifts/free-hive-active-heating-with-installation.png",
      "productImg": "https://static.uconvert.co.uk/img/products/samsung/samsung-galaxy-s9-plus/coral-blue/front.png",
      "giftName": "Free Hive Active Heating With Installation",
      "productName": "Samsung Galaxy S9 Plus 128GB Coral Blue"
    },
    {},
    {},
  ]
} 
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.uconvert.co.uk/deals/v1/products/2203/?expand=product-deals&filter[condition]=eq{new}&sort=d-data-allowance-asc",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "x-api-key: 123456"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
curl --request GET \
--url 'https://api.uconvert.co.uk/deals/v1/products/2203/?expand=product-deals&filter[condition]=eq{new}&sort=d-data-allowance-asc' \
--header 'x-api-key: 123456'
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.uconvert.co.uk/deals/v1/products/2203/?expand=product-deals&filter[condition]=eq{new}&sort=d-data-allowance-asc",
  "method": "GET",
  "headers": {
    "x-api-key": "123456"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
require 'uri'
require 'net/http'

url = URI("https://api.uconvert.co.uk/deals/v1/products/2203/?expand=product-deals&filter[condition]=eq{new}&sort=d-data-allowance-asc")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '123456'

response = http.request(request)
puts response.read_body