# Qualify a business partner by its identifiers

## Overview

**Use case**

This guide focuses on qualifying EU VAT identifiers only. It might be helpful to check if a given EU VAT number, associated
with a business partner, is permitted for cross-border transactions within the European Union. In this case, using `VIES`
as a reference data source is the best approach.

For more details check the endpoint's [documentation](https://developer.cdq.com/reference-docs/data-validation/V3/tag/Qualification/#tag/Qualification/paths/~1v3~1businesspartners~1qualify/post).

**Learning goals**

In this guide, you focus on:

- Qualifying a Business Partner using identifiers,
- Understanding the qualification results,
- Analyzing the qualification results.


## Before you start

### Authorization

Before trying CDQ APIs, user must be authenticated:

1. Paste the API Key in the console's security bar into the `X-API-KEY` field.


![](/assets/auth7.0d4fb05fa55bc16d828c76e9976f979930ffadb949cfc149a6617cc6518ab57d.6fde6558.png)

1. After pasting the API Key, the green padlock will appear.


![](/assets/auth8.28e02515b78db57ec32c07fd6bd7d296484e64f65ef6a3bc5296520cb1da8d65.6fde6558.png)

Be careful
Green padlock doesn't mean that the API Key was pasted correctly.

1. Check your API key for missing characters or extra space before trying.


#### No API Key?

1. Check how to get one on [authentication page](/documentation/_public/instructions/authentication).
2. Follow the steps above.


New to qualification? Read [How qualification works](/documentation/_public/product-manuals/tax-guard/concepts/how-qualification-works) first.

## Steps

### 1. Send the qualification request

Qualify a business partner by its identifiers. Select one of the following examples:

| Example name | Description |
|  --- | --- |
| Qualification of a French Business Partner's Identifier Only | This example involves qualifying the EU VAT identifier of a French business partner. To qualify an identifier, only the type of the given identifier and the identifier itself need to be provided. |
| Qualification of a German Business Partner's Identifier Only Using `AT.FON` | This example focuses on qualifying the EU VAT identifier of a German business partner. By default, `AT.FON` is applied because this is the only reference data source that can fully qualify German business partners. |
| Qualification of a German Business Partner's Identifier Only Using `VIES` | This example qualifies the EU VAT identifier of a German business partner using `VIES` as a reference data source. Fortunately, `VIES` can qualify EU VAT identifiers of German business partners, but only this attribute. No other attribute, such as post code or name, can be qualified using `VIES`. |


To qualify a business partner by its identifiers:

1. Use the **Qualify Business Partner** endpoint to send the below request,
2. Select one of the below examples,


1. Send the request.


