<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/products/stocks/12345/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, $apiKey);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
?>
<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/products/stocks/12345/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, $apiKey);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
?>
Name | Type | Example | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
total | int | 155 | Stock Total | ||||||||||||||||
stores | collection | ||||||||||||||||||
|
<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/products/stocks/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'POST';
$params = array(
'product_id' => 12345,
'lot_id' => 12345,
'amount' => 21,
'type' => 'transfer',
'store_id' => 21,
'store_id_target' => 12345,
'stockAlert' => 5,
'obs' => 'Supplier delivery',
);
$content = json_encode($params);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, $apiKey);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_HTTPHEADER,
array(
"Content-type: application/json",
"Content-Length: " . strlen($content),
)
);
$result = curl_exec($curl);
?>
Name | Type | Example | Description |
---|---|---|---|
product_id | int | 12345 | Product ID |
lot_id | int | 12345 | Lot ID |
amount | float | 21 | Stock |
type | string reset, add, remove, transfer | Operation Type | |
store_id | int | 21 | Stock |
store_id_target | int | 12345 | To be used only when type = transfer |
stockAlert | int | 5 | Minimum Stock Alert |
obs | text | Supplier delivery | Observation |
Name | Type | Example | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
total | int | 155 | Stock Total | ||||||||||||||||
stores | collection | ||||||||||||||||||
|