Tutorial: How to qualify tax and business identifier?
Overview
Use case
The purpose of the qualified check of EU VAT identifiers is to prove the consistency of the maintained address and name against the address and name with which the EU VAT is registered. This use case describes how to perform such a qualified validation of records to comply with EU tax compliance requirements (in German usually referred to as: "UID Bestätigungsverfahren"). The typical business use case is to qualify name and address data against a VAT number when doing intra-community business, i.e., delivering/selling goods across inner-European borders. A German company that sells and delivers goods to a French business partner has to perform a qualified check of the French business partner's VAT number.
attention
This use case is based on the wiki use case but presents an integration approach using CDQ APIs.
Use Case: Situation, Approach and Results |
Learning Goals
Common Process and involved APIs/Endpoints |
In this tutorial, you will learn how:
- Create storage and upload data
- Run the validation job with Data Validation API.
- Report building
- Download report
- Delete storage
Prerequisites
Authorization
Before trying CDQ APIs, user must be authenticated:
- Paste the API Key in the console's security bar into the
X-API-KEY
field.
- After pasting the API Key, the green padlock will appear.
Be careful
Green padlock doesn't mean that the API Key was pasted correctly.
- Check your API key for missing characters or extra space before trying.
No API Key?
- Check how to get one on authentication page.
- Follow the steps above.
Step 1: Data Import
Create a storage
attention
id
of
your Data Storage and go directly to the next step. StepTo upload desired files storage is needed! Before upload:
- Use the Create Storage endpoint to send the below request
- Select Create a storage example
- Replace the
dataStorageExample
and thedataSourceExample
with new names
attention
dataMapperDefinitionId
is set to default
.- Payload
- curl
{- "name": "dataStorageExample",
- "dataMatchingDefinitionId": "string",
- "dataSources": [
- {
- "dataSourceName": "dataSourceExample",
- "dataMapperDefinitionId": "default"
}
], - "featuresOn": [
- "LOOKUP"
], - "sharedWithOrganization": false,
- "labels": [
- "string"
]
}
- Check the above example in the Try It Console now:
Important information:
- Your storage is created if the
status
:CREATED_SUCCESSFULLY
is displayed in the response body. - The
id
refers to the unique identifier of a newly created storage (for exampleid
:3a10645d8be23f53a20b30bfa936e63d
). - The storage is empty by default.
Congratulations!
id
in the next stepUpload data via CSV/XLSX
To start the import job of a csv or xlsx file:
- Use the Start Import Job endpoint to send the below request
- Paste the existing storage
id
- Select the file to upload
attention
You can use your own file or use CDQ Sample File.
- curl
- Check the above example in the Try It Console now:
In response, you will find three important parameters:
- The value of the
id
representingYOUR_UPLOAD_JOB_ID
- the unique number of every upload job. - The
progress
:0
represents the progress of the job. - The
status
:SCHEDULED
- the job is in the job queue.
attention
YOUR_UPLOAD_JOB_ID
for polling the job status.Wait until upload is finished
To check the import job status:
- Use the Poll Import Job endpoint to send the below request
- Use the
YOUR_JOB_ID1
from the previous step and replace thejobId
- curl
- Check the above example in the Try It Console now:
- If the job is still running, the status with the progress will be displayed:
{
"id" : "YOUR_UPLOAD_JOB_ID",
"progress" : "71",
"status" : "RUNNING"
}
info
The import job runtime is dependent on the size of the imported file. Poll the status regularly to find out when the import is done.
- When the job is done the
FINISHED
status will be displayed
{
"id" : "YOUR_UPLOAD_JOB_ID",
"progress" : "100",
"status" : "FINISHED"
}
success
The data is fully imported to your storage now. The uploaded data can be processed now by a wide range of CDQ Solutions.
Step 2: Execute a qualification batch job
Start the EU VAT Qualification
To verify exported data:
- Use the Business Partner Validation Jobs endpoint
- Modify request and replace the
YOUR_STORAGE_ID
with the storageid
received from Step 1- The
EU_VAT_QUALIFICATION
is set as a profile. More profiles are described on the documentation page
- The
- Payload
- curl
{- "storageId": "YOUR_STORAGE_ID",
- "profile": "EU_VAT_QUALIFICATION",
- "featuresOn": [
- "SHOW_LOOKUP_RESULTS"
], - "featuresOff": [
- "SHOW_LOOKUP_RESULTS"
], - "ruleStatuses": [
- "RELEASED"
], - "vatAtRequestor": "AT123456789",
- "vatDeRequestor": "DE123456789",
- "bzstPrint": true,
- "validationSource": "BZST",
- "reportsRequest": {
- "reportsConfiguration": {
- "address": {
- "build": false
}, - "businesspartner": {
- "build": false
}, - "identifier": {
- "build": false
}, - "overall": {
- "build": false
}, - "qualification": {
- "build": true
}, - "qualityImprovement": {
- "build": false,
- "dataValidationJobIds": [
- "6be92567-4327-4463-813f-a8c990410d79",
- "f9df6cd4-4414-4719-9fb5-4eb6e5bc04cb"
]
}, - "countryShortNames": "['PL', 'DE', 'CZ', 'SK']"
}
}, - "dataSourcesOn": [
- {
- "prefix": "string"
}
], - "dataSourcesOff": [
- {
- "prefix": "string"
}
], - "ruleCategoriesOn": [
- {
- "url": "string",
- "name": "string"
}
], - "ignoredRules": [
- "string"
], - "activatedRules": [
- "string"
], - "updatedFrom": "2020-07-06T12:14:03.204Z",
- "dataSourceIds": [
- "string"
], - "countryShortNames": [
- "string"
], - "configurationId": "string",
- "criticalities": [
- {
- "businessRuleUrl": "string",
- "violationLevel": "NO_DEFECT"
}
]
}
- Check the above example in the Try It Console now:
In response, you will find three important parameters:
- The value of the
id
representingYOUR_VALIDATION_JOB_ID
- the unique number of every upload job. - The
progress
:0
represents the progress of the job. - The
status
:SCHEDULED
- the job is in the job queue.
attention
YOUR_VALIDATION_JOB_ID
for polling the job status and in the building report step.Wait for completion
To poll the validation job status:
- Use the Poll Validation Job endpoint to send the below request
- Use the
YOUR_VALIDATION_JOB_ID
from the previous step and paste it into the jobid
field
Cannot find specified operation in definition: data-validation-v2
- Check the above example in the Try It Console now:
Cannot find specified operation in definition: data-validation-v2
- If the job is still running, the status with the progress will be displayed:
{
"id" : "YOUR_VALIDATION_JOB_ID",
"status" : "RUNNING",
"progress" : "71"
}
info
The import job runtime is dependent on the size of the imported file. Poll the status regularly to find out when the import is done.
- When the job is done the
FINISHED
status will be displayed
{
"id": "YOUR_VALIDATION_JOB_ID",
"status": "FINISHED",
"progress": "100"
}
success
The data is now qualified!.
Step 3: Build the report
Start the report building job
To start the report building job:
- Use the Build Validation Reports endpoint
- Modify request and replace the
YOUR_VALIDATION_JOB_ID
with theid
value received from Step 2
- The reportRequest with build parameter set to
true
. The default value isfalse
.
Cannot find specified operation in definition: data-validation-v2
- Check the above example in the Try It Console now:
Cannot find specified operation in definition: data-validation-v2
In response, you will find three important parameters:
- The value of the
id
representingYOUR_RAPORT_JOB_ID
- the unique number of every upload job. - The
progress
:0
represents the progress of the job. - The
status
:SCHEDULED
- the job is in the job queue.
attention
YOUR_RAPORT_JOB_ID
for polling the job status and in the building report step.Wait for completion
To poll the report job status:
- Use the Poll Validation Reports endpoint to send the below request
- Use the
YOUR_RAPORT_JOB_ID
from the previous step and paste it into the jobid
field
Cannot find specified operation in definition: data-validation-v2
- Check the above example in the Try It Console now:
Cannot find specified operation in definition: data-validation-v2
In response, you will find two important parameters:
- The
status
:FINISHED
- the job is done - The
url
:job-files/YOUR_FILE_ID/Qualification+Report+Collection.zip
- the link to the desired report.
{
"id": "YOUR_RAPORT_JOB_ID",
"status": "FINISHED",
"attachments": [
{
"name": "Qualification+Report+Collection",
"url": "YOUR_REPORT_URL"
}
]
}
attention
YOUR_REPORT_URL
for download. Copy entire url
value.Step 4: Download result report
To download the report:
- Use the Request a file download endpoint to send the below request
- Use the
YOUR_REPORT_URL
from the previous step and paste into it theurl
value
- Payload
- curl
{- "url": "customer-upload/user/file.xlsx",
- "downloadLinkAge": "0"
}
- Check the above example in the Try It Console now:
In response, you will find download details:
{
"url": "YOUR_REPORT_URL",
"downloadLink": "YOUR_DOWNLOAD_LINK",
"downloadMethod": "GET"
}
success
The file is waiting to be downloaded. Use the provided link and the HTTP method.
Step 5. Delete storage
GOOD PRACTISES
Delete the storage after you no longer need it.
- Use the Delete Storage endpoint to send the below request
- Use the existing storage
id
no longer in use and replace thestorageId
in the request
- curl
- Check the above example in the Try It Console now:
Your opinion matters!
We are constantly working on providing an outstanding user experience with our products. Please share your opinion about this tutorial!
Mail our developer-portal team: developer-portal@cdq.com