Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.6.17 Update released for Drupal core (10.6.17)! Release: Drupal 11.3.17 Update released for Drupal core (11.3.17)! Release: Drupal 11.4.7 Update released for Drupal core (11.4.7)! Release: Radix 6.0.9 Minor update available for theme radix (6.0.9). Release: Configuration Inspector 2.1.12 Minor update available for module config_inspector (2.1.12). Release: AI (Artificial Intelligence) 1.5.0-rc4 New release candidate for module ai (1.5.0-rc4). Release: Native Observability 2.0.0 Major update available for module native_observability (2.0.0). Release: Seeds Widgets 2.5.4 Minor update available for module seeds_widgets (2.5.4). Usage Milestone: Schemata Module schemata crossed 1,000 active installs. Module Revived: Config Suite 2.0.6 Module config_suite updated after 14 months of inactivity (2.0.6).

TC VKN Field

No security coverage
View on drupal.org

Provides a field type for the Turkish tax identification number (Vergi Kimlik Numarası, VKN) and validates the 10-digit number with its check digit algorithm, so mistyped numbers are rejected on save.

In Türkiye, every company and legal entity is identified by a 10-digit VKN. The last digit is a check digit calculated from the first nine. This module adds a dedicated field type that knows this rule, so site builders do not have to write custom validation code or regular expressions.

Features

  • A "TC VKN" field type that can be added to any fieldable entity: content types, users, taxonomy terms, media and custom entities.
  • Validation of length (exactly 10 digits) and of the check digit.
  • Validation is implemented as a constraint on the field, so it applies everywhere an entity is validated: entity forms, JSON:API, REST and imports that run entity validation.
  • The value is stored as a string, so numbers with leading zeros are preserved.
  • A validator service for checking a VKN anywhere in custom code.
  • Validation runs entirely offline. No request is sent to any external service.

Typical use cases: company or supplier records, invoicing data, membership and application forms, and any content type that must hold the tax number of a Turkish legal entity.

Please note that the module checks whether a number is well formed. It does not check whether the number belongs to a registered taxpayer. That can only be confirmed through the services of the Turkish Revenue Administration (GİB).

Post-Installation

There is no configuration page. After enabling the module:

  1. Go to Structure > Content types > (your type) > Manage fields, or the "Manage fields" tab of any other entity type.
  2. Click "Add field" and pick the "TC VKN" field type.
  3. Save. The field now rejects any value that is not a valid VKN.

To validate a number in custom code:

if (\Drupal::service('tcvkn_field.validator')->validate($vkn)) {
  // Valid.
}

Additional Requirements

Drupal 11. Nothing beyond Drupal core is required.

T.C. Kimlik Kontrol (tckk_field) provides the equivalent field for the 11-digit Turkish identification number of natural persons. The two modules complement each other on sites that store records of both persons and companies.

Similar projects

  • T.C. Kimlik Kontrol validates the T.C. Kimlik No, which uses a different length and a different algorithm. It does not handle the VKN.
  • Field Validation can restrict a text field to 10 digits with a regular expression, but a regular expression cannot verify the check digit.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Sep 2026
Latest release
7 hours ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.x-dev Dev 11 Sep 17, 2026