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.

tax indentifier overview
Use Case: Situation, Approach and Results

Scenario and Learning Goals

QCEVI process
Common Process and involved APIs/Endpoints

In this tutorial, you will learn how:

  1. Create storage and upload data
  2. Run the validation job with Data Validation API.
  3. Report building
  4. Download report
  5. Delete storage

Prerequisites

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.
auth7
  1. After pasting the API Key, the green padlock will appear.
auth8
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
  2. Follow the steps above.

Step 1: Data Import

Create a storage

attention
Skip this step if a Data Storage was created before. You can use it multiple times for your files. Get the id of your Data Storage and go directly to the next step. Step

To upload desired files storage is needed! Before upload:

  1. Use the Create Storage endpoint to send the below request
  2. Select Create a storage example
  3. Replace the dataStorageExample and the dataSourceExample with new names
attention
For the tutorial needs the value of dataMapperDefinitionId is set to default.
application/json
{
  • "name": "dataStorageExample",
  • "dataMatchingDefinitionId": "string",
  • "dataSources": [
    • {
      • "dataSourceName": "dataSourceExample",
      • "dataMapperDefinitionId": "default"
      }
    ],
  • "featuresOn": [
    • "LOOKUP"
    ],
  • "sharedWithOrganization": false,
  • "labels": [
    • "string"
    ]
}
  1. Check the above example in the Try It Console now:
Loading...

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 example id:3a10645d8be23f53a20b30bfa936e63d).
  • The storage is empty by default.
Congratulations!
The Data Storage is successfully created. Use storage id in the next step

Upload data via CSV/XLSX

To start the import job of a csv or xlsx file:

  1. Use the Start Import Job endpoint to send the below request
  2. Paste the existing storage id
  3. Select the file to upload
attention

You can use your own file or use CDQ Sample File.

  1. Check the above example in the Try It Console now:
Loading...

In response, you will find three important parameters:

  • The value of the id representing YOUR_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
Note down received YOUR_UPLOAD_JOB_ID for polling the job status.

Wait until upload is finished

To check the import job status:

  1. Use the Poll Import Job endpoint to send the below request
  2. Use the YOUR_JOB_ID1 from the previous step and replace the jobId
  1. Check the above example in the Try It Console now:
Loading...
  • If the job is still running, the status with the progress will be displayed:
Copy
Copied
{
  "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
Copy
Copied
{
  "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:

  1. Use the Business Partner Validation Jobs endpoint
  2. Modify request and replace the YOUR_STORAGE_ID with the storage id received from Step 1
    • The EU_VAT_QUALIFICATION is set as a profile. More profiles are described on the documentation page
application/json
{
  • "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"
      }
    ]
}
  1. Check the above example in the Try It Console now:
Loading...

In response, you will find three important parameters:

  • The value of the id representing YOUR_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
Save received YOUR_VALIDATION_JOB_ID for polling the job status and in the building report step.

Wait for completion

To poll the validation job status:

  1. Use the Poll Validation Job endpoint to send the below request
  2. Use the YOUR_VALIDATION_JOB_ID from the previous step and paste it into the job id field

Cannot find specified operation in definition: data-validation-v2

  1. 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:
Copy
Copied
{
  "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
Copy
Copied
{
  "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:

  1. Use the Build Validation Reports endpoint
  2. Modify request and replace the YOUR_VALIDATION_JOB_ID with the id value received from Step 2
  • The reportRequest with build parameter set to true. The default value is false.
application/json
{
  • "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"
      ]
    },
  • "dataValidationJobId": "YOUR_JOB_ID2"
}
  1. Check the above example in the Try It Console now:
Loading...

In response, you will find three important parameters:

  • The value of the id representing YOUR_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
Save received YOUR_RAPORT_JOB_ID for polling the job status and in the building report step.

Wait for completion

To poll the report job status:

  1. Use the Poll Validation Reports endpoint to send the below request
  2. Use the YOUR_RAPORT_JOB_ID from the previous step and paste it into the job id field
  1. Check the above example in the Try It Console now:
Loading...

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.
Copy
Copied
{
  "id": "YOUR_RAPORT_JOB_ID",
  "status": "FINISHED",
  "attachments": [
    {
      "name": "Qualification+Report+Collection",
      "url": "YOUR_REPORT_URL"
    }
  ]
}
attention
Save received YOUR_REPORT_URL for download. Copy entire url value.

Step 4: Download result report

To download the report:

  1. Use the Request a file download endpoint to send the below request
  2. Use the YOUR_REPORT_URL from the previous step and paste into it the url value
application/json
{
  • "url": "customer-upload/user/file.xlsx",
  • "downloadLinkAge": "0"
}
  1. Check the above example in the Try It Console now:
Loading...

In response, you will find download details:

Copy
Copied
{
    "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.

  1. Use the Delete Storage endpoint to send the below request
  2. Use the existing storage id no longer in use and replace the storageId in the request
  1. Check the above example in the Try It Console now:
Loading...

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