> 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 optionality of document fields for different country mandates

GET https://api.sbx.avalara.com/einvoicing/data-input-fields

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

This endpoint returns a list of required, conditional, and optional fields for each country mandate. Use the mandates endpoint to retrieve all available country mandates. Use the $filter query parameter to retrieve fields for a specific mandate.

Reference: https://avalara.ferndocs.com/api-reference/e-invoicing/public-reference/get-data-input-fields

## Authentication

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

## Request

### Query parameters

- `$filter` (string, optional) — Filter by field name and value. This filter supports only eq and contains. For more information, refer to the Avalara filtering guide.
- `$top` (integer, optional) — The number of items to include in the result.
- `$skip` (integer, optional) — The number of items to skip in the result.
- `$count` (string, optional) — When set to true, the response body also includes the count of items in the collection.
- `$countOnly` (string, optional) — When set to true, the response returns only the count of items in the collection.

### 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").

## Response

### 200

Returns a DataInputFieldsResponse object containing the data input fields and their optionality for the requested mandate.

- `@recordsetCount` (double, optional) — Total count of results
- `@nextLink` (string, optional, nullable)
- `value` (list of DataInputField, optional) — Array of Data Input Fields

## Errors

### 401 Unauthorized Error

Unauthorized.

- `any`

### 403 Forbidden Error

Forbidden.

- `Message` (string, optional) — A message that informs the user that they may not access a resource

### 500 Internal Server Error

Internal server error.

- `error` (string, optional) — A bad request error code
- `message` (string, optional) — A message explaining the bad request error

## Types

### DataInputField

The Data Input Field

- `id` (string, optional) — Field UUID
- `fieldId` (string, optional) — Field ID
- `applicableDocumentRoots` (list of ApplicableDocumentRootsField, optional)
- `path` (string, optional) — Path to this field
- `namespace` (string, optional) — Namespace of this field
- `fieldName` (string, optional) — Field name
- `exampleOrFixedValue` (string, optional) — An example of the content for this field
- `acceptedValues` (DataInputFieldAcceptedValues, optional) — An object representing the acceptable values for this field
- `documentationLink` (string, optional) — An example of the content for this field
- `description` (string, optional) — A description of this field
- `isSegment` (boolean, optional) — Is this a segment of the schema
- `requiredFor` (DataInputFieldRequiredFor, optional) — Array of CountryMandate names for which this field is required.
- `conditionalFor` (list of ConditionalForField, optional)
- `notUsedFor` (DataInputFieldNotUsedFor, optional) — Array of CountryMandate names for which this field is not used.
- `optionalFor` (DataInputFieldOptionalFor, optional) — Array of CountryMandate names for which this field is optional.

### ApplicableDocumentRootsField

Document types for which this field is applicable for

### DataInputFieldAcceptedValues

An object representing the acceptable values for this field

### DataInputFieldRequiredFor

Array of CountryMandate names for which this field is required.

- `countryMandate` (string, optional)

### ConditionalForField

Mandates for which this field is conditional

- `countryMandate` (string, optional)
- `requiredWhen` (list of RequiredWhenField, optional) — Array of scenarios which describe when a particular field is conditional for a country mandate

### DataInputFieldNotUsedFor

Array of CountryMandate names for which this field is not used.

- `countryMandate` (string, optional)

### DataInputFieldOptionalFor

Array of CountryMandate names for which this field is optional.

- `countryMandate` (string, optional)

### RequiredWhenField

- `scenario` (string, optional)

## Examples

**Response**

