# Avalara E-Invoicing API

An API that supports sending data for an E-Invoicing compliance use-case.

Source: https://developer.avalara.com/products/e-invoicing/api/

**Version:** 1.5
**Base URL:** https://api.sbx.avalara.com/einvoicing

---

## Endpoints

### Documents

#### Returns a summary of documents for a date range

`GET /documents`

Returns a list of document summaries with a processing date within the specified date range.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `startDate` | string | query | No | Start date for documents to return. Defaults to the previous month. Format: "YYYY-MM-DDThh:mm:ss". |
| `endDate` | string | query | No | End date for documents to return. Defaults to the current date. Format: "YYYY-MM-DDThh:mm:ss". |
| `flow` | string | query | No | Optional filter for document direction: issued uses "out" and received uses "in". |
| `$count` | string | query | No | When set to true, the response body also includes the count of items in the collection. |
| `$countOnly` | string | query | No | When set to true, the response returns only the count of items in the collection. |
| `$filter` | string | query | No | Filter by field name and value. This filter supports only eq. For more information, refer to the Avalara filtering guide. |
| `$include` | string | query | No | When set to `events`, each document in the response includes its events array. Omit this parameter or use any other value to exclude events from the response. |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |

#### Submits a document to Avalara E-Invoicing API

`POST /documents`

When a UBL document is sent to this endpoint, it generates a document in the required format as mandated by the specified country. Additionally, it initiates the workflow to transmit the generated document to the relevant tax authority, if necessary.The response from the endpoint contains a unique document ID, which can be used to request the status of the document and verify if it was successfully accepted at the destination.Furthermore, the unique ID enables the download of a copy of the generated document for reference purposes.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |

#### Returns a copy of the document

`GET /documents/{documentId}/$download`

Downloads the document when it is available. Specify the output format in the Accept header. Returns 404 if the file has not been created.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `Accept` | string | header | Yes | Header that specifies the MIME type of the returned document. |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `documentId` |  | path | Yes | The unique documentId returned in the POST /documents response body. |

#### Checks the status of a document

`GET /documents/{documentId}/status`

Uses the documentId from the POST /documents response body to return the current status of a document.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `documentId` |  | path | Yes | The unique documentId returned in the POST /documents response body. |

#### Fetch the inbound document from a tax authority

`POST /documents/$fetch`

Retrieves an inbound document. Provide key-value pairs as request parameters. Supported parameters vary by tax authority and country.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |


### Data Input Fields

#### Returns the optionality of document fields for different country mandates

`GET /data-input-fields`

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.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `$filter` | string | query | No | Filter by field name and value. This filter supports only eq and contains. For more information, refer to the Avalara filtering guide. |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `$count` | string | query | No | When set to true, the response body also includes the count of items in the collection. |
| `$countOnly` | string | query | No | When set to true, the response returns only the count of items in the collection. |


### Mandates

#### List country mandates that are supported by the Avalara E-Invoicing platform

`GET /mandates`

This endpoint offers a list of country mandates supported by the Avalara E-Invoicing API.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `$filter` | string | query | No | Filter by field name and value. This filter only supports eq and contains. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `$count` | string | query | No | When set to true, the count of the collection is also returned in the response body. |
| `$countOnly` | string | query | No | When set to true, only the count of the collection is returned. |

#### Returns document field information for a country mandate, a selected document type, and its version

`GET /mandates/{mandateId}/data-input-fields`

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.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `mandateId` | string | path | Yes | Unique identifier of the mandate returned by the GET /mandates endpoint. |
| `documentType` | string | query | Yes | 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 | query | Yes | Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) |


### Trading Partners

#### Returns a list of participants matching the input query.

`GET /trading-partners`

This endpoint retrieves a list of trading partners that match the specified search criteria. It supports filtering, search text, and other relevant query parameters to narrow down the results.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `count` | boolean | query | No | When set to true, returns the total count of matching records included as @recordSetCount in the response body. |
| `$search` | string | query | Yes | Search by value supports logical AND and OR operators (case-sensitive). Search is performed only over the name and identifier value fields. For more information, refer to the OData query options overview documentation. |
| `$filter` | string | query | No | Filters the results using the eq operator. Supported fields include network, country, documentType, and idType. For more information, refer to the Avalara filtering guide. |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `$orderBy` | string | query | No | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |

