---
title: "Calculate Italian tax code (codice fiscale)"
method: POST
path: "/api/auth/calculate-tax-code"
tags: ["auth"]
---

# Calculate Italian tax code (codice fiscale)

`POST /api/auth/calculate-tax-code`

Calculate the Italian tax code from anagraphic fields. Returns null when calculation is not possible (e.g. foreign birthplace).

## Request body

- CalculateTaxCodeRequest — Request payload for Italian tax code calculation.
  - `first_name` string, required — User first name
  - `last_name` string, required — User last name
  - `gender` string, required — User gender (M/F)
  - `date_of_birth` string, date, required — User date of birth (YYYY-MM-DD)
  - `place_of_birth` string, required — User place of birth

## Response `200`

Successful Response

- CalculateTaxCodeResponse — Response for Italian tax code calculation.
  - `tax_code` string, nullable — Calculated tax code (null if calculation failed)
  - `reason` string, nullable — Reason for failure when tax_code is null

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/corabea/apis/corabea-api.md) · [All operations](https://skmtc.dev/corabea/apis/corabea-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/corabea/corabea-api/revisions/d6ed0fec5d4f/schema)
