PHPackages                             tarfin-labs/tax-identification-number - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tarfin-labs/tax-identification-number

ActiveLibrary[API Development](/categories/api)

tarfin-labs/tax-identification-number
=====================================

API client for validating Tax Identification Number.

v1.2.0(3y ago)711.5k↓33.3%[1 PRs](https://github.com/tarfin-labs/tax-identification-number/pulls)MITPHPPHP ^7.4|^8.0|^8.1|^8.2

Since Jul 27Pushed 3y ago2 watchersCompare

[ Source](https://github.com/tarfin-labs/tax-identification-number)[ Packagist](https://packagist.org/packages/tarfin-labs/tax-identification-number)[ Docs](https://github.com/tarfin-labs/tax-identification-number)[ RSS](/packages/tarfin-labs-tax-identification-number/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (7)Used By (0)

API Client for Validating Tax Identification Number.
====================================================

[](#api-client-for-validating-tax-identification-number)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9f8f3addb8e359fb3bcfeb068b4d661a7c24258fe9606a6e4801693aaaab26da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74617266696e2d6c6162732f7461782d6964656e74696669636174696f6e2d6e756d6265722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tarfin-labs/tax-identification-number)[![Total Downloads](https://camo.githubusercontent.com/65fd05003f0a4b4be9b90d5c659ab2eced92a1f7f5f1727c82b85cef58c07e35/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74617266696e2d6c6162732f7461782d6964656e74696669636174696f6e2d6e756d6265722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tarfin-labs/tax-identification-number)[![GitHub Actions](https://github.com/tarfin-labs/tax-identification-number/actions/workflows/main.yml/badge.svg)](https://github.com/tarfin-labs/tax-identification-number/actions/workflows/main.yml/badge.svg)

Introduction
------------

[](#introduction)

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.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tarfin-labs/tax-identification-number
```

Usage
-----

[](#usage)

#### Listing tax offices by city plate:

[](#listing-tax-offices-by-city-plate)

```
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
    ],
]

```

#### Validating a tax identification number:

[](#validating-a-tax-identification-number)

```
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();
}
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Turan Karatuğ](https://github.com/tkaratug)
- [Faruk Can](https://github.com/frkcn)
- [Yunus Emre Deligöz](https://github.com/deligoez)
- [Hakan Özdemir](https://github.com/hozdemir)
- [Caner Ergez](https://github.com/CanerErgez)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 88.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~217 days

Total

4

Last Release

1097d ago

PHP version history (3 changes)v1.0.0PHP ^7.4|^8.0

v1.1.0PHP ^7.4|^8.0|^8.1

v1.2.0PHP ^7.4|^8.0|^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/50dc98a0c75a1aaba61d52bb073e1b0cbdb17f4d5ed4bd1c694c71784b088e16?d=identicon)[tkaratug](/maintainers/tkaratug)

![](https://www.gravatar.com/avatar/e252316490c5fc7bae7eb25b6c0cb301b49fbc706c32896fea9467b64cf3653b?d=identicon)[Tarfin Labs](/maintainers/Tarfin%20Labs)

---

Top Contributors

[![tkaratug](https://avatars.githubusercontent.com/u/4394344?v=4)](https://github.com/tkaratug "tkaratug (23 commits)")[![frkcn](https://avatars.githubusercontent.com/u/374634?v=4)](https://github.com/frkcn "frkcn (2 commits)")[![deligoez](https://avatars.githubusercontent.com/u/3030815?v=4)](https://github.com/deligoez "deligoez (1 commits)")

---

Tags

tarfin-labstax identification numvertax number validation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tarfin-labs-tax-identification-number/health.svg)

```
[![Health](https://phpackages.com/badges/tarfin-labs-tax-identification-number/health.svg)](https://phpackages.com/packages/tarfin-labs-tax-identification-number)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
