Skip to content

Instantly share code, notes, and snippets.

@khapota
Last active December 27, 2016 15:06
Show Gist options
  • Save khapota/8e33a48ce1312d0df896bb8423f29448 to your computer and use it in GitHub Desktop.
Save khapota/8e33a48ce1312d0df896bb8423f29448 to your computer and use it in GitHub Desktop.
linnworks update price
function updatePrice($itemId, $price, $title) {
$header = array('Host' => 'eu1.linnworks.net',
'Connection' => 'keep-alive',
'Accept' => 'application/json, text/javascript, */*; q=0.01',
'Origin' => 'https://www.linnworks.net',
'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36',
'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8',
'Referer' => 'https://www.linnworks.net/',
'Authorization' => '6f004779-0784-45bd-86b5-7bec6bc475',
'Accept-Encoding' => 'gzip, deflate');
$url = 'https://eu1.linnworks.net//api/Inventory/UpdateInventoryItemPrices';
$options = array("timeout"=> 60);
$data = 'inventoryItemPrices=[
{
"Price": '. $price . ',
"Source": "' . $itemId . '",
"SubSource": "' . $title . '",
"StockItemId": "1364a381-3d2e-be94-2343-943b049e24ff"
},
]';
$response = Requests::post($url, $header, $data, $options);
return $response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment