# Validate company data

`POST https://api.foxentry.com/company/validate`

This endpoint requires at least 1 query parameter and will check if the parameters and their combinations are valid. Returns information about the company based on the datascope set in the options. Foxentry validator is able not only to evaluate the validity of the inputed information but it also can fix various typos, errors and missing data. Foxentry can also suggest more suitable alternatives to the data sent in query. Please pay attention to the result, resultCorrected and suggestions in the response. Always check result.proposal in the response for a proposed solution by Foxentry how you should process the response in your form or application.

## Headers

| Header | Value |
|---|---|
| `Api-Version` | `2.1` or `2.0` |
| `Authorization` | `Bearer <your API key>` |
| `Content-Type` | `application/json` |

## Request body

### request.query

Parameters you want to validate or search for.

| Field | Type | Description |
|---|---|---|
| `name` | string | Company name |
| `country` | string | Country codes in format ISO-3166-1 alpha-2 |
| `registrationNumber` | string | Company registration number (ID) |
| `taxNumber` | string | Company national TAX number. Currently available only for SK subjects. |
| `vatNumber` | string | Company VAT number |

### request.options

Options that change how the endpoint behaves.

| Field | Type | Description |
|---|---|---|
| `resultsLimit` | integer | Limits number of results returned by the endpoint. Default: `10`. |
| `dataScope` | string | Data scope of returned data. One of: `basic`, `extended`, `full`. Default: `"basic"`. |
| `dataSource` | array[string] | Array of allowed data sources, which restricts countries the module searches. Although we use the request.client object to provide most relevant results, it is generally recommended to to limit this option to only the necessary sources - especially if you don't utilize the request.client object. Default: `["CZ", "SK", "PL"]`. |
| `includeTerminatedSubjects` | boolean | Whether or not to include entities that have already ended their existence in the output. Default: `false`. |
| `zipFormat` | boolean | Whether to return locally formatted ZIP code or not. (130 00 vs 13000). Default: `false`. |
| `cityFormat` | string | This option determines the format in which the city is returned. Minimal = Praha, basic = Praha 8, extended = Praha 8 - Karlín. One of: `minimal`, `basic`, `extended`. Default: `"basic"`. |
| `countryFormat` | string | This option determines the format in which the country is returned. Supported formats: alpha2 = CZ, alpha3 = CZE, local = Česká republika, international = Czech republic, localShortened = Česko, internationalShortened = Czechia. One of: `alpha2`, `alpha3`, `local`, `localShortened`, `international`, `internationalShortened`. Default: `"alpha2"`. |
| `legalFormType` | string or null | This option filters results by the legal form type. One of: `juridical`, `physical`, `any`. Default: `"any"`. |
| `filterMode` | string | Prefer = prefer results matching the filter parameters, limit = limit to results matching the filter parameters. One of: `limit`, `prefer`. Default: `"limit"`. |
| `correctionMode` | string | This option determines how automatic corrections are handled. You can choose between full to allow all corrections, format to fix formatting only, suggestion to return corrected data in suggestions, or none for no corrections to be applied. Quality of data differs between countries, therefore it might be desirable to limit the correction mode in some cases. One of: `full`, `format`, `suggestion`, `none`. Default: `"full"`. |
| `correctionModeCrossCountry` | string | This option determines how automatic corrections are handled when a result from another country matches your query. You can choose between full to allow all corrections, format to fix formatting only, suggestion to return corrected data in suggestions, or none for no corrections to be applied. Quality of data differs between countries, therefore it might be desirable to limit the correction mode in some cases. One of: `full`, `format`, `suggestion`, `none`. Default: `"format"`. |

### request.client

Information about your user, to make results more relevant.

| Field | Type | Description |
|---|---|---|
| `ip` | string |  |
| `country` | string | Country code in ISO-3166-1 alpha-2 format. |
| `location.lat` | number | Client's latitude |
| `location.lon` | number | Client's longitude |

### Example

```json
{
  "request": {
    "query": {
      "name": "AVANTRO",
      "country": "CZ",
      "registrationNumber": "04997476"
    },
    "options": {
      "dataScope": "basic",
      "resultsLimit": 10,
      "includeTerminatedSubjects": false,
      "cityFormat": "basic",
      "zipFormat": false
    },
    "client": {
      "country": "CZ",
      "location": {
        "lat": 50.0628,
        "lon": 13.9271
      }
    }
  }
}
```

## Responses

- `200` Successful response. Examples: `valid`, `invalid`, `invalidWithSuggestion`, `invalidWithCorrection`
- `400` Bad Request
- `401` Unauthorized
- `402` Payment Required
- `403` Forbidden
- `404` Not Found
- `405` Method Not Allowed
- `429` Too Many Requests
- `500` Internal Server Error
- `503` Service Unavailable
