e-invoicing

Validate a tax identifier through the API

Learn how to check that a tax identifier belongs to a valid legal entity in a given country or region using the TaxIdCheck Storage Service method.

Before validating a tax identifier:

  • Your application must be authenticated with a valid X.509v3 client certificate.
  • You must know the tax identifier and country code of the party to look up.
  • For some countries, you must also provide information about the requesting party (for VIES check and India) or a bank account name and bank account type (Poland). Contact the Sovos team to confirm the requirements for your target country.

The TaxIdCheck method checks whether a tax identifier belongs to a valid registered legal entity in a specified country or region. The method queries an external checking system appropriate for the country, identified by the TaxIdCheckTargetSystem parameter. The response indicates whether the identifier is valid and, where available, returns company information associated with it.

  1. Build the TaxIdCheck request with the target party information and, if required by the country, the requester and bank account details.

    Request type: tas:TaxIdCheckRequest, extends tac:TrustArchiveRequest.

    Element Type Cardinality Description
    RequestTarget tas:TaxIdCheckParty 1 Information about the party whose tax identifier is being validated. See TaxIdCheckParty .
    Requester tas:TaxIdCheckParty 0..1 Information about the party making the request. Mandatory for some countries and disallowed for others. Contact the Sovos team to confirm whether your target country requires this element.
    BankAccount tas:BankAccountInfo 0..1 Bank account information for the request target. Mandatory for Poland. Contact the Sovos team to confirm whether your target country requires this element.
    TaxIdCheckTargetSystem tas:TaxIdCheckTargetSystem 0..1 The external checking system to query. See TaxIdCheckTargetSystem values. If omitted, the system is determined by the country code.

    TaxIdCheckParty elements:

    Element Type Cardinality Description
    Name xs:string 0..1 The name of the party. For user organizations, this is the section name. Allowed characters: Unicode letters, numbers, marks, punctuation, symbols, and single spaces; excluding double quotes, angle brackets, and control characters. Leading and trailing spaces are not allowed. Length: 1-80 characters.
    CountryCode xs:string 1 The ISO 3166 alpha-2 country code of the party or branch for which the check is performed.
    TaxId xs:string 1 The tax identifier of the party. For some countries, this must match the tax identifier of a registered branch. Configuration parameters provided when registering the branch may affect the process.

    TaxIdCheckTargetSystem values:

    Value Description
    PolishTaxIDCheck Check system for Polish tax identifiers.
    VATInformationExchangeSystem Check system for EU and GB tax identifiers (VIES).
    IndiaGSTIN Check system for Indian GSTIN tax identifiers.

    Example request:

    CODE
    <TaxIdCheckRequest
      xmlns:tac="http://www.trustweaver.com/trustarchive/common/v1"
      xmlns="http://www.trustweaver.com/trustarchive/storage/v1">
      <Request>
        <tac:TransactionId>3580f1bbbfb349b1a97b98c2c2eb9ff3</tac:TransactionId>
        <RequestTarget>
          <CountryCode>EL</CountryCode>
          <TaxId>094014170</TaxId>
        </RequestTarget>
        <Requester>
          <CountryCode>DE</CountryCode>
          <TaxId>813022070</TaxId>
        </Requester>
        <TaxIdCheckTargetSystem>VATInformationExchangeSystem</TaxIdCheckTargetSystem>
      </Request>
    </TaxIdCheckRequest>
  2. Send the request to the Storage Service endpoint using HTTPS with client certificate authentication.
  3. Process the TaxIdCheckResponse and inspect the validation status.

    Result type: tas:TaxIdCheckResult.

    Element Type Description
    Status tas:TaxIdCheckStatus The validation result. Either Valid (the tax identifier exists and belongs to a valid legal entity) or Invalid (the identifier does not exist or is not valid).
    Company tas:Company Information about the company associated with the tax identifier. Present when the checking system returns company data. See Company elements.
    AdditionalInfos tas:AdditionalInfos A list of additional key-value pairs returned by the checking system. Content varies by country and checking system.

    Company elements (all optional):

    Element Description
    TraderCountryCode The country code of the trading partner.
    TraderTaxID The tax identifier of the trading partner.
    RequestDate The date and time of the check request, as returned by the checking system.
    TraderValidity The validity status of the tax identifier as provided by the checking system.
    TraderName The trading name of the company.
    TraderLegalName The legal name of the company.
    TraderCompanyType The company type. Returned for Greece and Spain in VIES.
    TraderAddress The street number or building number of the company.
    TraderStreet The street where the company is located.
    TraderPostCode The postal code of the company.
    TraderCity The city where the company is located.
    TraderDistrict The district where the company is located.
    TraderFloorNumber The floor number of the company.
    TraderStateCode The state code where the company is located.
    TraderDateOfRegistration The date the company was registered.
    TraderDateOfDeRegistration The date the company was de-registered, if applicable.
    RequestIdentifier The identifier of the check request, also known as the consultation number. Returned as proof of a completed request.
    TraderEWBStatus The trading partner's status regarding their ability to generate an e-way bill (EWB).

    Example response:

    CODE
    <TaxIdCheckResult
      xmlns="http://www.trustweaver.com/trustarchive/storage/v1">
      <Status>Valid</Status>
      <AdditionalInfos>
        <AdditionalInfo>
          <Key>PublicationDate</Key>
          <Value>20200323</Value>
        </AdditionalInfo>
      </AdditionalInfos>
    </TaxIdCheckResult>

The response contains the validation status of the tax identifier. A Status of Valid confirms that the identifier belongs to a registered legal entity. A Status of Invalid indicates that the identifier does not exist or is not valid in the specified country.

For error codes returned by this method, see Storage service error codes.