# Tax Code Verification > Compare a tax code against a person's identifying data, including name, gender, date of birth, and birthplace. ## Endpoint `POST https://api.egon.com/v4/validation/tax_code` Egon ecommerce API ## Headers | Field | Type | Required | Description | | --- | --- | --- | --- | | `Authorization` | String | Yes | Bearer token authentication | ## Request Country context, `taxfnx` function `1`, personal identity data, and tax code to compare. | Field | Type | Required | Description | | --- | --- | --- | --- | | `par` | Object | Yes | Country context and tax-code match function. | | `par.iso2` | String | No | Country code, ISO 3166-1 alpha-2. One of `iso2` or `iso3` is **required**. | | `par.iso3` | String | No | Country code, ISO 3166-1 alpha-3. One of `iso2` or `iso3` is **required**. | | `par.taxfnx` | String | Yes | Tax-code configuration function. `1` Compare and match tax code against personal identity data. Default value: `1` | | `data` | Object | Yes | Input data to validate | | `data.name` | Object | Yes | Personal identity data to compare against tax code | | `data.name.full_name` | String | Yes | Surname | | `data.name.first_name` | String | Yes | First name | | `data.name.gender` | String | Yes | Gender (`1` Male, `2` Female) | | `data.name.birth_date` | String | Yes | Date of birth in `YYYYMMDD` format | | `data.name.birth_place` | String | Yes | Birth city description | | `data.tax_code` | Object | Yes | Italian tax code to match | | `data.tax_code.cod_iso3` | String | No | Country code (ISO 3166-1 alpha-3) | | `data.tax_code.cod_type` | String | No | Code type | | `data.tax_code.cod_description` | String | Yes | Italian tax code to match | ### Example request ```bash curl -X POST "https://api.egon.com/v4/validation/tax_code" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"par":{"iso3":"ITA","taxfnx":"1"},"data":{"name":{"full_name":"Rossi","first_name":"Mario","gender":"1","birth_date":"19930219","birth_place":"Verona"},"tax_code":{"cod_iso3":"ITA","cod_type":"01110","cod_description":"RSSMRA93B19L781K"}}}' ``` ## Response Normalized personal data, tax code, comparison quality results for identity, birth date, birthplace, and system status. | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | Object | No | Normalized and enriched validation output data | | `data.name` | Object | No | Validated identity data and matching outcome | | `data.name.type_ana` | String | No | Person/customer type | | `data.name.gender` | String | No | Normalized gender | | `data.name.full_name` | String | No | Normalized full name | | `data.name.last_name` | String | No | Normalized surname | | `data.name.first_name` | String | No | Normalized first name | | `data.name.birth_date` | String | No | Date of birth in `YYYYMMDD` format | | `data.name.birth_province` | String | No | Birth province code | | `data.name.birth_place` | String | No | Normalized birthplace | | `data.tax_code` | Object | No | Matched tax code details | | `data.tax_code.cod_description` | String | No | Italian tax code result | | `quality` | Object | No | Validation quality indicators and score flags | | `quality.tax_code` | Object | No | Quality indicator result (see https://docs.egon.com/docs/quality-indicators) | | `quality.tax_code.flag` | String | No | Quality flag | | `quality.tax_code.code` | Number | No | Quality result code | | `quality.tax_code.description` | String | No | Quality result description | | `quality.name` | Object | No | Quality indicators for personal name parsing and demographic verification | | `quality.name.person` | Object | No | Quality indicator result (see https://docs.egon.com/docs/quality-indicators) | | `quality.name.person.flag` | String | No | Quality flag | | `quality.name.person.code` | Number | No | Quality result code | | `quality.name.person.description` | String | No | Quality result description | | `quality.name.birth_date` | Object | No | Quality indicator result (see https://docs.egon.com/docs/quality-indicators) | | `quality.name.birth_date.flag` | String | No | Quality flag | | `quality.name.birth_date.code` | Number | No | Quality result code | | `quality.name.birth_date.description` | String | No | Quality result description | | `quality.name.birth_place` | Object | No | Quality indicator result (see https://docs.egon.com/docs/quality-indicators) | | `quality.name.birth_place.flag` | String | No | Quality flag | | `quality.name.birth_place.code` | Number | No | Quality result code | | `quality.name.birth_place.description` | String | No | Quality result description | | `system` | Object | No | Request processing status. | | `system.ret_code` | Number | No | Processing result code. 0 means no blocking error. | | `system.des_ret_code` | String | No | Human-readable processing result. | ### Example responses **HTTP 200: Valid response** Tax code matches personal information completely. ```json { "data": { "name": { "type_ana": "1", "gender": "1", "full_name": "ROSSI,MARIO", "last_name": "ROSSI", "first_name": "MARIO", "birth_date": "19930219", "birth_province": "VR", "birth_place": "VERONA" }, "tax_code": { "cod_description": "RSSMRA93B19L781K" } }, "quality": { "tax_code": { "flag": "0", "code": 0, "description": "Ok" }, "name": { "person": { "flag": "0", "code": 0, "description": "Ok" }, "birth_date": { "flag": "0", "code": 0, "description": "Ok" }, "birth_place": { "flag": "0", "code": 0, "description": "Ok" } } }, "system": { "ret_code": 0, "des_ret_code": "Ok" } } ``` **HTTP 400: Invalid token** The provided token is not valid or expired. ```json { "error": { "code": 400, "message": "Unauthenticated." } } ``` **HTTP 401: Missing token** Provide the required authentication token in the Authorization request header. ```json { "error": { "code": 401, "message": "You did not provide an API key. You need to provide your API key in the Authorization header, using Bearer auth (e.g. 'Authorization: Bearer {token}'). See [Egon Api documentation](https://docs.egon.com) for details." } } ``` **HTTP 422: Missing data** The request is missing the required data object. ```json { "error": { "code": 422, "message": "The data field is required. (and 1 more error)", "details": { "data": [ "The data field is required." ], "data.query": [ "The data.query field is required." ] } } } ``` **HTTP 422: Missing par** The request is missing the required par object or country code. ```json { "error": { "code": 422, "message": "The par.iso3 field is required when par.iso2 is not present. (and 1 more error)", "details": { "par.iso3": [ "The par.iso3 field is required when par.iso2 is not present." ], "par.iso2": [ "The par.iso2 field is required when par.iso3 is not present." ] } } } ``` **HTTP 422: Invalid iso2 or iso3** The specified ISO 3166-1 alpha-2 or alpha-3 country code is not enabled. ```json { "error": { "code": 422, "message": "Country not enabled.", "details": { "par.iso3": [ "Country not enabled." ] } } } ```