> This page is for APIs, version E-invoicing.
> For other versions, use one of these documentation indexes:
> - Overview (default): https://avalara.ferndocs.com/api-reference/overview/llms.txt
> - Calculations: https://avalara.ferndocs.com/api-reference/calculations/llms.txt
> - E-invoicing: https://avalara.ferndocs.com/api-reference/e-invoicing/llms.txt
> - Brazil: https://avalara.ferndocs.com/api-reference/brazil/llms.txt
> - Returns: https://avalara.ferndocs.com/api-reference/returns/llms.txt
> - Shared service: https://avalara.ferndocs.com/api-reference/shared-service/llms.txt
> - 1099 & W-9: https://avalara.ferndocs.com/api-reference/1099-w9/llms.txt
> - Tax registrations & business licenses: https://avalara.ferndocs.com/api-reference/tax-registrations/llms.txt
> - ECM: https://avalara.ferndocs.com/api-reference/ecm/llms.txt
> - Cross-Border: https://avalara.ferndocs.com/api-reference/cross-border/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://avalara.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://avalara.ferndocs.com/_mcp/server.

# Returns the tax identifier request and response schema for a specific country.

GET https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema

> **Access control:** this endpoint is available to users with the `everyone` role.

Returns the tax identifier request and response schema for a specific country.

Reference: https://avalara.ferndocs.com/api-reference/e-invoicing/public-reference/tax-identifier-schema-by-country

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `countryCode` (string, required) — Two-letter ISO 3166 country code for which to retrieve the schema (for example "DE").
- `type` (enum, optional) — Specifies which schema to return: "request" to receive the request validation schema or "response" to receive the response validation schema.
  - Allowed values: `request`, `response`

### Headers

- `avalara-version` (string, required) — Header that specifies the API version to use (for example "1.6").
- `X-Avalara-Client` (string, optional) — Optional header for a client identifier string used for diagnostics (for example "Fingerprint").
- `X-Correlation-ID` (string, optional) — Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43").

## Response

### 200

Returns an object containing countryCode, schemaType, and schema. The schema property contains a JSON Schema (Draft-07) used to validate tax identifier requests or responses for the specified country.

- `countryCode` (string, required) — The two-letter ISO-3166 country code of the tax identifier.
- `schemaType` (string, required) — The type of schema returned: "request" or "response".
- `schema` (TaxIdentifiersSchemaGetResponsesContentApplicationJsonSchemaSchema, required) — The JSON Schema definition, following Draft-07 specification, used to validate tax identifier data.

## Errors

### 400 Bad Request Error

Invalid request

- `title` (string, optional)
- `status` (string, optional)
- `detail` (string, optional)
- `instance` (string, optional)

### 401 Unauthorized Error

Unauthorized.

- `title` (string, optional)
- `status` (string, optional)
- `detail` (string, optional)
- `instance` (string, optional)

### 403 Forbidden Error

Forbidden.

- `title` (string, optional)
- `status` (string, optional)
- `detail` (string, optional)
- `instance` (string, optional)

### 500 Internal Server Error

Internal server error.

- `title` (string, optional)
- `status` (string, optional)
- `detail` (string, optional)
- `instance` (string, optional)

## Types

### TaxIdentifiersSchemaGetResponsesContentApplicationJsonSchemaSchema

The JSON Schema definition, following Draft-07 specification, used to validate tax identifier data.

## Examples

### RequestResponseSchema

**Response**

```json
{
  "countryCode": "DE",
  "schemaType": "string",
  "schema": {
    "request": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "properties": {
        "countryCode": {
          "description": "The two-letter ISO-3166 country code of the tax identifier.",
          "example": "DE",
          "type": "string"
        },
        "identifier": {
          "description": "The tax identifier of the company.",
          "example": "123456789",
          "type": "string"
        },
        "identifierType": {
          "description": "Type of the identifier.",
          "enum": [
            "VAT"
          ],
          "example": "VAT",
          "type": "string"
        }
      },
      "required": [
        "countryCode",
        "identifierType",
        "identifier"
      ],
      "type": "object"
    },
    "response": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "properties": {
        "countryCode": {
          "description": "The two-letter ISO-3166 country code of the tax identifier.",
          "example": "DE",
          "type": "string"
        },
        "value": {
          "properties": {
            "companyStatus": {
              "description": "Current status of the company.",
              "example": "active",
              "type": "string"
            },
            "extensions": {
              "description": "Includes additional details required by specific tax authorities.",
              "properties": {
                "blockListed": {
                  "description": "Indicates if the company is blocklisted.",
                  "example": false,
                  "type": "boolean"
                },
                "companyAddress": {
                  "description": "Address of the company.",
                  "example": "Example address",
                  "type": "string"
                },
                "companyName": {
                  "description": "Registered name of the company.",
                  "example": "Test company",
                  "type": "string"
                }
              },
              "required": [
                "companyName",
                "companyAddress",
                "blockListed"
              ],
              "type": "object"
            },
            "identifier": {
              "description": "The tax identifier of the company.",
              "example": "123456789",
              "type": "string"
            },
            "identifierType": {
              "description": "Type of the identifier.",
              "enum": [
                "VAT"
              ],
              "example": "VAT",
              "type": "string"
            }
          },
          "required": [
            "identifierType",
            "identifier",
            "companyStatus",
            "extensions"
          ],
          "type": "object"
        }
      },
      "required": [
        "countryCode",
        "value"
      ],
      "type": "object"
    }
  }
}
```

