KiCompany en

From services.krediidiinfo.ee
Revision as of 15:06, 18 May 2020 by Madis (talk | contribs) (findCompanies)
Jump to: navigation, search
Flag of Estonia.svg eesti keeles

Introduction

KiCompany is the name of a Web Service based on SOAP protocol for requesting basic data about companies, non-profit organizations and state agencies. The interface is designed clients who want to integrate the functionality of company request into their own system.

WSDL

KiCompany WDSL is located at http://services.krediidiinfo.ee/KiCompany.wsdl.

WSDL for users of Microsoft Development Tools is located at: http://services.krediidiinfo.ee/KiCompanyLit.wsdl. It differs from the previous WSDL in that RPC/litteral is used instead of RPC/encode.

Testing

In short KiCompany testrequests require the relevant permission and adding "debug" parameter to the URL (https://services.krediidiinfo.ee/soap.php?name=KiCompany -> https://services.krediidiinfo.ee/soap.php?name=KiCompany&debug). More and detailed information about testing can be found on the http://services.krediidiinfo.ee/wiki/index.php/Web_Service_Debugging page.

Methods

getName

Requesting company’s name.

Name Type Description
Input parameter: regCode xs:string Company’s registry code.
Output parameter: name xs:string Company’s name. Output value is an empty string if the name is not found (compnay does not exist, error in the registry code etc).


findCompanies

Searching companies by name. The result is an array, which includes companies’ names and registry codes according to the search string.

Name Type Description
Input parameter: name xs:string Company’s name or the beginning of it. Inserting % at the start will search the existence of that string anywhere in the company's name. NB! Search with % can be considerably slower.
count xs:int Maximum number of companies found in the result of the method (The method does not return at once more than 100 companies)
Output parameter: companies ResultCompanyIDDataArray Indexed array which elements are ResultCompanyIDData array elements.


ResultCompanyIDData is a record with the following structure:

Name Type Description
regCode xs:string Company’s registry code
name xs:string Company’s name.

getBasicData

Requesting company’s basic data.

Name Type Description
Input parameter: regCode xs:string Company’s registry code.
Output parameter: data CompanyBasicDataType A record with company’s data.


If the company according regCode is not found, the SOAP error message code -10231 will be returned.

CompanyBasicDataType record with the following structure:

Name Type Description
regCode xs:string Company’s registry code
name xs:string Company’s name.
street xs:string Street name in postal address (for marketing activities)
postCode xs:string Postcode in postal address (for marketing activities)
city xs:string Name of the city in postal address (for marketing activities)
legalStreet xs:string Street name in legal address
legalPostCode xs:string Postcode in legal address
legalCity xs:string Name of city in legal address
phones xs:string Phone numbers
faxes xs:string Fax numbers
web xs:string Website URL
emails xs:string E-post addresses
legalForm xs:string Legal form
shareCapital xs:int Amount of share capital
shareCapitalCur xs:string Currency of share capital
regTime xs:string Company’s registration time in Commercial Register. Format: yyyy-mm-dd
regPlace xs:string Name of registration department where company was registered
activities xs:string The list of company’s activities. Before every activity there is a string '* ' (asterisk and space). From 7/29/2011 an empty string will be given as a result.
status xs:string Status in Commercial Register

getContactData

Requesting company’s contact data.

Name Type Description
Input parameter: regCode xs:string company’s registry code.
Output parameter: data CompanyContactDataType A record with contact data

If the company according regCode is not found, the SOAP error message code -10231 will be returned.

CompanyContactDataType record is with the following structure:

Name Type Description
street xs:string Street name in postal address (for marketing activities)
postCode xs:string Postcode in postal address (for marketing activities)
city xs:string Name of the city in postal address (for marketing activities)
phones xs:string Phone numbers
faxes xs:string Fax numbers
web xs:string Website URL
emails xs:string E-post addresses


getLegalPostAddress

Requesting company’s legal post address.

Name Type Description
Input parameters: regCode xs:string company’s registry code.
Output parameter: data CompanyPostAddressType A record with legal address data

If the company according regCode is not found, the SOAP error message code -10231 will be returned.

CompanyPostAddressType record is with the following structure:

Name Type Description
street xs:string street name
postCode xs:string postcode
city xs:string city


isRegCodeValid

Verification of company’s registry code.

Name Type Description
Input parameter: regCode xs:string Company’s registry code
Output parameter: isValid xs:boolean True if registry code given with parameter is an eight-digit number and the last check digit is correct.



getVATNo

Requesting company’s VAT number .

Name Type Description
Input parameter: regCode xs:string Company’s registry code.
Output parameter: vatNo xs:string VAT number. If VAT number is not valid or the company is not VAT pager, an empty string will be given.


Error codes

-10231 No company found!

No company found with the registry code given for parameter from Creditinfo’s database. Check the registry code.

(see more general error codes)


Example in PHP

Example of using KiCompany web service in PHP.

<?php
/**
 * Example of using KiCompany web service of Creditinfo Eesti AS
 * 
 * @author Rait Kapp <rait@creditinfo.ee>
 * @created 15.02.2011
 */
$wsdl_url = 'http://services.krediidiinfo.ee/KiCompany.wsdl';
$server_url = 'https://services.krediidiinfo.ee/soap.php?name=KiCompany'; 


$params = array('location' => $server_url
              , 'login'         => 'online_code' // Online Code issued by Creditinfo client management. Make sure that login value is string type (PHP bug?).
              , 'password'      => 'passwd'
//              , 'proxy_host'    => 'cache.neti.ee'   // If necessary use proxy and proxy port.
//              , 'proxy_port'    => 8080
              , 'encoding' => 'ISO-8859-13'
               );


$client = new SoapClient($wsdl_url, $params);


$name = 'KREDIIDI';
$companies = $client->findCompanies($name, 3);
print_r($companies);

$regCode = '10256137';
$name = $client->getName($regCode);
echo "Registry code {$regCode} belongs to the company {$name}\n";

$data = $client->getBasicData($regCode);
echo "Address: {$data->street} {$data->postCode} {$data->city}\n";

$regCode = '10256136'; // check number is invalid!
if (!$client->isRegCodeValid($regCode)) {
    echo "Registry code {$regCode} is incorrect.\n";
} else {
    echo "Registry code {$regCode} is correct.\n";
}

?>

Program output:

Array
(
    [0] => stdClass Object
        (
            [regCode] => 90006012
            [name] => KREDIIDI JA EKSPORDI GARANTEERIMISE SIHTASUTUS KREDEX
        )

    [1] => stdClass Object
        (
            [regCode] => 10704587
            [name] => KREDIIDI JÄRELVALVE OÜ
        )

    [2] => stdClass Object
        (
            [regCode] => 11626688
            [name] => KREDIIDIBÜROO OÜ
        )

)
Registry code 10256137 belongs to the company CREDITINFO EESTI AS
Address: Narva mnt 5 10117 Tallinn
Registry code 10256136 is incorrect.