<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/discountcards/';
$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/discountcards/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'GET';
$params = array(
'code' => '1-123456/AB',
'status' => 'done',
'category' => 1234,
);
$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 |
---|---|---|---|
code | string | 1-123456/AB | Code |
status | string pending, done | Status | |
category | int | 1234 | Category ID |
Name | Type | Example | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | int | Register ID | |||||||||||||
code | string | 1-123456/AB | Code | ||||||||||||
amount | float | 10 | Title | ||||||||||||
type | string money, percent | Type | |||||||||||||
status | string pending, done | Status | |||||||||||||
category | array | Category | |||||||||||||
| |||||||||||||||
date | date | Data Create | |||||||||||||
date_expire | date | Expiration Date | |||||||||||||
obs | string | Observations | |||||||||||||
date_used | date | Date Used |
<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/discountcards/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/discountcards/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 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | int | Register ID | |||||||||||||
code | string | 1-123456/AB | Code | ||||||||||||
amount | float | 10 | Title | ||||||||||||
type | string money, percent | Type | |||||||||||||
status | string pending, done | Status | |||||||||||||
category | array | Category | |||||||||||||
| |||||||||||||||
date | date | Data Create | |||||||||||||
date_expire | date | Expiration Date | |||||||||||||
obs | string | Observations | |||||||||||||
date_used | date | Date Used |
<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/discountcards/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'POST';
$params = array(
'code' => '1-123456/AB',
'category' => 1234,
'type' => 'money',
'amount' => 10,
'date_expire' => '',
'obs' => '',
'output' => 'html',
);
$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 |
---|---|---|---|
code | string | 1-123456/AB | Status |
category | int | 1234 | Category ID |
type | string money, percent | Type | |
amount | float | 10 | Amount |
date_expire | date | Date Expire | |
obs | string | Observations | |
output | string html, pdf, escpos | Output |
Name | Type | Example | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | int | Register ID | |||||||||||||
code | string | 1-123456/AB | Code | ||||||||||||
amount | float | 10 | Title | ||||||||||||
type | string money, percent | Type | |||||||||||||
status | string pending, done | Status | |||||||||||||
category | array | Category | |||||||||||||
| |||||||||||||||
date | date | Data Create | |||||||||||||
date_expire | date | Expiration Date | |||||||||||||
obs | string | Observations | |||||||||||||
date_used | date | Date Used | |||||||||||||
output | text | Printable output | Base64 Encoded |