#### Creates a new trading partner.

`POST /trading-partners`

This endpoint creates a new trading partner with the provided details. The request body must include the necessary information as defined in the `TradingPartner` schema.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |

#### Creates a batch of multiple trading partners.

`POST /trading-partners/batch`

This endpoint creates multiple trading partners in a single batch request. It accepts an array of trading partners and processes them synchronously. Supports a maximum of 100 records or a 1 MB request payload.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |

#### Updates a trading partner using ID.

`PUT /trading-partners/{id}`

This endpoint updates the details of an existing trading partner specified by the provided ID. It performs a full update, and the request body must include all required fields.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |
| `id` | string | path | Yes | Unique identifier of the trading partner. |

#### Deletes a trading partner using ID.

`DELETE /trading-partners/{id}`

This endpoint deletes an existing trading partner identified by the provided ID.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |
| `id` | string | path | Yes | Unique identifier of the trading partner. |

#### Lists all batch searches that were previously submitted.

`GET /trading-partners/batch-searches`

This endpoint retrieves a list of all batch search operations that have been previously submitted. It returns details such as the batch search ID, status, creation date, and associated metadata. It is useful for tracking the progress of a previously initiated batch search operations.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `$filter` | string | query | No | Filters the results by field name. Only the eq operator and the name field are supported. For more information, refer to the Avalara filtering guide. |
| `count` | boolean | query | No | When set to true, returns the total count of matching records included as @recordSetCount in the response body. |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `$orderBy` | string | query | No | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |

#### Handles batch search requests by uploading a file containing search parameters.

`POST /trading-partners/batch-searches`

This endpoint creates a batch search and performs a batch search in the directory for participants in the background.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `name` | string | query | Yes | A human-readable name for the batch search. |
| `notificationEmail` | string | query | Yes | The email address to which a notification will be sent once the batch search is complete. |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |

#### Returns the batch search details using ID.

`GET /trading-partners/batch-searches/{id}`

This endpoint returns detailed information for a specific batch search using the provided ID. It is useful for tracking the status and progress of a previously initiated batch search operation.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `id` | string | path | Yes | Unique identifier of the batch search. |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |

#### Downloads batch search results in a csv file.

`GET /trading-partners/batch-searches/{id}/$download-results`

This endpoint downloads the report for a specific batch search using the batch search ID. It returns a CSV file containing up to 1,000 query results.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `id` | string | path | Yes | Unique identifier of the batch search for which to download the report. |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |


### Interop

#### Submit a document

`POST /interop/documents`

Upload documents on behalf of interoperability partners and submit them to trading partners through the Avalara platform.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `documentType` | string | query | Yes | Type of the document being uploaded. Partners will be configured in Avalara system to send only certain types of documents. |
| `interchangeType` | string | query | Yes | Type of interchange (codes in Avalara system that uniquely identifies a type of interchange). Partners will be configured in Avalara system to send documents belonging to certain types of interchanges. |
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |


### Subscriptions

#### List all subscriptions

`GET /webhooks/subscriptions`

Retrieve a list of webhook subscriptions.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |

#### Create a subscription to events

`POST /webhooks/subscriptions`

Create a new webhook subscription and return the created subscription details.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |

#### Get details of a subscription

`GET /webhooks/subscriptions/{subscriptionId}`

Retrieve details of a specific subscription.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `subscriptionId` | string | path | Yes | Unique identifier of the subscription. |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |

#### Unsubscribe from events

`DELETE /webhooks/subscriptions/{subscriptionId}`

Delete the specified webhook subscription.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `subscriptionId` | string | path | Yes | Unique identifier of the subscription. |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |


### Tax Identifiers

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

`GET /tax-identifiers/schema`

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

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |
| `countryCode` | string | query | Yes | Two-letter ISO 3166 country code for which to retrieve the schema (for example "DE"). |
| `type` | string | query | No | Specifies which schema to return: "request" to receive the request validation schema or "response" to receive the response validation schema. |

#### Validates a tax identifier.

`POST /tax-identifiers/validate`

This endpoint verifies whether a given tax identifier is valid and properly formatted according to the rules of the applicable country or tax system.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.5"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `X-Correlation-ID` | string | header | No | Optional correlation identifier provided by the caller to trace the call (for example "f3f0d19a-01a1-4748-8a58-f000d0424f43"). |

