<?php
$url = 'https://www.vendus.pt/ws/v1.1/receipts/';
$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://www.vendus.pt/ws/v1.1/receipts/';
$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, inactive | Status | |
| Name | Type | Example | Description |
|---|---|---|---|
| id | int | Receipt ID | |
| title | string | Documento A4 | Title |
| type | string layouta4, receipt | Type | |
<?php
$url = 'https://www.vendus.pt/ws/v1.1/receipts/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://www.vendus.pt/ws/v1.1/receipts/12345/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'GET';
$params = array(
'show_references' => 'yes',
'show_tax' => 'yes',
'show_address' => 'yes',
'nc_signature' => 'yes',
);
$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 |
|---|---|---|---|
| show_references | string yes, no | Show References | |
| show_tax | string yes, no | Show Tax | |
| show_address | string yes, no | Show Address | |
| nc_signature | string yes, no | NC - Signature | |
| Name | Type | Example | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int | Receipt ID | |||||||||||||||||||||||||
| title | string | Documento A4 | Title | ||||||||||||||||||||||||
| type | string layouta4, receipt | Type | |||||||||||||||||||||||||
| phone | string | 210192930 | Phone | ||||||||||||||||||||||||
| mobile | string | 918 876 546 | Cellphone | ||||||||||||||||||||||||
| fax | string | 210 192 930 | Fax | ||||||||||||||||||||||||
| alberto.lopes@dominio.pt | |||||||||||||||||||||||||||
| site | url | https://www.dominio.pt | Site url | ||||||||||||||||||||||||
| nib | string | 1234 4321 12345678901 72 | |||||||||||||||||||||||||
| iban | string | PT50 1234 4321 12345678901 72 | |||||||||||||||||||||||||
| swift | string | CGDIPTPL | Swift | ||||||||||||||||||||||||
| header | string | Header Text | |||||||||||||||||||||||||
| footer | string | Footer Text | |||||||||||||||||||||||||
| served | string | Served | |||||||||||||||||||||||||
| images | array | Images List | |||||||||||||||||||||||||
| |||||||||||||||||||||||||||
<?php
$url = 'https://www.vendus.pt/ws/v1.1/receipts/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'POST';
$params = array(
'title' => 'Documento A4',
'type' => 'layouta4',
'phone' => '210192930',
'mobile' => '918 876 546',
'fax' => '210 192 930',
'email' => 'alberto.lopes@dominio.pt',
'site' => 'https://www.dominio.pt',
'nib' => '1234 4321 12345678901 72',
'iban' => 'PT50 1234 4321 12345678901 72',
'swift' => 'CGDIPTPL',
'header' => '',
'footer' => '',
'served' => '',
'show_references' => 'yes',
'show_tax' => 'yes',
'show_address' => 'yes',
'nc_signature' => 'yes',
'image' => 'https://www.site.com/img/1.png',
);
$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 | Documento A4 | Title |
| type | string layouta4, receipt | Type | |
| phone | string | 210192930 | Phone |
| mobile | string | 918 876 546 | Cellphone |
| fax | string | 210 192 930 | Fax |
| alberto.lopes@dominio.pt | |||
| site | url | https://www.dominio.pt | Site url |
| nib | string | 1234 4321 12345678901 72 | |
| iban | string | PT50 1234 4321 12345678901 72 | |
| swift | string | CGDIPTPL | Swift |
| header | string | Header Text | |
| footer | string | Footer Text | |
| served | string | Served | |
| show_references | string yes, no | Show References | |
| show_tax | string yes, no | Show Tax | |
| show_address | string yes, no | Show Address | |
| nc_signature | string yes, no | NC - Signature | |
| image | string | https://www.site.com/img/1.png | Image Either an url or a base64 encoded string |
| Name | Type | Example | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int | Receipt ID | |||||||||||||||||||||||||
| title | string | Documento A4 | Title | ||||||||||||||||||||||||
| type | string layouta4, receipt | Type | |||||||||||||||||||||||||
| phone | string | 210192930 | Phone | ||||||||||||||||||||||||
| mobile | string | 918 876 546 | Cellphone | ||||||||||||||||||||||||
| fax | string | 210 192 930 | Fax | ||||||||||||||||||||||||
| alberto.lopes@dominio.pt | |||||||||||||||||||||||||||
| site | url | https://www.dominio.pt | Site url | ||||||||||||||||||||||||
| nib | string | 1234 4321 12345678901 72 | |||||||||||||||||||||||||
| iban | string | PT50 1234 4321 12345678901 72 | |||||||||||||||||||||||||
| swift | string | CGDIPTPL | Swift | ||||||||||||||||||||||||
| header | string | Header Text | |||||||||||||||||||||||||
| footer | string | Footer Text | |||||||||||||||||||||||||
| served | string | Served | |||||||||||||||||||||||||
| images | array | Images List | |||||||||||||||||||||||||
| |||||||||||||||||||||||||||
<?php
$url = 'https://www.vendus.pt/ws/v1.1/receipts/12345/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'PATCH';
$params = array(
'title' => 'Documento A4',
'type' => 'layouta4',
'phone' => '210192930',
'mobile' => '918 876 546',
'fax' => '210 192 930',
'email' => 'alberto.lopes@dominio.pt',
'site' => 'https://www.dominio.pt',
'nib' => '1234 4321 12345678901 72',
'iban' => 'PT50 1234 4321 12345678901 72',
'swift' => 'CGDIPTPL',
'header' => '',
'footer' => '',
'served' => '',
'show_references' => 'yes',
'show_tax' => 'yes',
'show_address' => 'yes',
'nc_signature' => 'yes',
'image' => 'https://www.site.com/img/1.png',
);
$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 | Documento A4 | Title |
| type | string layouta4, receipt | Type | |
| phone | string | 210192930 | Phone |
| mobile | string | 918 876 546 | Cellphone |
| fax | string | 210 192 930 | Fax |
| alberto.lopes@dominio.pt | |||
| site | url | https://www.dominio.pt | Site url |
| nib | string | 1234 4321 12345678901 72 | |
| iban | string | PT50 1234 4321 12345678901 72 | |
| swift | string | CGDIPTPL | Swift |
| header | string | Header Text | |
| footer | string | Footer Text | |
| served | string | Served | |
| show_references | string yes, no | Show References | |
| show_tax | string yes, no | Show Tax | |
| show_address | string yes, no | Show Address | |
| nc_signature | string yes, no | NC - Signature | |
| image | string | https://www.site.com/img/1.png | Image Either an url or a base64 encoded string |
| Name | Type | Example | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int | Receipt ID | |||||||||||||||||||||||||
| title | string | Documento A4 | Title | ||||||||||||||||||||||||
| type | string layouta4, receipt | Type | |||||||||||||||||||||||||
| phone | string | 210192930 | Phone | ||||||||||||||||||||||||
| mobile | string | 918 876 546 | Cellphone | ||||||||||||||||||||||||
| fax | string | 210 192 930 | Fax | ||||||||||||||||||||||||
| alberto.lopes@dominio.pt | |||||||||||||||||||||||||||
| site | url | https://www.dominio.pt | Site url | ||||||||||||||||||||||||
| nib | string | 1234 4321 12345678901 72 | |||||||||||||||||||||||||
| iban | string | PT50 1234 4321 12345678901 72 | |||||||||||||||||||||||||
| swift | string | CGDIPTPL | Swift | ||||||||||||||||||||||||
| header | string | Header Text | |||||||||||||||||||||||||
| footer | string | Footer Text | |||||||||||||||||||||||||
| served | string | Served | |||||||||||||||||||||||||
| images | array | Images List | |||||||||||||||||||||||||
| |||||||||||||||||||||||||||