```json
{
  "@recordsetCount": 1,
  "@nextLink": "",
  "value": [
    {
      "id": "f1768981-7025-468b-9f87-8a8982cd6984",
      "fieldId": "1",
      "applicableDocumentRoots": [
        "Invoice"
      ],
      "path": "invoice/cbc:CustomizationID",
      "namespace": "cbc:",
      "fieldName": "cbc:CustomizationID",
      "exampleOrFixedValue": "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0",
      "acceptedValues": {},
      "documentationLink": "https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cbc-CustomizationID",
      "description": "Specification identifier: An identification of the specification containing the total set of rules regarding semantic content, cardinalities and business rules to which the data contained in the instance document conforms.",
      "isSegment": "false",
      "requiredFor": {
        "0": {
          "countryMandate": "AD-B2G-PEPPOL"
        },
        "1": {
          "countryMandate": "AD-B2B-PEPPOL"
        },
        "2": {
          "countryMandate": "AU-B2G-PEPPOL"
        },
        "3": {
          "countryMandate": "AU-B2B-PEPPOL"
        },
        "4": {
          "countryMandate": "AT-B2G-PEPPOL"
        },
        "5": {
          "countryMandate": "AT-B2B-PEPPOL"
        },
        "6": {
          "countryMandate": "BE-B2G-PEPPOL"
        },
        "7": {
          "countryMandate": "BE-B2B-PEPPOL"
        },
        "8": {
          "countryMandate": "HR-B2G-PEPPOL"
        },
        "9": {
          "countryMandate": "HR-B2B-PEPPOL"
        },
        "10": {
          "countryMandate": "CY-B2G-PEPPOL"
        },
        "11": {
          "countryMandate": "CY-B2B-PEPPOL"
        },
        "12": {
          "countryMandate": "DK-B2G-PEPPOL"
        },
        "13": {
          "countryMandate": "DK-B2B-PEPPOL"
        },
        "14": {
          "countryMandate": "FR-B2B-PEPPOL"
        },
        "15": {
          "countryMandate": "DE-B2G-PEPPOL"
        },
        "16": {
          "countryMandate": "DE-B2B-PEPPOL"
        },
        "17": {
          "countryMandate": "IE-B2G-PEPPOL"
        },
        "18": {
          "countryMandate": "IE-B2B-PEPPOL"
        },
        "19": {
          "countryMandate": "LV-B2G-PEPPOL"
        },
        "20": {
          "countryMandate": "LV-B2B-PEPPOL"
        },
        "21": {
          "countryMandate": "LT-B2G-PEPPOL"
        },
        "22": {
          "countryMandate": "LT-B2B-PEPPOL"
        },
        "23": {
          "countryMandate": "LU-B2G-PEPPOL"
        },
        "24": {
          "countryMandate": "LU-B2B-PEPPOL"
        },
        "25": {
          "countryMandate": "MT-B2G-PEPPOL"
        },
        "26": {
          "countryMandate": "MT-B2B-PEPPOL"
        },
        "27": {
          "countryMandate": "NL-B2G-PEPPOL"
        },
        "28": {
          "countryMandate": "NL-B2B-PEPPOL"
        },
        "29": {
          "countryMandate": "NZ-B2G-PEPPOL"
        },
        "30": {
          "countryMandate": "NZ-B2B-PEPPOL"
        },
        "31": {
          "countryMandate": "NO-B2G-PEPPOL"
        },
        "32": {
          "countryMandate": "NO-B2B-PEPPOL"
        },
        "33": {
          "countryMandate": "PL-B2G-PEPPOL"
        },
        "34": {
          "countryMandate": "PL-B2B-PEPPOL"
        },
        "35": {
          "countryMandate": "SI-B2G-PEPPOL"
        },
        "36": {
          "countryMandate": "SI-B2B-PEPPOL"
        },
        "37": {
          "countryMandate": "SE-B2G-PEPPOL"
        },
        "38": {
          "countryMandate": "SE-B2B-PEPPOL"
        },
        "39": {
          "countryMandate": "GB-B2G-PEPPOL"
        },
        "40": {
          "countryMandate": "GB-B2B-PEPPOL"
        }
      },
      "conditionalFor": [
        {
          "countryMandate": "DE-ZUGFERD"
        }
      ],
      "notUsedFor": {
        "0": {
          "countryMandate": "HU-B2B-REPORTING"
        },
        "1": {
          "countryMandate": "HU-B2C-REPORTING"
        },
        "2": {
          "countryMandate": "MX-B2B-CLEARANCE"
        },
        "3": {
          "countryMandate": "MX-B2C-CLEARANCE"
        },
        "4": {
          "countryMandate": "PL-B2B-EINVOICE"
        },
        "5": {
          "countryMandate": "PL-B2G-EINVOICE"
        },
        "6": {
          "countryMandate": "PT-B2B-CLEARANCE"
        },
        "7": {
          "countryMandate": "PT-B2G-CLEARANCE"
        },
        "8": {
          "countryMandate": "PT-B2C-CLEARANCE"
        },
        "9": {
          "countryMandate": "SA-Phase1-B2B"
        },
        "10": {
          "countryMandate": "SA-Phase1-B2C-PDF"
        },
        "11": {
          "countryMandate": "RS-B2B-EINVOICE"
        },
        "12": {
          "countryMandate": "RS-B2G-EINVOICE"
        },
        "13": {
          "countryMandate": "ES-B2B-FACE"
        }
      },
      "optionalFor": {
        "0": {
          "countryMandate": "IT-B2B-EINVOICE"
        },
        "1": {
          "countryMandate": "IT-B2C-EINVOICE"
        },
        "2": {
          "countryMandate": "IT-B2G-EINVOICE"
        }
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.sbx.avalara.com/einvoicing/data-input-fields"

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

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

print(response.json())
```

```javascript
const url = 'https://api.sbx.avalara.com/einvoicing/data-input-fields';
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
package main

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

func main() {

	url := "https://api.sbx.avalara.com/einvoicing/data-input-fields"

	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
require 'uri'
require 'net/http'

url = URI("https://api.sbx.avalara.com/einvoicing/data-input-fields")

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
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.sbx.avalara.com/einvoicing/data-input-fields")
  .header("avalara-version", "1.6")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.sbx.avalara.com/einvoicing/data-input-fields', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'avalara-version' => '1.6',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sbx.avalara.com/einvoicing/data-input-fields")! 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()
```