How to read the response is described in [Check the result](#check-the-result).

## Check the result

Each entry in `qualificationResults` holds the decisions from one data source for one identifier. What every field and decision means is described in [Qualification results and decisions](/documentation/_public/product-manuals/tax-guard/reference/qualification-results-and-decisions).

Find the example you sent below and expand its response.

### Qualification of a French Business Partner's Identifier Only

The response clearly indicates that the identifier qualification decision is `VALID`, confirming that the `EU_VAT_ID_FR`
is correct. Other decisions reflect `NO_INPUT_PROVIDED`, indicating that no additional business partner attributes were
supplied in the request. Furthermore, within the `qualificationDecisionDetails` structure, it can be seen that only one
rule was executed, with its execution context properties presented as name and value pairs. Additionally, the set of properties
includes a confirmation from `VIES`, indicating that the request was processed and the decision was `VALID`. This information
can be found under the `dataSourceRequestIdentifier` execution context property, which in this scenario is `WAPIAAAAZGy74Ftg`.
It's important to note that this request identifier will only appear when `FORCE_EXTERNAL_CALL` is set, ensuring that the
external reference data source is accessed during qualification. If a failure occurs, local CDQ storage will be used if possible,
and in such cases, the request identifier from `VIES` won't be included in the response.

The overall decision is determined using a hierarchy that ranks as follows:

> `NOT_PROCESSED` < `NO_INPUT_PROVIDED` < `VALID` < `NO_REFERENCE_AVAILABLE` < `INVALID` < `EXECUTION_ERROR`


It represents the highest decision from previous decisions concerning identifier, name, locality, postcode, and thoroughfare.
Therefore, the overall qualification decision in this example is `VALID`.

Expand the response
```json
{
	"qualificationResults": [
		{
			"identifier": {
				"value": "FR35852293547",
				"type": {
					"technicalKey": "EU_VAT_ID_FR"
				}
			},
			"businessPartnerStatus": {
				"type": {
					"name": "Unknown",
					"url": "https://meta.cdq.com/Business_partner/status/type/technical_key/unknown",
					"technicalKey": "UNKNOWN"
				}
			}, 
			"qualifiedAt": "2024-09-02T13:32:06.676504619",
			"dataSourceTechnicalKey": "VIES",
			"dataSourceRequestIdentifiers": [
				{
					"dataSourceTechnicalKey": "VIES",
					"value": "WAPIAAAAZGy74Ftg"
				}
			],
			"qualificationDecisionSummary": {
				"identifierQualificationDecision": "VALID",
				"nameQualificationDecision": "NO_INPUT_PROVIDED",
				"addressQualificationDecision": "NO_INPUT_PROVIDED",
				"addressQualificationDecisionDetails": {
					"localityQualificationDecision": "NO_INPUT_PROVIDED",
					"postCodeQualificationDecision": "NO_INPUT_PROVIDED",
					"thoroughfareQualificationDecision": "NO_INPUT_PROVIDED"
				},
				"overallQualificationDecision": "VALID"
			},
			"qualificationDecisionDetails": [
				{
					"businessRule": {
						"name": "Identifier Qualification (European value added tax identifier (France), Data source:VIES)",
						"url": "https://meta.cdq.com/Identifier_Qualification_(European_value_added_tax_identifier_(France),_Data_source:VIES)",
						"ruleStatus": "RELEASED",
						"violationMessage": "Identifier deviates from the reference identifier registered with the European value added tax identifier (France)"
					},
					"executionContextProperties": [
						{
							"name": "qualificationTarget",
							"value": "IDENTIFIER"
						},
						{
							"name": "targetInputValue",
							"value": "FR35852293547"
						},
						{
							"name": "targetReferenceValue",
							"value": "FR35852293547"
						},
						{
							"name": "dataSourceTechnicalKey",
							"value": "VIES"
						},
						{
							"name": "dataSourceRequestIdentifier",
							"value": "WAPIAAAAZGy74Ftg"
						}
					],
					"cdqId": "VIES:FR35852293547",
					"decision": "VALID"
				}
			]
		}
	],
	"lookupResults": [],
	"debugInfo": {
		"externalServiceResponses": [
			{
				"status": 200,
				"timestamp": "2024-09-02T13:32:06.617922052Z",
				"additionalInformation": [
					{
						"key": "requestorId",
						"value": "DE307699628"
					},
					{
						"key": "requestId",
						"value": "WAPIAAAAZGy74Ftg"
					},
					{
						"key": "rawJson",
						"value": "[{\"vatValue\":{\"value\":\"35852293547\"},\"requestDate\":{\"value\":\"2024-09-01T22:00:00.000+00:00\"},\"countryCode\":{\"value\":\"FR\"},\"valid\":{\"value\":true},\"traderAddress\":{\"value\":\"89 RUE DE TOURCOING\\n59100 ROUBAIX\"},\"traderName\":{\"value\":\"SAS DB COMPANY\"},\"traderCompanyType\":{\"value\":\"---\"},\"traderStreet\":{},\"traderPostcode\":{},\"traderCity\":{},\"traderNameMatch\":{},\"traderCompanyTypeMatch\":{},\"traderStreetMatch\":{},\"traderPostcodeMatch\":{},\"traderCityMatch\":{},\"requestIdentifier\":{\"value\":\"WAPIAAAAZGy74Ftg\"},\"referenceAddressDto\":{\"version\":{\"characterSet\":{\"name\":\"International\",\"technicalKey\":\"INTERNATIONAL\"},\"language\":{\"name\":\"en\",\"technicalKey\":\"en\"}},\"metadata\":{},\"country\":{\"shortName\":\"FR\",\"value\":\"France\"},\"postCodes\":[{\"value\":\"59100\"}],\"localities\":[{\"type\":{\"name\":\"City\",\"url\":\"https://meta.cdq.com/Address/locality/type/city\",\"technicalKey\":\"CITY\"},\"shortName\":\"Roubaix\",\"value\":\"Roubaix\"}],\"thoroughfares\":[{\"type\":{\"name\":\"Street\",\"url\":\"https://meta.cdq.com/Address/thoroughfare/type/street\",\"technicalKey\":\"STREET\"},\"shortName\":\"Rue De Tourcoing\",\"number\":\"89\",\"value\":\"Rue De Tourcoing\",\"name\":\"RUE DE TOURCOING\"}]},\"requesterVatNumber\":\"307699628\",\"requesterCountryCode\":\"DE\",\"refreshReason\":\"FORCED_BY_CUSTOMER\"}]"
					}
				]
			}
		],
		"businessRulesExecutionSummary": {
			"numberOfRules": 1,
			"numberOfExecutions": 1,
			"numberOfFails": 0,
			"failures": [],
			"dataSourcesOn": [
				{
					"prefix": "VIES"
				},
				{
					"prefix": "AT.FON"
				}
			],
			"ruleCategoriesOn": [
				{
					"url": "https://meta.cdq.com/EU_TAX_Qualification"
				}
			]
		}
	}
}
```

### Qualification of a German Business Partner's Identifier Only Using AT.FON

The returned response indicates that the identifier qualification decision is `VALID`. Since no additional attributes were
introduced, all other decision attributes, except `overallQualificationDecision`, are set to `NO_INPUT_PROVIDED`. As `AT.FON`
is being used in this instance, no confirmation in the form of a request identifier is included. `AT.FON` is a paid service,
and when the goal is to qualify only the identifiers of German business partners, it's advisable to use the method presented
in the following example.

Expand the response
```json
{
	"qualificationResults": [
		{
			"identifier": {
				"value": "DE307699628",
				"type": {
					"technicalKey": "EU_VAT_ID_DE"
				}
			},
			"businessPartnerStatus": {
				"type": {
					"name": "Unknown",
					"url": "https://meta.cdq.com/Business_partner/status/type/technical_key/unknown",
					"technicalKey": "UNKNOWN"
				}
			}, 
			"qualifiedAt": "2024-09-02T13:31:57.883025712",
			"dataSourceTechnicalKey": "AT.FON",
			"dataSourceRequestIdentifiers": [],
			"qualificationDecisionSummary": {
				"identifierQualificationDecision": "VALID",
				"nameQualificationDecision": "NO_INPUT_PROVIDED",
				"addressQualificationDecision": "NO_INPUT_PROVIDED",
				"addressQualificationDecisionDetails": {
					"localityQualificationDecision": "NO_INPUT_PROVIDED",
					"postCodeQualificationDecision": "NO_INPUT_PROVIDED",
					"thoroughfareQualificationDecision": "NO_INPUT_PROVIDED"
				},
				"overallQualificationDecision": "VALID"
			},
			"qualificationDecisionDetails": [
				{
					"businessRule": {
						"name": "Identifier Qualification (European value added tax identifier (Germany), Data source:AT.FON)",
						"url": "https://meta.cdq.com/Identifier_Qualification_(European_value_added_tax_identifier_(Germany),_Data_source:AT.FON)",
						"ruleStatus": "RELEASED",
						"violationMessage": "Identifier deviates from the reference identifier registered with the European value added tax identifier (Germany)"
					},
					"executionContextProperties": [
						{
							"name": "qualificationTarget",
							"value": "IDENTIFIER"
						},
						{
							"name": "targetInputValue",
							"value": "DE307699628"
						},
						{
							"name": "targetReferenceValue",
							"value": "DE307699628"
						},
						{
							"name": "dataSourceTechnicalKey",
							"value": "AT.FON"
						}
					],
					"cdqId": "AT.FON:DE307699628",
					"decision": "VALID"
				}
			]
		}
	],
	"lookupResults": [],
	"debugInfo": {
		"externalServiceResponses": [
			{
				"status": 200,
				"timestamp": "2024-09-02T13:31:57.831654278Z",
				"additionalInformation": [
					{
						"key": "rawJson",
						"value": "[{\"rc\":0,\"name\":\"CDQ GmbH   \",\"adrz1\":\"Albrechtstr. 8\",\"adrz3\":\"88045\",\"adrz4\":\"Friedrichshafen\",\"uid\":\"DE307699628\",\"countryCode\":\"DE\",\"address\":{\"country\":{\"value\":\"Germany\",\"shortName\":\"DE\"},\"localities\":[{\"value\":\"Friedrichshafen\",\"shortName\":\"Friedrichshafen\",\"type\":{\"name\":\"City\",\"url\":\"https://meta.cdq.com/Address/locality/type/city\",\"technicalKey\":\"CITY\"}}],\"thoroughfares\":[{\"value\":\"Albrechtstraße\",\"number\":\"8\",\"shortName\":\"Albrechtstr.\",\"type\":{\"name\":\"Street\",\"url\":\"https://meta.cdq.com/Address/thoroughfare/type/street\",\"technicalKey\":\"STREET\"}}],\"postCodes\":[{\"value\":\"88045\"}],\"version\":{\"characterSet\":{\"name\":\"International\",\"technicalKey\":\"INTERNATIONAL\"},\"language\":{\"name\":\"en\",\"technicalKey\":\"en\"}}}}]"
					}
				]
			}
		],
		"businessRulesExecutionSummary": {
			"numberOfRules": 1,
			"numberOfExecutions": 1,
			"numberOfFails": 0,
			"failures": [],
			"dataSourcesOn": [
				{
					"prefix": "VIES"
				},
				{
					"prefix": "AT.FON"
				}
			],
			"ruleCategoriesOn": [
				{
					"url": "https://meta.cdq.com/EU_TAX_Qualification"
				}
			]
		}
	}
}
```

### Qualification of a German Business Partner's Identifier Only Using VIES

By adding the parameter `"dataSources": ["VIES"]` to a request, the qualification service is directed to use `VIES` as the
reference data source. As a result, the decision for identifier qualification remains consistent with the previous example:
`VALID`. However, other decisions result in `NOT_PROCESSED`, regardless of the absence of input in this case. This approach
is intentional to indicate that even if other attributes are provided, qualification isn't possible due to a lack of proper
qualification rules. Therefore, the `NOT_PROCESSED` decision is consistently returned in this scenario. Additionally, it's
important to note that even if business partner attributes were included and appropriate rules existed, qualification would
still be unattainable, as `VIES` is unable to process German business partner attributes, except EU VAT identifiers.

Expand the response
```json
{
	"qualificationResults": [
		{
			"identifier": {
				"value": "DE307699628",
				"type": {
					"technicalKey": "EU_VAT_ID_DE"
				}
			},
			"businessPartnerStatus": {
				"type": {
					"name": "Unknown",
					"url": "https://meta.cdq.com/Business_partner/status/type/technical_key/unknown",
					"technicalKey": "UNKNOWN"
				}
			}, 
			"qualifiedAt": "2024-09-03T11:12:03.204540242",
			"dataSourceTechnicalKey": "VIES",
			"dataSourceRequestIdentifiers": [
				{
					"dataSourceTechnicalKey": "VIES",
					"value": "WAPIAAAAZG3laL3W"
				}
			],
			"qualificationDecisionSummary": {
				"identifierQualificationDecision": "VALID",
				"nameQualificationDecision": "NOT_PROCESSED",
				"addressQualificationDecision": "NOT_PROCESSED",
				"addressQualificationDecisionDetails": {
					"localityQualificationDecision": "NOT_PROCESSED",
					"postCodeQualificationDecision": "NOT_PROCESSED",
					"thoroughfareQualificationDecision": "NOT_PROCESSED"
				},
				"overallQualificationDecision": "VALID"
			},
			"qualificationDecisionDetails": [
				{
					"businessRule": {
						"name": "Identifier Qualification (European value added tax identifier (Germany), Data source:VIES)",
						"url": "https://meta.cdq.com/Identifier_Qualification_(European_value_added_tax_identifier_(Germany),_Data_source:VIES)",
						"ruleStatus": "RELEASED",
						"violationMessage": "Identifier deviates from the reference identifier registered with the European value added tax identifier (Germany)"
					},
					"executionContextProperties": [
						{
							"name": "qualificationTarget",
							"value": "IDENTIFIER"
						},
						{
							"name": "targetInputValue",
							"value": "DE307699628"
						},
						{
							"name": "targetReferenceValue",
							"value": "DE307699628"
						},
						{
							"name": "dataSourceTechnicalKey",
							"value": "VIES"
						},
						{
							"name": "dataSourceRequestIdentifier",
							"value": "WAPIAAAAZG3laL3W"
						}
					],
					"cdqId": "VIES:DE307699628",
					"decision": "VALID"
				}
			]
		}
	],
	"lookupResults": [],
	"debugInfo": {
		"externalServiceResponses": [
			{
				"status": 200,
				"timestamp": "2024-09-03T11:12:03.145729079Z",
				"additionalInformation": [
					{
						"key": "requestorId",
						"value": "DE307699628"
					},
					{
						"key": "requestId",
						"value": "WAPIAAAAZG3laL3W"
					},
					{
						"key": "rawJson",
						"value": "[{\"vatValue\":{\"value\":\"307699628\"},\"requestDate\":{\"value\":\"2024-09-02T22:00:00.000+00:00\"},\"countryCode\":{\"value\":\"DE\"},\"valid\":{\"value\":true},\"traderAddress\":{},\"traderName\":{},\"traderCompanyType\":{},\"traderStreet\":{},\"traderPostcode\":{},\"traderCity\":{},\"traderNameMatch\":{},\"traderCompanyTypeMatch\":{},\"traderStreetMatch\":{},\"traderPostcodeMatch\":{},\"traderCityMatch\":{},\"requestIdentifier\":{\"value\":\"WAPIAAAAZG3laL3W\"},\"requesterVatNumber\":\"307699628\",\"requesterCountryCode\":\"DE\",\"refreshReason\":\"FORCED_BY_CUSTOMER\"}]"
					}
				]
			}
		],
		"businessRulesExecutionSummary": {
			"numberOfRules": 1,
			"numberOfExecutions": 1,
			"numberOfFails": 0,
			"failures": [],
			"dataSourcesOn": [
				{
					"prefix": "VIES"
				}
			],
			"ruleCategoriesOn": [
				{
					"url": "https://meta.cdq.com/Qualification"
				},
				{
					"url": "https://meta.cdq.com/EU_TAX_Qualification"
				}
			]
		}
	}
}
```

## Next steps

- [Qualify an EU business partner](/documentation/_public/product-manuals/tax-guard/guides/qualify-eu-business-partner) to qualify the name and address as well.
- [Qualify a business partner against local registers](/documentation/_public/product-manuals/tax-guard/guides/qualify-against-local-registers) for registers outside VIES.
- [Qualification examples](/documentation/_public/product-manuals/tax-guard/reference/qualification-examples) for more requests and responses.


## Your opinion matters!

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