---

## Models

### documentId

The unique ID for this document that was returned in the POST /einvoicing/documents response body. This is a UID created by the Avalara E-Invoicing platform.

### documentFetch

| Property | Type | Description |
|---|---|---|
| `id` | string | Unique ID for this document that can be used for status checking and file downloads. This is a UID created by the Avalara E-Invoicing platform. |
| `status` | string | Status of the document |
| `eventDateTime` | string | The date and time when the inbound document was accepted by the Avalara E-Invoicing Platform |

### DocumentSubmitResponse

Returns the unique ID of a successful document submission

| Property | Type | Description |
|---|---|---|
| `id` | string | Unique ID for this document that can be used for status checking and file downloads. This is a UID created by the Avalara E-Invoicing platform. |

### DocumentStatusResponse

Returns the current document ID and status

| Property | Type | Description |
|---|---|---|
| `id` | string | The unique ID for this document |
| `status` | string | Document status. See the `supportedDocumentStatuses` field in the GET /mandates response for full status definitions. |
| `events` | array |  |

### DocumentListResponse

Returns the requested list of documents

| Property | Type | Description |
|---|---|---|
| `@recordsetCount` | string | Count of collections for the given date range |
| `@nextLink` | string |  |
| `value` | array | Array of documents matching query parameters |

### DocumentSummary

Displays a summary of information about the document

| Property | Type | Description |
|---|---|---|
| `id` | string | The unique ID for this document |
| `companyId` | string | Unique identifier that represents the company within the system. |
| `processDateTime` | string | The date and time when the document was processed, displayed in the format YYYY-MM-DDThh:mm:ss |
| `status` | string | The Document status |
| `supplierName` | string | The name of the supplier in the transaction |
| `customerName` | string | The name of the customer in the transaction |
| `documentType` | string | The document type |
| `documentVersion` | string | The document version |
| `documentNumber` | string | The document number |
| `documentDate` | string | The document issue date |
| `flow` | string | The document direction, where issued = `out` and received = `in` |
| `countryCode` | string | The two-letter ISO-3166 country code for the country where the document is being submitted |
| `countryMandate` | string | The e-invoicing mandate for the specified country |
| `interface` | string | The interface where the document is sent |
| `receiver` | string | The document recipient based on the interface |
| `events` | array | Array of status events associated with this document. Events are included in each document in the response only when the query parameter $include=events is passed; otherwise the events array is not populated. |
| `createdAt` | string | The date and time when the document was created in the system, displayed in ISO 8601 format with timezone |
| `lastUpdatedAt` | string | The date and time when the document was last updated in the system, displayed in ISO 8601 format with timezone |

### StatusEvent

Displays when a status event occurred

| Property | Type | Description |
|---|---|---|
| `eventDateTime` | string | The date and time when the status event occurred, displayed in the format YYYY-MM-DDThh:mm:ss |
| `message` | string | A message describing the status event |
| `responseKey` | string | The type of number or acknowledgement returned by the tax authority (if applicable). For example, it could be an identification key, acknowledgement code, or any other relevant identifier. |
| `responseValue` | string | The corresponding value associated with the response key. This value is provided by the tax authority in response to the event. |
| `category` | string | Represents the functional area or process stage where the status event occurred. Useful for grouping related events such as document processing, transmission, or validation. |

### SubmitDocument

Allows submission of a document.

| Property | Type | Description |
|---|---|---|
| `metadata` | object | Key value pairs of metadata for a document submission {  "workflowId": "partner-einvoicing", "dataFormat": "ubl-invoice", "dataFormatVersion": "2.1", "countryCode": "SA", "countryMandate": "SA-Phase1-B2B" } |
| `data` | object | The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' |

### ForbiddenError

Returns an optional message with a 'forbidden' response

| Property | Type | Description |
|---|---|---|
| `Message` | string | A message that informs the user that they may not access a resource |

### DocumentSubmissionError

Returns an HTTP status code and message for an 'exception'

| Property | Type | Description |
|---|---|---|
| `StatusCode` | string | The three-digit HTTP status code for the exception |
| `Message` | string | A message explaining the exception |

### BadRequest

Returns an HTTP status code and message for a 'bad request'

