Product - חיפוש מחיר של מוצר בודד

Get single product item for specific chain and branch store. 

Request parameters: 
  • api_key or "access_token"
  • chain_id - represent the supermarket chain Id for example "Dor Alon" chain_id = 7290492000005
  • store_id - represent the branch store within supermarket chain. Can be concluded from calling "stores" operation. For example 501 
  • item_code - the item code as published by prices feeds supplied by supermarket chain
  • prepare_chain_names - Optional. Sending this parameter with value "true" will add "chain_name" field to returned items
  • prepare_stores_names - Optional. Sending this parameter with value "true" will add "store_name", "address", "city" fields to returned items

 

Sample code: 
<?php

$params = array(
    "api_key" => "YOUR_API_KEY", // or "access_token" => "some-token"
    "chain_id" => "7290492000005",
    "store_id" => "501",
    "item_code" => "4014400901191",
);
$url = "http://api.priceli.co.il/v1/priceli/product";
$response = curlGET($url, $params);
$data = json_decode($response);
echoResponse($response);

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

} 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": 1,
  "total": 1,
  "pageLimit": 1,
  "pageNum": 1,
  "data": {
    "id": "256",
    "chain_id": "7290492000005",
    "sub_chain_id": "1",
    "store_id": "501",
    "bikoret_no": "9",
    "item_id": null,
    "item_code": "4014400901191",
    "item_code_short": "901191",
    "item_type": "1",
    "item_name": "×‘×•× ×‘×•× ×™×™×¨×” מרסי",
    "price_update_date": "2015-01-01 00:00:00",
    "price_update_date_sec": "0",
    "manufacturer_name": null,
    "manufacturer_country": null,
    "manufacturer_item_description": null,
    "unit_qty": "גרמים",
    "quantity": "250.00",
    "unit_of_measure": null,
    "bis_weighted": null,
    "qty_in_package": "1",
    "item_price": "33.30",
    "unit_of_measure_price": "13.32",
    "allow_discount": "1",
    "item_status": "1",
    "text_tokens": "33.30 4014400901191 1 1",
    "sys_updated_date": "2015-06-03 14:45:19",
    "sys_updated_date_sec": "1433331919"
  }
}
Required Creadential: 
API Key
OR Access Token