require_once(‘nusoap/nusoap.php’);
$client = new nusoap_client($url, true);
$bean = array(
// Login de libertya:
‘userName’ => $user,
‘password’ => $pass,
‘clientID’ => $clientID,
‘orgID’ => $orgID,
// Datos de la entidad comercial
‘mainTable’ => array(
‘Name’ => $name,
‘Description’ => $description,
‘TaxID’ => $cuit,
‘URL’ => $website,
‘IsActive’ => ‘true’,
‘IsVendor’ => ‘false’,
‘IsCustomer’ => ‘N’,
‘IsProspect’ => ‘true’,
‘IsEmployee’ => ‘false’,
‘TaxIdType’ => ’80’, // CUIT
),
// Datos de la location de la entidad comercial
‘location’ => array(
‘Address1’ => $address,
‘Phone’ => $phone1,
‘Phone2’ => $phone2,
‘Fax’ => $fax,
‘EMail’ => $email1,
‘Name’ => $address,
‘City’ => $ciudad,
‘IsBillTo’ => ‘true’,
‘IsRemitTo’ => ‘true’,
‘IsPayFrom’ => ‘true’,
‘IsActive’ => ‘true’,
‘IsShipTo’ => ‘true’,
‘C_Country_ID’ => ‘119’, // ARG
‘C_Region_ID’ => ‘1000083’, // BS AS
),
);
$params = array(
$bean,
);
$result = $client->call(“bPartnerCreate”, $params);
print_r($result); // vemos qué devolvió la API