<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/clients/12345/balance/';
$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/clients/12345/balance/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'GET';
$params = array(
'since' => '2024-01-01',
'until' => '2024-12-31',
'status' => 'all',
'aggregate' => 'no',
);
$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 |
---|---|---|---|
since | date | 2024-01-01 | Min date |
until | date | 2024-12-31 | Max date |
status | string all, paid, unpaid | Status | |
aggregate | string yes, no | Aggregate accounts with same fiscal id |
Name | Type | Example | Description |
---|---|---|---|
id | int | 12345 | ID |
number | string | FT 01P2016/220 | Document number |
date | date | 2016-01-02 | Date |
store_id | int | 12345 | Store ID |
register_id | int | 12345 | Register ID |
date_due | date | 2016-01-15 | Payment date When payment is due |
date_supply | date | 2016-01-15 | Delivery Date |
system_time | datetime | 2016-01-02 10:01:20 | System date and time System time is always defined using UTC timezone |
local_time | datetime | 2016-01-02 10:01:20 | Local date and time Local time according to your timezone |
amount_gross | currency | 123.00 | Total amount |
amount_net | currency | 100.00 | Total amount before taxes |
type | string | FT | Document Type |
subtype | string | G | Document Subtype |
status | string | N | Status |
qty_left_to_invoice | float | 1 | Quantity left to invoice Returned only when document is a "Guia Global" |
total_unpaid | float | Unpaid amount | |
payment_status | string paid, pending, expired | Payment status | |
external_reference | string | PT00192-24-21302 | External reference |
operation_type | string in, out, info | Operation Type |
<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/clients/12345/balance/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'POST';
$params = array(
'amount' => 100,
'operation_type' => 'in',
'notes' => '',
);
$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 |
---|---|---|---|
id | int | 12345 | ID |
amount | currency | 100 | Amount |
operation_type | string in, out | Operation Type | |
notes | string | Notes |
Name | Type | Example | Description |
---|---|---|---|
id | int | 12345 | ID |
amount | currency | 100 | Amount |
operation_type | string in, out | Operation Type |