<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/products/12345/lots/';
$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/12345/lots/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'GET';
$params = array(
'status' => 'active',
);
$url .= '?' . http_build_query($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_CUSTOMREQUEST, $method);
$result = curl_exec($curl);
?>
Name | Type | Example | Description |
---|---|---|---|
status | string active, expired | Status |
Name | Type | Example | Description |
---|---|---|---|
id | int | 1234 | ID |
title | string | 012-10002 | Title of the lot |
status | string active, expired | Status of the lot | |
expiration_date | date | 04-05-2024 | Expiration date of the lot |
barcode | int | 1234567890 | Barcode of the lot |
stock | float | 100.00 | Stock of the lot |
<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/products/12345/lots/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'POST';
$params = array(
'title' => '012-10002',
'expiration_date' => '04-05-2024',
'barcode' => 1234567890,
);
$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 |
---|---|---|---|
title | string | 012-10002 | Title |
expiration_date | date | 04-05-2024 | Expiration date |
barcode | int | 1234567890 | Barcode |
Name | Type | Example | Description |
---|---|---|---|
id | int | 1234 | ID |
title | string | 012-10002 | Title of the lot |
status | string active, expired | Status of the lot | |
expiration_date | date | 04-05-2024 | Expiration date of the lot |
barcode | int | 1234567890 | Barcode of the lot |
stock | float | 100.00 | Stock of the lot |