Promotions - חיפוש מבצעים

Search for promotions using various query params.

Request parameters: 

These are the requests paramsters you can use in query. Note that these are also the parameters you can use for setting custom list of fields to be return in result set.

"id"
"chain_id",
"store_id",
"promotion_id",
"description",
"update_date",
"update_date_sec",
"start_date",
"start_hour",
"end_date",
"end_hour",
"reward_type",
"allow_multiple_discounts",
"is_weighted_promo",
"restriction_is_coupon",
"restriction_gift_count",
"restriction_is_total",
"restriction_is_active",
"min_qty",
"max_qty",
"discounted_price",
"discounted_price_per_mida",
"min_no_of_item_ofered",
"club_ids",

 

 

 

Sample code: 
<?php

$params = array(
    "api_key" => "API_KEY", // or "access_token" => "some-token"
    "chain_id" => "7290492000005",
    "store_id" => "501",

);
$url = "http://api.priceli.co.il/v1/priceli/promotions";
$response = curlGET($url, $params);
$data = json_decode($response);
echoResponse($response);

if ($data->status == 1) {
    //do something with product data

} else if ($data->status == 2) {
    //no data! do something

} else {
    echo "Error occur: " . $data->message;
}

function echoResponse($response){
    echo '<html><head><meta charset="UTF-8"></head><body>';
    echo $response;
    echo '</body></html>';
}

function curlGET($url, $data, &$errorBuf = null) {
    if ($data == null) {
        $data = array();
    }
    $url = $url . "?" . http_build_query($data);

    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_RETURNTRANSFER => 1,
        CURLOPT_URL => $url,
    ));
    $response = curl_exec($curl);
    if (!$response) {
        $response = false;
        if ($errorBuf != null) {
            $errorBuf = curl_error($curl);
        }
    }
    curl_close($curl);
    return $response;
}
?>
Sample Response : 
{
  "status": 1,
  "count": 100,
  "total": 233,
  "pageLimit": 100,
  "pageNum": 1,
  "data": [
    {
      "id": "466",
      "chain_id": "7290492000005",
      "store_id": "501",
      "promotion_id": "13002901",
      "description": "×‘×§× ×™×™×ª מאגדת ×§×•×¨× ×™  עיתון ידיעות ×ž×ª× ×”",
      "update_date": "2015-01-01 00:00:00",
      "update_date_sec": "1447153043",
      "start_date": "2015-11-03",
      "start_hour": "00:00:00",
      "end_date": "2015-12-02",
      "end_hour": "23:59:00",
      "reward_type": "11",
      "allow_multiple_discounts": "1",
      "is_weighted_promo": "0",
      "restriction_is_coupon": "0",
      "restriction_gift_count": "0",
      "restriction_is_total": "0",
      "restriction_is_active": "1",
      "min_qty": null,
      "max_qty": null,
      "discounted_price": null,
      "discounted_price_per_mida": null,
      "min_no_of_item_ofered": "10",
      "club_ids": null,
      "sys_updated_date": "2015-11-10 12:59:56",
      "sys_updated_date_sec": "1447153196"
    },
    .....
  ]
}
Required Creadential: 
API Key