**SDK Code**

```python RequestResponseSchema
import requests

url = "https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema"

querystring = {"countryCode":"DE"}

headers = {
    "avalara-version": "1.6",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript RequestResponseSchema
const url = 'https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE';
const options = {
  method: 'GET',
  headers: {'avalara-version': '1.6', Authorization: 'Bearer <token>'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go RequestResponseSchema
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("avalara-version", "1.6")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby RequestResponseSchema
require 'uri'
require 'net/http'

url = URI("https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["avalara-version"] = '1.6'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java RequestResponseSchema
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE")
  .header("avalara-version", "1.6")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php RequestResponseSchema
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'avalara-version' => '1.6',
  ],
]);

echo $response->getBody();
```

```csharp RequestResponseSchema
using RestSharp;

var client = new RestClient("https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE");
var request = new RestRequest(Method.GET);
request.AddHeader("avalara-version", "1.6");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift RequestResponseSchema
import Foundation

let headers = [
  "avalara-version": "1.6",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### RequestSchemaWithAdditionalIdentifiers

**Response**

```json
{
  "countryCode": "MY",
  "schemaType": "string",
  "schema": {
    "request": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "properties": {
        "countryCode": {
          "description": "The two-letter ISO-3166 country code of the tax identifier.",
          "example": "MY",
          "type": "string"
        },
        "extensions": {
          "properties": {
            "additionalIdentifiers": {
              "items": {
                "properties": {
                  "idType": {
                    "description": "Type of the additional identifier.",
                    "enum": [
                      "NRIC",
                      "PASSPORT",
                      "BRN",
                      "ARMY"
                    ],
                    "example": "BRN",
                    "type": "string"
                  },
                  "idValue": {
                    "description": "The additional tax identifier of the company.",
                    "example": "201901234567",
                    "type": "string"
                  }
                },
                "required": [
                  "idType",
                  "idValue"
                ],
                "type": "object"
              },
              "type": "array"
            }
          },
          "required": [
            "additionalIdentifiers"
          ],
          "type": "object"
        },
        "identifier": {
          "description": "The tax identifier of the company.",
          "example": "123456789",
          "type": "string"
        },
        "identifierType": {
          "description": "Type of the identifier.",
          "enum": [
            "TIN"
          ],
          "example": "TIN",
          "type": "string"
        }
      },
      "required": [
        "countryCode",
        "identifierType",
        "identifier",
        "extensions"
      ],
      "type": "object"
    },
    "response": {}
  }
}
```

**SDK Code**

```python RequestSchemaWithAdditionalIdentifiers
import requests

url = "https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema"

querystring = {"countryCode":"DE"}

headers = {
    "avalara-version": "1.6",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript RequestSchemaWithAdditionalIdentifiers
const url = 'https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE';
const options = {
  method: 'GET',
  headers: {'avalara-version': '1.6', Authorization: 'Bearer <token>'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go RequestSchemaWithAdditionalIdentifiers
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("avalara-version", "1.6")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby RequestSchemaWithAdditionalIdentifiers
require 'uri'
require 'net/http'

url = URI("https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["avalara-version"] = '1.6'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java RequestSchemaWithAdditionalIdentifiers
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE")
  .header("avalara-version", "1.6")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php RequestSchemaWithAdditionalIdentifiers
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'avalara-version' => '1.6',
  ],
]);

echo $response->getBody();
```

```csharp RequestSchemaWithAdditionalIdentifiers
using RestSharp;

var client = new RestClient("https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE");
var request = new RestRequest(Method.GET);
request.AddHeader("avalara-version", "1.6");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift RequestSchemaWithAdditionalIdentifiers
import Foundation

let headers = [
  "avalara-version": "1.6",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sbx.avalara.com/einvoicing/tax-identifiers/schema?countryCode=DE")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```