| Property | Type | Description |
|---|---|---|
| `error` | string | The three-digit HTTP error code for the bad request |
| `message` | string | A message explaining the bad request |

### NotFoundError

Returns an HTTP error code and message for a 'not found' error

| Property | Type | Description |
|---|---|---|
| `error` | string | The three-digit HTTP error code for a not found error |
| `message` | string | A message about the not found error |

### BadDownloadRequest

Returns an HTTP status code and message for a 'bad request'

| Property | Type | Description |
|---|---|---|
| `error` | string | The three-digit HTTP error code for the bad request |
| `message` | string | A message explaining the bad request |
| `supportedAcceptHeaders` | object | A message explaining the bad request |

### DataInputFieldsResponse

| Property | Type | Description |
|---|---|---|
| `@recordsetCount` | number | Total count of results |
| `@nextLink` | string |  |
| `value` | array | Array of Data Input Fields |

### DataInputField

The Data Input Field

| Property | Type | Description |
|---|---|---|
| `id` | string | Field UUID |
| `fieldId` | string | Field ID |
| `applicableDocumentRoots` | array |  |
| `path` | string | Path to this field |
| `namespace` | string | Namespace of this field |
| `fieldName` | string | Field name |
| `exampleOrFixedValue` | string | An example of the content for this field |
| `acceptedValues` | object | An object representing the acceptable values for this field |
| `documentationLink` | string | An example of the content for this field |
| `description` | string | A description of this field |
| `isSegment` | boolean | Is this a segment of the schema |
| `requiredFor` | object | Array of CountryMandate names for which this field is required. |
| `conditionalFor` | array |  |
| `notUsedFor` | object | Array of CountryMandate names for which this field is not used. |
| `optionalFor` | object | Array of CountryMandate names for which this field is optional. |

### ApplicableDocumentRootsField

Document types for which this field is applicable for

### ConditionalForField

Mandates for which this field is conditional

| Property | Type | Description |
|---|---|---|
| `countryMandate` | string |  |
| `requiredWhen` | array | Array of scenarios which describe when a particular field is conditional for a country mandate |

### RequiredWhenField

| Property | Type | Description |
|---|---|---|
| `scenario` | string |  |

### OptionalForField

Mandates for which this field is optional

### NotUsedForField

Mandates for which this field is not used

| Property | Type | Description |
|---|---|---|
| `countryMandate` | string |  |

### MandateDataInputFieldsResponse

Array of Data Input Fields

### MandateDataInputField

The Data Input Field

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

### InternalServerError

Returns an optional message with a 'InternalServerError' response

| Property | Type | Description |
|---|---|---|
| `error` | string | A bad request error code |
| `message` | string | A message explaining the bad request error |

### MandatesResponse

Mandate list response schema

| Property | Type | Description |
|---|---|---|
| `@recordsetCount` | number | Total count of results |
| `@nextLink` | string |  |
| `value` | array | Mandates schema |

### Mandate

| Property | Type | Description |
|---|---|---|
| `mandateId` | string | The `mandateId` is comprised of the country code, mandate type, and the network or regulation type (for example, AU-B2G-PEPPOL). Keep in mind the following when specifying a `mandateId`.
- A country can have multiple mandate types (B2C, B2B, B2G).
- A entity/company can opt in for multiple mandates.
- A `mandateId` is the combination of country + mandate type + network/regulation. |
| `countryMandate` | string | **[LEGACY]** This field is retained for backward compatibility. It is recommended to use `mandateId` instead.
The `countryMandate` similar to the `mandateId` is comprised of the country code, mandate type, and the network or regulation type (for example, AU-B2G-PEPPOL). |
| `countryCode` | string | Country code |
| `description` | string | Mandate description |
| `supportedByELRAPI` | boolean | Indicates whether this mandate supported by the ELR API |
| `mandateFormat` | string | Mandate format |
| `eInvoicingFlow` | string | The type of e-invoicing flow for this mandate |
| `eInvoicingFlowDocumentationLink` | string | Link to the documentation for this mandate's e-invoicing flow |
| `getInvoiceAvailableMediaType` | array | List of available media types for downloading invoices for this mandate |
| `supportsInboundDigitalDocument` | string | Indicates whether this mandate supports inbound digital documents |
| `inputDataFormats` | array | Format and version used when inputting the data |
| `outputDataFormats` | array | Lists the supported output document formats for the country mandate. For countries where specifying an output document format is required (e.g., France), this array will contain the applicable formats. For other countries where output format selection is not necessary, the array will be empty. |
| `workflowIds` | array | Workflow ID list |
| `supportedDocumentStatuses` | array | List of document statuses defined by the mandate. |

