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.

2.0.0(2mo ago)712.3k↓33.3%[1 PRs](https://github.com/tarfin-labs/tax-identification-number/pulls)MITPHPPHP ^8.3|^8.4|^8.5CI passing

Since Jul 27Pushed 2mo 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 3d ago

READMEChangelog (5)Dependencies (4)Versions (10)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 `8.3` 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

54

—

FairBetter than 96% of packages

Maintenance83

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 90.3% 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 ~343 days

Recently: every ~419 days

Total

6

Last Release

88d ago

Major Versions

v1.2.0 → 2.0.02026-04-08

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

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

1.x-devPHP ^7.4|^8.0|^8.1|^8.2

2.0.0PHP ^8.3|^8.4|^8.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4394344?v=4)[Turan Karatuğ](/maintainers/tkaratug)[@tkaratug](https://github.com/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 (28 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

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M993](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k39](/packages/neuron-core-neuron-ai)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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