<?php
$url = 'https://www.vendus.pt/ws/v1.1/clients/';
$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/clients/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'GET';
$params = array(
'q' => 'Alberto',
'fiscal_id' => '123456789',
'name' => 'Alberto Caeiro',
'email' => 'alberto.caeiro@portugal.pt',
'external_reference' => 'AB892798/19',
'status' => 'active',
'date' => '2021, 2021-06, 2021-06-05',
'id' => array(
'min' => 100,
'max' => 500,
),
);
$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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| q | string | Alberto | Search string | ||||||||||||
| fiscal_id | fiscal_id | 123456789 | Fiscal ID | ||||||||||||
| name | string | Alberto Caeiro | Name | ||||||||||||
| alberto.caeiro@portugal.pt | |||||||||||||||
| external_reference | string | AB892798/19 | External Reference | ||||||||||||
| status | stringactive - Ativoinactive - Inativo | Status | |||||||||||||
| date | string | 2021, 2021-06, 2021-06-05 | Creation date | ||||||||||||
| id | array | ID range to search | |||||||||||||
| |||||||||||||||
| Name | Type | Example | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int | 12345 | ID | ||||||||||||||||
| fiscal_id | string | 123456789 | Fiscal ID | ||||||||||||||||
| external_reference | string | AB892798/19 | External Reference | ||||||||||||||||
| name | string | Alberto Caeiro | Name | ||||||||||||||||
| address | string | Av. Sousa Magalhães, 126 | Address | ||||||||||||||||
| city | string | Lisboa | City | ||||||||||||||||
| postalcode | string | 4100-039 | Postal code | ||||||||||||||||
| phone | string | 210 192 930 | Phone | ||||||||||||||||
| mobile | string | 918 876 546 | Cellphone | ||||||||||||||||
| alberto.lopes@dominio.pt | |||||||||||||||||||
| website | url | https://www.dominio.pt | Site url | ||||||||||||||||
| country | country | PT | Country code using ISO 3166-1 alpha-2 | ||||||||||||||||
| price_group | array | Price Group | |||||||||||||||||
| |||||||||||||||||||
| send_email | stringyes - Simno - Não | Send Invoice | |||||||||||||||||
| irs_retention | stringyes - Simno - Não | Whether client does IRS retention | |||||||||||||||||
| status | stringactive - Ativoinactive - Inativo | Status | |||||||||||||||||
| notes | string | Notes | |||||||||||||||||
| date | string | Creation date | |||||||||||||||||
<?php
$url = 'https://www.vendus.pt/ws/v1.1/clients/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/clients/12345/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'GET';
$params = array(
'include_balance' => '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 |
|---|---|---|---|
| include_balance | string yes, no | Whether to include balance | |
| Name | Type | Example | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int | 12345 | ID | ||||||||||||||||
| fiscal_id | string | 123456789 | Fiscal ID | ||||||||||||||||
| external_reference | string | AB892798/19 | External Reference | ||||||||||||||||
| name | string | Alberto Caeiro | Name | ||||||||||||||||
| address | string | Av. Sousa Magalhães, 126 | Address | ||||||||||||||||
| city | string | Lisboa | City | ||||||||||||||||
| postalcode | string | 4100-039 | Postal code | ||||||||||||||||
| phone | string | 210 192 930 | Phone | ||||||||||||||||
| mobile | string | 918 876 546 | Cellphone | ||||||||||||||||
| alberto.lopes@dominio.pt | |||||||||||||||||||
| website | url | https://www.dominio.pt | Site url | ||||||||||||||||
| country | country | PT | Country code using ISO 3166-1 alpha-2 | ||||||||||||||||
| price_group | array | Price Group | |||||||||||||||||
| |||||||||||||||||||
| send_email | stringyes - Simno - Não | Send Invoice | |||||||||||||||||
| irs_retention | stringyes - Simno - Não | Whether client does IRS retention | |||||||||||||||||
| status | stringactive - Ativoinactive - Inativo | Status | |||||||||||||||||
| notes | string | Notes | |||||||||||||||||
| date | string | Creation date | |||||||||||||||||
| balance | array | Balance | |||||||||||||||||
| |||||||||||||||||||
<?php
$url = 'https://www.vendus.pt/ws/v1.1/clients/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'POST';
$params = array(
'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',
'external_reference' => 'AB892798/19',
'notes' => '',
'email' => 'alberto.lopes@dominio.pt',
'website' => 'https://www.dominio.pt',
'country' => 'PT',
'price_group_id' => 123,
'send_email' => 'yes',
'irs_retention' => 'no',
);
$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 |
|---|---|---|---|
| fiscal_id | fiscal_id | 223098091 | Fiscal ID of client If client is portuguese, it must be a valid fiscal id. If foreigner, first two characters must be country initials |
| name | string | Alberto Lopes | Client Name |
| address | string | Av. Sousa Magalhães, 126 | Postal Address |
| postalcode | string | 4100-039 | Postal Code |
| city | string | Lisboa | City |
| phone | string | 210 192 930 | Phone |
| mobile | string | 918 876 546 | Mobile |
| external_reference | string | AB892798/19 | External Reference |
| notes | string | Notes | |
| alberto.lopes@dominio.pt | |||
| website | url | https://www.dominio.pt | Site url |
| country | country | PT | Country code using ISO 3166-1 alpha-2 |
| price_group_id | int | 123 | Price Group ID |
| send_email | stringyes - Simno - Não | Send Invoice | |
| irs_retention | stringyes - Simno - Não | Whether client does IRS retention | |
| Name | Type | Example | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int | 12345 | ID | ||||||||||||||||
| fiscal_id | string | 123456789 | Fiscal ID | ||||||||||||||||
| external_reference | string | AB892798/19 | External Reference | ||||||||||||||||
| name | string | Alberto Caeiro | Name | ||||||||||||||||
| address | string | Av. Sousa Magalhães, 126 | Address | ||||||||||||||||
| city | string | Lisboa | City | ||||||||||||||||
| postalcode | string | 4100-039 | Postal code | ||||||||||||||||
| phone | string | 210 192 930 | Phone | ||||||||||||||||
| mobile | string | 918 876 546 | Cellphone | ||||||||||||||||
| alberto.lopes@dominio.pt | |||||||||||||||||||
| website | url | https://www.dominio.pt | Site url | ||||||||||||||||
| country | country | PT | Country code using ISO 3166-1 alpha-2 | ||||||||||||||||
| price_group | array | Price Group | |||||||||||||||||
| |||||||||||||||||||
| send_email | stringyes - Simno - Não | Send Invoice | |||||||||||||||||
| irs_retention | stringyes - Simno - Não | Whether client does IRS retention | |||||||||||||||||
| status | stringactive - Ativoinactive - Inativo | Status | |||||||||||||||||
| notes | string | Notes | |||||||||||||||||
| date | string | Creation date | |||||||||||||||||
| balance | array | Balance | |||||||||||||||||
| |||||||||||||||||||
<?php
$url = 'https://www.vendus.pt/ws/v1.1/clients/12345/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'PATCH';
$params = array(
'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',
'external_reference' => 'AB892798/19',
'notes' => '',
'email' => 'alberto.lopes@dominio.pt',
'website' => 'https://www.dominio.pt',
'country' => 'PT',
'price_group_id' => 123,
'send_email' => 'yes',
'status' => 'active',
);
$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 |
|---|---|---|---|
| fiscal_id | fiscal_id | 223098091 | Fiscal ID of client If client is portuguese, it must be a valid fiscal id. If foreigner, first two characters must be country initials |
| name | string | Alberto Lopes | Client Name |
| address | string | Av. Sousa Magalhães, 126 | Postal Address |
| postalcode | string | 4100-039 | Postal Code |
| city | string | Lisboa | City |
| phone | string | 210 192 930 | Phone |
| mobile | string | 918 876 546 | Mobile |
| external_reference | string | AB892798/19 | External Reference |
| notes | string | Notes | |
| alberto.lopes@dominio.pt | |||
| website | url | https://www.dominio.pt | Site url |
| country | country | PT | Country code using ISO 3166-1 alpha-2 |
| price_group_id | int | 123 | Price Group ID |
| send_email | stringyes - Simno - Não | Send Invoice | |
| status | stringactive - Ativoinactive - Inativo | Status | |
| Name | Type | Example | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int | 12345 | ID | ||||||||||||||||
| fiscal_id | string | 123456789 | Fiscal ID | ||||||||||||||||
| external_reference | string | AB892798/19 | External Reference | ||||||||||||||||
| name | string | Alberto Caeiro | Name | ||||||||||||||||
| address | string | Av. Sousa Magalhães, 126 | Address | ||||||||||||||||
| city | string | Lisboa | City | ||||||||||||||||
| postalcode | string | 4100-039 | Postal code | ||||||||||||||||
| phone | string | 210 192 930 | Phone | ||||||||||||||||
| mobile | string | 918 876 546 | Cellphone | ||||||||||||||||
| alberto.lopes@dominio.pt | |||||||||||||||||||
| website | url | https://www.dominio.pt | Site url | ||||||||||||||||
| country | country | PT | Country code using ISO 3166-1 alpha-2 | ||||||||||||||||
| price_group | array | Price Group | |||||||||||||||||
| |||||||||||||||||||
| send_email | stringyes - Simno - Não | Send Invoice | |||||||||||||||||
| irs_retention | stringyes - Simno - Não | Whether client does IRS retention | |||||||||||||||||
| status | stringactive - Ativoinactive - Inativo | Status | |||||||||||||||||
| notes | string | Notes | |||||||||||||||||
| date | string | Creation date | |||||||||||||||||
| balance | array | Balance | |||||||||||||||||
| |||||||||||||||||||
<?php
$url = 'https://www.vendus.pt/ws/v1.1/clients/';
$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 |
|---|---|---|---|
| status | string |