> 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 document field information for a country mandate, a selected document type, and its version

GET https://api.sbx.avalara.com/einvoicing/mandates/{mandateId}/data-input-fields

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

This endpoint provides document field details and the optionality of fields (required, conditional, optional) of different documents supported by the country mandate. Use the GET /mandates endpoint to retrieve all available country mandates, their supported document types and supported versions. You can use the `documentType` and `documentVersion` query parameters to retrieve the input fields for a particular document type and document version.

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

## Authentication

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

## Request

### Path parameters

- `mandateId` (string, required) — Unique identifier of the mandate returned by the GET /mandates endpoint.

### Query parameters

- `documentType` (string, required) — Select the documentType for which you wish to view the data-input-fields (You may obtain the supported documentTypes from the GET /mandates endpoint)
- `documentVersion` (string, required) — Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint)

### 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 MandateDataInputFieldsResponse object containing the input fields and their optionality for the specified mandate, document type, and document version.

- `list of MandateDataInputField`

## Errors

### 400 Bad Request Error

Bad request.

- `error` (string, optional) — The three-digit HTTP error code for the bad request
- `message` (string, optional) — A message explaining the bad request

### 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

### 404 Not Found Error

Resource not found

- `error` (string, optional) — The three-digit HTTP error code for a not found error
- `message` (string, optional) — A message about the not found error

### 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

### MandateDataInputField

The Data Input Field

- `fieldId` (string, optional) — Field ID
- `documentType` (string, optional) — The document type
- `documentVersion` (string, optional) — The document version
- `path` (string, optional) — Path to this field
- `pathType` (string, optional) — The type of path
- `fieldName` (string, optional) — Field name
- `namespace` (MandateDataInputFieldNamespace, optional) — The namespace of the UBL element
- `exampleOrFixedValue` (string, optional) — An example of the content for this field
- `acceptedValues` (list of string, optional) — An Array representing the acceptable values for this field
- `documentationLink` (string, optional) — An example of the content for this field
- `dataType` (string, optional) — The data type of this field.
- `description` (string, optional) — A description of this field
- `optionality` (string, optional) — Determines if the field if Required/Conditional/Optional or not required.
- `cardinality` (string, optional) — Represents the number of times an element can appear within the document

### MandateDataInputFieldNamespace

The namespace of the UBL element

- `prefix` (string, optional) — The namespace prefix for the UBL Element
- `value` (string, optional)

## Examples

**Response**

```json
[
  {
    "fieldId": "1",
    "documentType": "ubl-inovice",
    "documentVersion": "2.1",
    "path": "Invoice/cbc:CustomizationID",
    "pathType": "xpath",
    "fieldName": "cbc:CustomizationID",
    "namespace": {
      "prefix": "cbc",
      "value": "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
    },
    "exampleOrFixedValue": "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0",
    "acceptedValues": [
      "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0"
    ],
    "documentationLink": "https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cbc-CustomizationID",
    "dataType": "object",
    "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.",
    "optionality": "Required",
    "cardinality": "1..1"
  }
]
```

**SDK Code**

```python
import requests

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

querystring = {"documentType":"ubl-invoice","documentVersion":"2.1"}

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

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

print(response.json())
```

```javascript
const url = 'https://api.sbx.avalara.com/einvoicing/mandates/AD-B2G-PEPPOL/data-input-fields?documentType=ubl-invoice&documentVersion=2.1';
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/mandates/AD-B2G-PEPPOL/data-input-fields?documentType=ubl-invoice&documentVersion=2.1"

	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/mandates/AD-B2G-PEPPOL/data-input-fields?documentType=ubl-invoice&documentVersion=2.1")

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/mandates/AD-B2G-PEPPOL/data-input-fields?documentType=ubl-invoice&documentVersion=2.1")
  .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/mandates/AD-B2G-PEPPOL/data-input-fields?documentType=ubl-invoice&documentVersion=2.1', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'avalara-version' => '1.6',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.sbx.avalara.com/einvoicing/mandates/AD-B2G-PEPPOL/data-input-fields?documentType=ubl-invoice&documentVersion=2.1");
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/mandates/AD-B2G-PEPPOL/data-input-fields?documentType=ubl-invoice&documentVersion=2.1")! 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()
```