<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/covenants/';
$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/covenants/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'GET';
$params = array(
'search' => 'VAT, Client id',
'status' => 'VAT, Client id',
'end_from' => '2024-05-04',
'end_to' => '2024-05-04',
'type' => 'Monday, Tuesday, etc...',
);
$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 |
---|---|---|---|
search | string | VAT, Client id | Search |
status | string all, active, expired, disabled | Search | |
end_from | date | 2024-05-04 | End Date From |
end_to | date | 2024-05-04 | End Date To |
type | string monday, tuesday, wednesday, thursday, friday, saturday, sunday, every_fifteen_days, every_month, every_two_months, every_three_months, every_four_months, every_six_months, every_year | Recurrency |
Name | Type | Example | Description |
---|---|---|---|
records | array | ||
pages | array |
Creates a covenant that is scheduled to generate a document on specific days for a client.
<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/covenants/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'POST';
$params = array(
'recurrency_type' => 'Monday, Tuesday, etc...',
'recurrency_start_date' => '2024-05-04',
'register_id' => 12345,
'date_execution_end' => '2024-05-04',
'draft_data' => '...',
'type' => 'FT',
'covenant_id' => 12345,
'status' => 1 or 0,
'execute_times' => 1,
'discount_code' => '23-180523-7',
'discount_amount' => 10.00,
'discount_percentage' => '2.50',
'date_due' => '2024-12-31',
'mode' => 'normal',
'date' => '2024-05-04',
'date_supply' => '2024-05-04',
'notes' => 'New season',
'ncr_id' => 'Specific to CV',
'external_reference' => 'PT00192-2024-21302',
'stock_operation' => 'out',
'ifthenpay' => 'no',
'eupago' => 'no',
'print_discount' => 'no',
'output' => 'html',
'output_template_id' => 123,
'tx_id' => '123',
'errors_full' => 'no',
'rest_room' => 12345,
'rest_table' => 12345,
'occupation' => 2,
'stamp_retention_amount' => 100.00,
'irc_retention_id' => 'a',
'related_document_id' => 12345,
'return_qrcode' => 1 or 0,
'multibanco' => array(
'entity' => '10022',
'reference' => '222333444',
'amount' => 22.53,
),
'client' => array(
'id' => 12345,
'fiscal_id' => '223098091',
'name' => 'Alberto Lopes',
'address' => 'Av. Sousa Magalhães, 126',
'postalcode' => '4100-039',
'city' => 'Lisboa',
'phone' => '210 192 930',
'mobile' => '918 876 546',
'email' => 'alberto.lopes@dominio.pt',
'website' => 'https://www.dominio.pt',
'notes' => 'VIP client',
'country' => 'PT',
'external_reference' => 'AB892798/19',
'send_email' => 'yes',
'billing_email' => 'alberto.lopes.contabilista@dominio.pt',
'irs_retention' => 'no',
),
'supplier' => array(
'id' => 12345,
'fiscal_id' => '223098091',
'name' => 'Alberto Lopes',
'address' => 'Av. Sousa Magalhães, 126',
'postalcode' => '4100-039',
'city' => 'Lisboa',
'phone' => '210 192 930',
'mobile' => '918 876 546',
'email' => 'alberto.lopes@dominio.pt',
'website' => 'https://www.dominio.pt',
'country' => 'PT',
'obs' => 'Some info about supplier',
),
'movement_of_goods' => array(
'vehicle_id' => '00-AB-00',
'show_prices' => 'yes',
'loadpoint' => array(
'date' => '2016-10-01',
'time' => '10:05',
'address' => 'Rua Amadeu Sousa Cardoso, 13',
'postalcode' => '4100-423',
'city' => 'Porto',
'country' => 'PT',
'store_id' => 1234,
'changestock' => 'out',
),
'landpoint' => array(
'is_global' => 'no',
'date' => '2016-10-02',
'time' => '09:15',
'address' => 'Rua Almada Negreiros, 98',
'postalcode' => '1100-123',
'city' => 'Lisboa',
'country' => 'PT',
'store_id' => 1234,
'receivestock' => 'yes',
),
),
'payments' => array(
array(
'id' => 1234,
'amount' => 100.00,
'date_due' => '2024-12-31',
),
),
'items' => array(
array(
'id' => 12345,
'reference' => 'CAFK001',
'gross_price' => 12345,
'supply_price' => 12345,
'qty' => 3.530,
'type_id' => 'P',
'variant_id' => 12345,
'title' => 'Café ao Kg',
'unit_id' => 1872,
'category_id' => 123,
'brand_id' => 124,
'discount_amount' => 124,
'discount_percentage' => '5',
'stock_control' => 1,
'stock_type' => 'M',
'tax_id' => 'NOR',
'tax_exemption' => 'M40',
'tax_exemption_law' => 'Artigo 13.º do CIVA',
'text' => 'New Edition',
'serial' => '87393872983792',
'tax_custom' => array(
'country' => 'PT, ES, FR, PT-AC',
'rate' => 23,
'code' => 'NOR, INT, RED, NS, ...',
'type' => 'IVA',
),
'reference_document' => array(
'document_number' => 'FT 01P2016/220',
'document_row' => 3,
'reference_id' => 1234,
'reference_relation' => 'GG',
),
),
),
'invoices' => array(
array(
'document_number' => 'FT 01P2016/28',
),
),
);
$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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
recurrency_type | string monday, tuesday, wednesday, thursday, friday, saturday, sunday, every_fifteen_days, every_month, every_two_months, every_three_months, every_four_months, every_six_months, every_year | Recurrency | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
recurrency_start_date | string | 2024-05-04 | Start date | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
register_id | int | 12345 | POS ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
date_execution_end | string | 2024-05-04 | Start date | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
draft_data | string | ... | String | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type | stringFT - FaturaFS - Fatura SimplificadaFR - Fatura ReciboNC - Nota de CréditoDC - Consulta de MesaPF - Fatura Pró-FormaOT - OrçamentoEC - EncomendaGA - Guia de Ativos PrópriosGT - Guia de TransporteGR - Guia de RemessaGD - Guia de DevoluçãoRG - Recibo | Type of document | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
covenant_id | int | 12345 | Covenant ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
status | int | 1 or 0 | Status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
execute_times | int | 1 | Execute times | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
discount_code | string | 23-180523-7 | Discount code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
discount_amount | currency | 10.00 | Discount in euros | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
discount_percentage | string | 2.50 | Discount in percentage | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
date_due | date | 2024-12-31 | Due date | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payments | collection | Payment Methods | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mode | string normal, tests | Working mode If not provided, it will be assumed register's mode definition | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
date | date | 2024-05-04 | If not set, defaults to current date. Can not be ealier than the one from latest document, nor later than the current date. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
date_supply | date | 2024-05-04 | If not set, defaults to current date. Date when goods/services are made available to customer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
notes | string | New season | Notes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ncr_id | string | Specific to CV | NC reason ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
external_reference | string | PT00192-2024-21302 | External reference For example, to reference a tracking code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stock_operation | stringin - Increment stocknone - Don't change stockout - Decrement stock | Operation on items with stock_control. If not sent, system will use the default for the type of document being created | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ifthenpay | string no, yes | Generate ifthenpay reference. If not set, default is no. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
eupago | string no, yes | Generate euPago reference. If not set, default is no. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
multibanco | array | Your own multibanco data. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
client | array | Client | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
supplier | array | Supplier | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
items | collection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
movement_of_goods | array | Transportation info | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
invoices | collection | When creating a RG | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
print_discount | string yes, no | Print Discount Coupons | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
output | string pdf, html, escpos, tpasibs | Printable Output | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
output_template_id | int | 123 | Template ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tx_id | string | 123 | Transaction unique identifier. If set, this will ensure that only a document may be created using the same tx_id, even if multiple requests are made by mistake. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
errors_full | string no, yes | Whether to return full error info or just error string | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rest_room | int | 12345 | ID Room | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rest_table | int | 12345 | ID Table | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
occupation | int | 2 | Occupation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stamp_retention_amount | currency | 100.00 | Amount in euros | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
irc_retention_id | text | a | IRC ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
related_document_id | int | 12345 | ID of a document that relates to this one | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return_qrcode | int | 1 or 0 | Return SVG Qrcode |
Name | Type | Example | Description |
---|---|---|---|
is_update | boolean |
<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/covenants/';
$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 |
---|---|---|---|
done | boolean |