### inputDataFormats

Format and version used when inputting the data

| Property | Type | Description |
|---|---|---|
| `format` | string | Document format |
| `versions` | array |  |

### InputDataFormatVersions

Document format version

### OutputDataFormats

Format and version used when outputting the data

| Property | Type | Description |
|---|---|---|
| `format` | string | Document format |
| `versions` | array |  |

### OutputDataFormatVersions

Document format version

### WorkflowIds

Workflow ID list

| Property | Type | Description |
|---|---|---|
| `name` | string | The name of this workflow |
| `description` | string | Workflow description |

### SupportedDocumentStatuses

Represents a document status defined by the mandate.

| Property | Type | Description |
|---|---|---|
| `status` | string | The name of the status (e.g., Approved, Fully Paid). |
| `description` | string | Explanation of what the status means. |

### BatchSearchListResponse

Response schema for listing batch search details.

| Property | Type | Description |
|---|---|---|
| `@recordSetCount` | integer | The count of records in the result set. |
| `@nextLink` | string | Next Link |
| `value` | array | List of batch search records. |

### BatchSearch

Represents a single batch search operation

| Property | Type | Description |
|---|---|---|
| `id` | string | ID of the batch search |
| `name` | string | Name of the batch report |
| `createdBy` | string | Email of the user who created the batch search |
| `created` | string | Timestamp when the batch search was created |
| `lastModified` | string | Timestamp when the batch search was created |
| `status` | string | Status of the batch search |
| `error` | ErrorResponse |  |

### ErrorResponse

Standard format for API error responses.

| Property | Type | Description |
|---|---|---|
| `title` | string |  |
| `status` | string |  |
| `detail` | string |  |
| `instance` | string |  |

### Id

Common ID format.

| Property | Type | Description |
|---|---|---|
| `id` | string | Unique identifier of this specific resource. |

### NoneSignature

No sinature configuration properties are required when the no signature is used.

### NoneSignatureValue

No properties are required when the no signature is included.

### HmacSignature

Basic signature utilizing a shared key.

| Property | Type | Description |
|---|---|---|
| `key` | string | HMAC key for authentication |
| `algorithm` | string | HMAC algorithm for authentication |

### HmacSignatureValue

| Property | Type | Description |
|---|---|---|
| `algorithm` | string | The algorithm used to create the signature. |
| `value` | string | Signature of the message. |

### Signature

| Property | Type | Description |
|---|---|---|
| `signature` | object |  |

### SignatureValue

| Property | Type | Description |
|---|---|---|
| `signature` | object |  |

### EventId

### EventPayload

### SubscriptionCommon

| Property | Type | Description |
|---|---|---|
| `description` | string | Description of the subscription |
| `notificationUrl` | string | The URL of the webhook endpoint to which event messages will be delivered |

### EventSubscription

### SubscriptionDetail

### SubscriptionRegistration

### WebhookInvocation

### EventMessage

### Pagination

| Property | Type | Description |
|---|---|---|
| `recordsetCount` | integer | The total count of records in the dataset. |
| `@nextLink` | string | The URL to the next page of results. |

### SubscriptionListResponse

### SuccessResponse

| Property | Type | Description |
|---|---|---|
| `id` | string | Unique identifier for the new or updated entity. |
| `message` | string | Success message |

### WebhooksErrorResponse

| Property | Type | Description |
|---|---|---|
| `error` | WebhooksErrorInfo |  |

### WebhooksErrorInfo

Information about the error encountered

| Property | Type | Description |
|---|---|---|
| `title` | string | An identifying name for the error. |
| `status` | string | A conanoical error status. |
| `detail` | string | A detailed description of the error type. |
| `instance` | string | A detailed description of the specific error ocurrance. |

### TradingPartner

Represents a participant in the Avalara directory.

