# Qualification profiles and features

## Overview

A qualification request names a **profile** and can add **features**. The profile decides which registers are
queried; the features decide what the response contains. Both are the same whether you call the endpoint directly,
set them in a Tax Guard qualification configuration for a monitor, or choose them in the qualification settings in
Cloud Apps.

## Qualification profiles

The `/businesspartners/qualify` endpoint provides the following profiles:

### EU_TAX_QUALIFICATION

`EU_TAX_QUALIFICATION` profile uses `VIES` as a default data source for all European Union countries. However, to fully
qualify **German business partners**, `AT.FON` is the only possible option. Take into account that this requires
activation of `AT.FON` as well as its credentials.

`VIES` doesn't provide appropriate values for name, thoroughfare, postcode, and city for a **German business partner**.

In the `EU_TAX_QUALIFICATION` profile, a user can indicate the usage of specific data sources, such as `AT.FON`, `BZST`,
or `VIES`, by providing the exact value in the `dataSources` option.

If a user requests another [data source](/documentation/_public/product-manuals/tax-guard/reference/qualification-data-sources), then only the requested data source is used as a reference.

To use `BZST` instead of `VIES` the user needs to provide the following option:

```json
{
  "dataSources": ["BZST"]
}
```

In this case, `BZST` replaces `VIES` when qualifying identifier, name, thoroughfare, postcode, and city.

To use `VIES` and `BZST` together, the user has to simply indicate all data sources:

```json
{
  "dataSources": ["VIES", "BZST"]
}
```

The results are separated by data source, and so are the qualification decisions.

In this profile, the following options are available:

* `dataSources` allows for the following values to be used: `VIES`, `BZST`, or `AT.FON`. For example, a user can combine
different data sources:
  * `"dataSources": "VIES"` - has the same effect as the default setting in the `EU_TAX_QUALIFICATION` profile but without usage of `AT.FON`,
  * `"dataSources": "BZST"` - provides qualification decisions come only from `BZST`,
  * `"dataSources": "VIES", "BZST"` - provides qualification decisions from `VIES` and `BZST` with results separated by each data source,
  * `"dataSources": "VIES", "BZST", "AT.FON"` - provides qualification decisions from `VIES`, `BZST`, and `AT.FON` data sources with results separated by each data source,
* features as described in [Qualification features](#qualification-features), which are common for both `EU_TAX_QUALIFICATION` and `WORLDWIDE_TAX_QUALIFICATION` profiles.


### WORLDWIDE_TAX_QUALIFICATION

`WORLDWIDE_TAX_QUALIFICATION` profile uses `VIES` in the same way as in the `EU_TAX_QUALIFICATION` profile but,
additionally, uses other data sources for countries outside European Union. However, in some cases, additional
credentials are needed. To provide them, configure access to available data sources in a workspace's global settings.

The following options are available:

* provide `"dataSources": ["VIES", "BZST", "AT.FON"]` as data sources, which equals the `EU_TAX_QUALIFICATION` profile
with the same data sources turned on.
* provide any of the [qualification data sources](/documentation/_public/product-manuals/tax-guard/reference/qualification-data-sources).


The default option, when the `dataSources` field isn't provided, indicates the use of 17 data sources. `BZST` is excluded
because `AT.FON` is designated for German business partners, while `VIES` is applied for other European Union business partners.

## Qualification features

For both qualification profiles, the following features can be set when invoking a request using the `/qualify`
endpoint:

* `"featuresOn": ["FORCE_EXTERNAL_CALL"]` - requires a direct call to a reference data source whenever possible.
This can be used to get the confirmation of a request from the `VIES` data source or any other data source that confirms
a request.
* `"featuresOn": ["SHOW_LOOKUP_RESULTS"]` - displays lookup results and identifies the business partner considered
during qualification. Business partner data is provided for each queried data source. Thus, it might result in more than
one business partner.
* `"featuresOn": ["SHOW_BUSINESS_PARTNER"]` - provides the business partner record sent for qualification.
It's the same record as provided in the request. It can be used for the user's convenience to have a request and response
in one resulting structure.
* `"featuresOn": ["SHOW_DEBUG_INFO"]` - provides additional information about the qualification process (number
of applied rules, external services response, etc.).


All the features can be set together in the following way:

```json
{
  "featuresOn": [
    "FORCE_EXTERNAL_CALL",
    "SHOW_LOOKUP_RESULTS",
    "SHOW_BUSINESS_PARTNER",
    "SHOW_DEBUG_INFO"
  ]
}
```

A user can combine the necessary features based on their business needs, allowing for any combination of the specified
features. Additionally, the feature `SHOW_DEBUG_INFO` is always enabled. If a user wishes to turn off this feature, their
request must include the following parameter: `"featuresOff": ["SHOW_DEBUG_INFO"]`. All other features are turned off
by default.

## Calling the qualification endpoint

Tax Guard is available under the `/businesspartners/qualify` endpoint of the Data Validation API.

API Documentation
Check the [`/businesspartners/qualify` endpoint](https://developer.cdq.com/reference-docs/data-validation/V3/tag/Business-Partners/#tag/Business-Partners/paths/~1v3~1businesspartners~1qualify/post) documentation,
and [Authenticate with an API key](/documentation/_public/instructions/authentication) to create the key you send with it.

To run a qualification, provide:

* a qualification profile,
* a business partner.


Example request:

```curl
curl -i -X POST \
  https://api.cdq.com/data-validation/rest/v3/businesspartners/qualify \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "profile": "EU_TAX_QUALIFICATION",
    "businessPartner": {
        "names": [
        {
                "value": "SAS DB COMPANY"
            }
        ],
        "identifiers": [
        {
                "value": "FR35852293547",
                "type": {
                    "technicalKey": "EU_VAT_ID_FR"
                }
            }
        ],
        "addresses": [
            {
                "country": {
                    "shortName": "FR"
                },
                "localities": [
                    {
                        "value": "Roubaix"
                    }
                ],
                "postCodes": [
                    {
                        "value": "59100"
                    }
                ],
                "thoroughfares": [
                    {
                        "value": "Rue De Tourcoing"
                    }
                ]
            }
        ]
    }
  }'
```

More requests, with their complete responses, are collected in [Qualification examples](/documentation/_public/product-manuals/tax-guard/reference/qualification-examples).

## Related Resources

- [How qualification works](/documentation/_public/product-manuals/tax-guard/concepts/how-qualification-works)
- [Qualification data sources](/documentation/_public/product-manuals/tax-guard/reference/qualification-data-sources)
- [Qualification results and decisions](/documentation/_public/product-manuals/tax-guard/reference/qualification-results-and-decisions)
- [Data Validation API](/documentation/api/data-validation/quickstart)


## Your opinion matters!

We are constantly working on providing an outstanding user experience with our products. Please share your opinion about this tutorial!