You can sign up for a Wasi account at https://wasi.co and get your id_company and wasi_token
PHP 7.1.* and later.
You can install the bindings via Composer. Run the following command:
composer require wasico/sdk-php
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
Or add manually to your composer.json file for constant update
"wasico/sdk-php": ">=0.0.1"
Set your configuration only one time in execution time
\Wasi\SDK\Configuration::set([
'v' => 1, //API version here
'id_company' => 123456, //Your id_company here
'wasi_token' => 'AbCd_eFgH_IjKl_MnOp', //Your WasiToken here
]);
Use Wasi models (\Wasi\SDK\Models) for get Objects of the API
#Replace 123456 with the id_property
$property = \Wasi\SDK\Models\Property::find(123456);
#Use API filters in the 'where' method
$properties = \Wasi\SDK\Models\Property::where('title', 'Hotel')->get();
$customer = new \Wasi\SDK\Models\Customer();
$customer->id_user = 123;
$customer->id_country = 1;
$customer->id_region = 26;
$customer->id_city = 63;
$customer->first_name = "Jose W";
$customer->save()
#Now you can get id_client:
$id_client = $customer->id_client;
$customer = \Wasi\SDK\Models\Customer::find(4321);
$customer->last_name = 'Capera';
$customer->save()