| Property | Type | Description |
|---|---|---|
| `id` | string | Avalara unique ID of the participant in the directory. |
| `name` | string | Name of the participant (typically, the name of the business entity). |
| `network` | string | The network where the participant is present. When creating or updating a trading partner, the value provided for the attribute 'network' will be ignored. |
| `registrationDate` | string | Registration date of the participant if available. |
| `identifiers` | array | A list of identifiers associated with the trading partner. Each identifier should consistently include the fields name, and value to maintain clarity and ensure consistent structure across entries. When creating or updating a trading partner, the attribute 'name' must be agreed upon with Avalara to ensure consistency. Failing to adhere to the agreed values will result in a validation error. Further, when creating or updating a trading partner, the value provided for the attribute 'displayName' will be ignored and instead retrieved from the standard set of display names maintained. |
| `addresses` | array |  |
| `supportedDocumentTypes` | array | A list of document types supported by the trading partner for exchange. Each document type identifier value must match the standard list maintained by Avalara, which includes Peppol and other public network document type identifier schemes and values, as well as any approved partner-specific identifiers. The 'value' field must exactly match an entry from the provided document identifier list. Any attempt to submit unsupported document types will result in a validation error. Further, when creating or updating a trading partner, the value provided for the attributes 'name' and 'supportedByAvalara' will be ignored. |
| `consents` | Consents |  |
| `extensions` | array | Optional array used to carry additional metadata or configuration values that may be required by specific networks. When creating or updating a trading partner, the keys provided in the 'extensions' attribute must be selected from a predefined list of supported extensions. Using any unsupported keys will result in a validation error. |

### Identifier

| Property | Type | Description |
|---|---|---|
| `name` | string | Identifier name (e.g., Peppol Participant ID). |
| `displayName` | string | Display name of the identifier. |
| `value` | string | Value of the identifier. |
| `extensions` | array | Optional array used to carry additional metadata or configuration values for the identifier. |

### Address

| Property | Type | Description |
|---|---|---|
| `line1` | string | Address line 1 |
| `line2` | string | Address line 2 |
| `city` | string | City |
| `state` | string | State |
| `country` | string | Country (ISO 3166) |
| `postalCode` | string | Postal code |

### SupportedDocumentTypes

| Property | Type | Description |
|---|---|---|
| `name` | string | Document type name. |
| `value` | string | Document type value. |
| `supportedByTradingPartner` | boolean | Does trading partner support receiving this document type. |
| `supportedByAvalara` | boolean | Does avalara support exchanging this document type. |
| `extensions` | array | Optional array used to carry additional metadata or configuration values that may be required by specific document types. When creating or updating a trading partner, the keys provided in the 'extensions' attribute must be selected from a predefined list of supported extensions. Using any unsupported keys will result in a validation error. |

### Consents

| Property | Type | Description |
|---|---|---|
| `listInAvalaraDirectory` | boolean | Indicates whether the trading partner consents to being listed in the directory. If not provided in the payload, its value will default to true. |

### Extension

| Property | Type | Description |
|---|---|---|
| `key` | string | Name of the custom attribute. |
| `values` | array | Array of string values associated with the custom attribute. |

### BatchErrorDetail

Represents detailed error information for an individual entry in a batch request. Includes the index of the failed item and associated validation errors.

| Property | Type | Description |
|---|---|---|
| `index` | integer | The index of the request that caused the error in the batch. |
| `validationErrors` | array |  |

### ValidationError

Represents a specific validation failure within a request.

| Property | Type | Description |
|---|---|---|
| `field` | string | The name of the field that failed validation. |
| `message` | string | A human-readable explanation of the error for the specific field. |

### TaxIdentifierRequest

Represents a request to validate company’s tax identifier.

| Property | Type | Description |
|---|---|---|
| `countryCode` | string | The two-letter ISO-3166 country code of the tax identifier. |
| `identifierType` | string | Type of the identifier. |
| `identifier` | string | The tax identifier of the company. |
| `extensions` | object | Optional field for adding additional details required by specific tax authorities. Refer to the GET /tax-identifiers/schema API endpoint for the full request structure for a given country. |

### TaxIdentifierResponse

Represents the response for a tax identifier validation request.

| Property | Type | Description |
|---|---|---|
| `countryCode` | string | The two-letter ISO-3166 country code of the tax identifier. |
| `value` | object |  |
