With this package you can get tax offices by city plates and validate tax identification numbers on GIB (Gelir İdaresi Başkanlığı).
This package requires PHP
7.4
or higher.
You can install the package via composer:
composer require tarfin-labs/tax-identification-number
use TarfinLabs\TaxIdentificationNumber\Validation;
use TarfinLabs\TaxIdentificationNumber\Exceptions\NotFoundException;
try {
$offices = Validation::init()->getTaxOfficesByCityPlate(34);
} catch (NotFoundException $e) {
echo $e->getMessage();
}
Output:
[
[
"code" => "034XXX",
"name" => "TAX OFFICE NAME 1",
],
[
"code" => "034XXY",
"name" => "TAX OFFICE NAME 2
],
]
use TarfinLabs\TaxIdentificationNumber\Validation;
try {
$response = Validation::init()->validate(1234567890, '034455');
$response->isValid(); // boolean
$response->getStatus(); // "1"
$response->getTckn(); // ""
$response->getStatusText(); // "FAAL"
$response->getTaxNumber(); // "123123123"
$response->getTaxOfficeNumber(); // "034455"
$response->getCompanyTitle(); // "ACME INC."
} catch (\Throwable $e) {
echo $e->getMessage();
}
If you want to validate a TCKN for a sole proprietorship, you need to give TCKN (11 characters) as first parameter to validate()
method.
use TarfinLabs\TaxIdentificationNumber\Validation;
try {
$response = Validation::init()->validate(12345678902, '034455');
$response->isValid(); // boolean
$response->getStatus(); // "1"
$response->getTckn(); // "12345678902"
$response->getStatusText(); // "FAAL"
$response->getTaxNumber(); // "9999999999"
$response->getTaxOfficeNumber(); // "034455"
$response->getCompanyTitle(); // "METİN KAYA"
} catch (\Throwable $e) {
echo $e->getMessage();
}
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.