# Avalara E-Invoicing and Live Reporting — API Reference

Avalara E-Invoicing and Live Reporting (ELR) helps you automate compliance with global e-invoicing and real-time reporting mandates. Use a single API to handle country-specific formats, validations, and submission requirements.

Source: https://developer.avalara.com/products/e-invoicing/api/
**Total endpoints:** 97 across 7 APIs

---

## Avalara E-Invoicing API

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

**Version:** 1.6
**Base URL:** https://api.sbx.avalara.com/einvoicing
**Endpoints:** 23

### 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.6"). |
| `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.6"). |
| `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.6"). |
| `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.6"). |
| `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.6"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |


#### Code Lists

##### Returns a list of code lists for a specific country

`GET /codelists`

Get a list of code lists on the Avalara E-Invoicing platform for the specified country. By default, the API returns only non-expired code lists (code lists where the sunset date has not passed). To retrieve expired code lists or filter by specific date ranges, use the effectiveDate and sunsetDate query parameters.A Code List is a controlled set of predefined, standardized values used to populate specific fields in electronic documents (such as e-invoices). Each code has a stable, machine-readable identifier and a human-readable description. Code Lists are typically based on global standards (e.g., UN/CEFACT, ISO, EN16931) and may include jurisdiction-specific extensions or restrictions.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.6"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `countryCode` | string | query | Yes | Two-letter ISO 3166-1 alpha-2 country code indicating the jurisdiction for which code lists should be returned. |
| `effectiveDate` | string | query | No | Filter code lists by effective date. Returns code lists that are effective on or before this date. Format: YYYY-MM-DD (ISO 8601). If not specified, defaults to the current date. sunsetDate is required when effectiveDate is provided. |
| `sunsetDate` | string | query | No | Filter code lists by sunset date. Returns code lists that have not yet sunset on or before this date. Format: YYYY-MM-DD (ISO 8601). If not specified, only non-expired code lists are returned. |
| `$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. |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |

##### Retrieves a code list by ID for a specific country

`GET /codelists/{codelistId}`

A Code List is a controlled set of predefined, standardized values used to populate specific fields in electronic documents (such as e-invoices). Each code has a stable, machine-readable identifier and a human-readable description. Code Lists are typically based on global standards (e.g., UN/CEFACT, ISO, EN16931) and may include jurisdiction-specific extensions or restrictions.Code Lists are versioned, and each version may have defined effective and sunset dates to ensure that the correct set of allowable values is applied according to regulatory or jurisdictional requirements.By default, the API returns only non-expired code list versions (versions where the sunset date has not passed). To retrieve expired versions or filter by specific date ranges, use the effectiveDate and sunsetDate query parameters.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.6"). |
| `X-Avalara-Client` | string | header | No | Optional header for a client identifier string used for diagnostics (for example "Fingerprint"). |
| `codelistId` | string | path | Yes | System-generated unique identifier of the code list definition. Typically a UUID used to reference this code list internally or via APIs. |
| `countryCode` | string | query | Yes | Two-letter ISO 3166-1 alpha-2 country code indicating the jurisdiction this code list applies to. |
| `effectiveDate` | string | query | No | Filter code list versions by effective date. Returns versions that are effective on or before this date. Format: YYYY-MM-DD (ISO 8601). If not specified, defaults to the current date. sunsetDate is required when effectiveDate is provided. |
| `sunsetDate` | string | query | No | Filter code list versions by sunset date. Returns versions that have not yet sunset on or before this date. Format: YYYY-MM-DD (ISO 8601). If not specified, only non-expired versions are returned. |


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


#### Reports

##### Returns a list of reports

`GET /reports`

Retrieves all reports with optional filtering, paging, and sorting. Results are filtered by tenant. Supports OData-style filtering using the $filter parameter. Use $top and $skip for paging; when more results exist, the response includes @nextLink to fetch the next page. Default sort order is by report generation date (descending).

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.6"). |
| `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"). |
| `$filter` | string | query | No | OData-style filter expression. Supports operators: eq, ne, gt, ge, lt, le, like, ilike, contains. Examples: status eq 'COMPLETED', reportGenerateDate gt '2025-11-01', transactionIds contains 'TXN-2025-001' |
| `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. |
| `$orderby` | string | query | No | OData-style orderby expression. Format: 'field asc' or 'field desc'. Default: reportGenerateDate desc |

##### Retrieves a report by its unique ID

`GET /reports/{reportId}/status`

Retrieves a specific report by its unique identifier. Returns complete report details including metadata, status, and associated information.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.6"). |
| `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"). |
| `reportId` |  | path | Yes | The unique ID for this report as returned in a GET /reports response. |

##### Returns a pre-signed download URL for a report

`GET /reports/{reportId}/$download`

Returns a pre-signed URL to download the report file when it is available. If the report has not yet been generated, a 404 (not found) is returned.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | Header that specifies the API version to use (for example "1.6"). |
| `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"). |
| `reportId` |  | path | Yes | The unique ID for this report as returned in a GET /reports response. |

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

#### reportId

The unique ID for this report as returned in a GET /reports response. 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. |
| `businessStatus` | string | Represents the document's business lifecycle state based on responses from external actors (Tax Authority, PDP, or ERP), such as acceptance, rejection, or validation. |
| `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 |
| `businessStatus` | string | Represents the document's business lifecycle state based on responses from external actors (Tax Authority, PDP, or ERP), such as acceptance, rejection, or validation. |
| `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 |

#### CodeListResponse

Returns a code list definition for a specific country

| Property | Type | Description |
|---|---|---|
| `countryCode` | string | Two-letter ISO 3166-1 alpha-2 country code indicating the jurisdiction this code list applies to. |
| `codeListId` | string | System-generated unique identifier of the code list definition. Typically a UUID used to reference this code list internally or via APIs. |
| `codeListName` | string | Human-readable name of the code list, usually describing what the codes represent (for example, document types, tax categories, currencies). |
| `description` | string | Textual description of the code list, including what it is used for and whether it represents a global standard (e.g., UN/CEFACT, ISO, EN16931) or a jurisdiction-specific/local extension of that standard. |
| `standard` | string | Identifier of the underlying standard or authoritative source for this code list. This may be a formal code list name (e.g., UNCL1001), a standard reference (e.g., EN16931), or an internal standard identifier. |
| `versions` | array | Array of versioned definitions of this code list for the given jurisdiction. Each entry represents a version that is valid for a specific effective/sunset date range, optionally per locale. |

#### CodeListVersion

Represents a versioned definition of a code list for a specific jurisdiction and date range

| Property | Type | Description |
|---|---|---|
| `versionReasons` | array | List of free-text reasons explaining why this version of the code list exists (for example, initial introduction, regulatory update, addition/deprecation of codes). Useful for audit and change tracking. |
| `jurisEffectiveDate` | string | Date from which this version of the code list becomes legally or operationally effective in the jurisdiction. Typically corresponds to a go-live, mandate, or release date. |
| `jurisSunsetDate` | string | Date after which this version of the code list must no longer be used in the jurisdiction. Use a far-future date (e.g., 9999-12-31) when the sunset is not yet known. |
| `locale` | string | Language–region locale identifier indicating the language and regional variant for descriptions in this version of the code list. Follows BCP-47 format such as en-US, fr-FR, de-DE. |
| `values` | array | Array of code entries defined in this version of the code list. Each entry contains the machine-readable code value and its human-readable description in the given locale. |

#### CodeListValue

Represents a single code entry in a code list version

| Property | Type | Description |
|---|---|---|
| `code` | string | The actual code value used in documents or systems. This is typically what appears in the e-invoice payload, such as a numeric or alphanumeric code from the official code list. |
| `value` | string | Human-readable label or name for the code, localized according to the locale field of the version. |
| `description` | string | Detailed explanation of what the code represents, localized according to the locale field of the version. |

#### CodeListListResponse

Returns the requested list of code lists

| Property | Type | Description |
|---|---|---|
| `@recordsetCount` | string | Count of code lists for the given query parameters |
| `@nextLink` | string |  |
| `value` | array | Array of code lists matching query parameters |

#### CodeListSummary

Displays a summary of information about a code list

| Property | Type | Description |
|---|---|---|
| `countryCode` | string | Two-letter ISO 3166-1 alpha-2 country code indicating the jurisdiction this code list applies to. |
| `codeListId` | string | System-generated unique identifier of the code list definition. Typically a UUID used to reference this code list internally or via APIs. |
| `codeListName` | string | Human-readable name of the code list, usually describing what the codes represent (for example, document types, tax categories, currencies). |
| `description` | string | Textual description of the code list, including what it is used for and whether it represents a global standard (e.g., UN/CEFACT, ISO, EN16931) or a jurisdiction-specific/local extension of that standard. |
| `standard` | string | Identifier of the underlying standard or authoritative source for this code list. This may be a formal code list name (e.g., UNCL1001), a standard reference (e.g., EN16931), or an internal standard identifier. |
| `versions` | array | Array of versioned definitions of this code list for the given jurisdiction. Each entry represents a version that is valid for a specific effective/sunset date range, optionally per locale. |

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

#### ReportItem

Represents a single report with full details including metadata and associated transaction IDs.

| Property | Type | Description |
|---|---|---|
| `reportId` | string | The unique ID for this report. |
| `jobId` | string | The unique ID of the job that generated this report. |
| `reportGenerateDate` | string | The date and time when the report was generated. |
| `reportFrom` | string | The start date of the reporting period. |
| `reportTo` | string | The end date of the reporting period. |
| `countryCode` | string | The two-letter ISO-3166 country code for which this report was generated. |
| `countryMandate` | string | The e-invoicing mandate for the specified country. |
| `documentType` | string | The type of document covered by this report. |
| `documentSubType` | string | The sub-type of the document. |
| `reportReference` | string | An internal reference path for the report. |
| `reportName` | string | The name of the report file. |
| `status` | string | The current status of the report. Possible values include: PENDING, PROCESSING, COMPLETED, FAILED, SENT_TO_PPF, ERROR. |
| `reportFormatMimetypes` | string | The MIME type of the report file. |
| `tenantId` | string | The tenant identifier associated with this report. |
| `taName` | string | The name of the tax authority for this report. |
| `taxInvoiceAmount` | number | The total invoice amount covered by this report. |
| `totalTaxAmount` | number | The total tax amount covered by this report. |
| `metadata` | object | Additional report metadata (free-form JSON). Contents vary by country mandate. |
| `transactionIds` | array | List of transaction IDs associated with this report. |

#### ReportListResponse

Returns the requested list of reports matching the query parameters.

| Property | Type | Description |
|---|---|---|
| `@recordsetCount` | string | Count of reports matching the filter for the given query. Present when the request includes $count=true. |
| `@nextLink` | string | URL to retrieve the next page of results when more items match the query. Omitted or null when there is no next page. |
| `value` | array | Array of reports matching the query parameters. |

#### ReportDownloadResponse

Returns a pre-signed URL to download the report file.

| Property | Type | Description |
|---|---|---|
| `reportId` | string | The unique identifier of the report. |
| `downloadUrl` | string | A pre-signed URL to download the report file. This URL is time-limited. |


---

## Avalara E-Invoicing API

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

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

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


---

## Avalara E-Invoicing API

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

**Version:** 1.4
**Base URL:** https://api.sbx.avalara.com/einvoicing
**Endpoints:** 18

### Endpoints

#### Documents

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

`GET /documents`

Get a list of documents on the Avalara E-Invoicing platform that have a processing date within the specified date range.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `startDate` | string | query | No | Start date of documents to return. This defaults to the previous month. |
| `endDate` | string | query | No | End date of documents to return. This defaults to the current date. |
| `flow` | string | query | No | Optionally filter by document direction, where issued = `out` and received = `in` |
| `$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 |
| `$filter` | string | query | No | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |

##### Returns a copy of the document

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

When the document is available, use this endpoint to download it as text, XML, or PDF. The output format needs to be specified in the Accept header, and it will vary depending on the mandate. If the file has not yet been created, then status code 404 (not found) is returned.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `Accept` | string | header | Yes | This header indicates the MIME type of the document |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `documentId` |  | path | Yes | The unique ID for this document that was returned in the POST /einvoicing/document response body |

##### Checks the status of a document

`GET /documents/{documentId}/status`

Using the unique ID from POST /einvoicing/documents response body, request the current status of a document.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `documentId` |  | path | Yes | The unique ID for this document that was returned in the POST /einvoicing/documents response body |

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

`POST /documents/$fetch`

This API allows you to retrieve an inbound document. Pass key-value pairs as parameters in the request, such as the confirmation number, supplier number, and buyer VAT number.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |


#### Data Input Fields

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

`GET /data-input-fields`

This endpoint provides a list of required, conditional, and optional fields for each country mandate. You can use the mandates endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a 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. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 |


#### 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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a 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. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `mandateId` | string | path | Yes | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body |
| `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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "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 / OR operators. Search is performed only over the name and identifier value fields. For more information, refer to [Query options overview - OData.](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search). |
| `$filter` | string | query | No | Filters the results using the eq operator. Supported fields: network, country, documentType, idType. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 1 MB request payload. The batch is processed atomically and partial success is not allowed.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |
| `id` | string | path | Yes | The ID of the trading partner which is being updated. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |
| `id` | string | path | Yes | The ID of the trading partner which is being deleted. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `$filter` | string | query | No | Filters the results by field name. Only the eq operator and the name field is supported. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). |
| `count` | boolean | query | No | When set to true, returns the total count of matching records included as @recordSetCount in the response body. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "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 | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `id` | string | path | Yes | The ID of the batch search that was submitted earlier. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `id` | string | path | Yes | The ID of the batch search for which the report should be downloaded. |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |


#### Interop

##### Submit a document

`POST /interop/documents`

This API used by the interoperability partners to submit a document to  their trading partners in Avalara on behalf of their customers.

**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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint" |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |


#### Subscriptions

##### List all subscriptions

`GET /webhooks/subscriptions`

Retrieve a list of all 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 subscription to events exposed by registered systems.

**Parameters:**

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

##### Get details of a subscription

`GET /webhooks/subscriptions/{subscription-id}`

Retrieve details of a specific subscription.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `subscription-id` | string | path | Yes |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |

##### Unsubscribe from events

`DELETE /webhooks/subscriptions/{subscription-id}`

Remove a subscription from the webhooks dispatch service. All events and subscriptions are also deleted.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `subscription-id` | string | path | Yes |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |


#### Tax Identifiers

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

`GET /tax-identifiers/schema`

This endpoint retrieves the request and response schema required to validate tax identifiers based on a specific country's requirements. This can include both standard fields and any additional parameters required by the respective country's tax authority.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |
| `countryCode` | string | query | Yes | The two-letter ISO-3166 country code for which the schema should be retrieved. |
| `type` | string | query | No | Specifies whether to return the request or response 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |

### 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 | Status of the document |
| `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 |

#### StatusEvent

Displays when a status event occurred

| Property | Type | Description |
|---|---|---|
| `eventDateTime` | string | The date and time when the status event occured, 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. |

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

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

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

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


---

## Avalara E-Invoicing API

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

**Version:** 1.3
**Base URL:** https://api.sbx.avalara.com/einvoicing
**Endpoints:** 14

### Endpoints

#### Documents

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

`GET /documents`

Get a list of documents on the Avalara E-Invoicing platform that have a processing date within the specified date range.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `startDate` | string | query | No | Start date of documents to return. This defaults to the previous month. |
| `endDate` | string | query | No | End date of documents to return. This defaults to the current date. |
| `flow` | string | query | No | Optionally filter by document direction, where issued = `out` and received = `in` |
| `$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 |
| `$filter` | string | query | No | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |

##### Returns a copy of the document

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

When the document is available, use this endpoint to download it as text, XML, or PDF. The output format needs to be specified in the Accept header, and it will vary depending on the mandate. If the file has not yet been created, then status code 404 (not found) is returned.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `Accept` | string | header | Yes | This header indicates the MIME type of the document |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `documentId` |  | path | Yes | The unique ID for this document that was returned in the POST /einvoicing/document response body |

##### Checks the status of a document

`GET /documents/{documentId}/status`

Using the unique ID from POST /einvoicing/documents response body, request the current status of a document.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `documentId` |  | path | Yes | The unique ID for this document that was returned in the POST /einvoicing/documents response body |

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

`POST /documents/$fetch`

This API allows you to retrieve an inbound document. Pass key-value pairs as parameters in the request, such as the confirmation number, supplier number, and buyer VAT number.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |


#### Data Input Fields

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

`GET /data-input-fields`

This endpoint provides a list of required, conditional, and optional fields for each country mandate. You can use the mandates endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a 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. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 |


#### 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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a 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. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `mandateId` | string | path | Yes | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body |
| `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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "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 / OR operators. Search is performed only over the name and identifier value fields. For more information, refer to [Query options overview - OData.](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search). |
| `$filter` | string | query | No | Filters the results using the eq operator. Supported fields: network, country, documentType, idType. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `$filter` | string | query | No | Filters the results by field name. Only the eq operator and the name field is supported. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). |
| `count` | boolean | query | No | When set to true, returns the total count of matching records included as @recordSetCount in the response body. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "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 | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `id` | string | path | Yes | The ID of the batch search that was submitted earlier. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `id` | string | path | Yes | The ID of the batch search for which the report should be downloaded. |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |


#### Interop

##### Submit a document

`POST /interop/documents`

This API used by the interoperability partners to submit a document to  their trading partners in Avalara on behalf of their customers.

**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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint" |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |


#### Subscriptions

##### List all subscriptions

`GET /webhooks/subscriptions`

Retrieve a list of all 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 subscription to events exposed by registered systems.

**Parameters:**

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

##### Get details of a subscription

`GET /webhooks/subscriptions/{subscription-id}`

Retrieve details of a specific subscription.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `subscription-id` | string | path | Yes |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |

##### Unsubscribe from events

`DELETE /webhooks/subscriptions/{subscription-id}`

Remove a subscription from the webhooks dispatch service. All events and subscriptions are also deleted.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `subscription-id` | string | path | Yes |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |
| `undefined` |  |  | No |  |

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

An object of the inbound document

| 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 | Status of the document |
| `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 |

#### StatusEvent

Displays when a status event occurred

| Property | Type | Description |
|---|---|---|
| `eventDateTime` | string | The date and time when the status event occured, 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. |

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

Response model providing a list of input fields required, optional, or conditional for different country mandates.

| 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

Mandates for which this field is required

| 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

An object representing the country 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 |

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

#### DirectorySearchResponse

Response schema for directory search results

| Property | Type | Description |
|---|---|---|
| `@recordSetCount` | integer | The count of records in the result set |
| `@nextLink` | string | The next page link to get the next set of results. |
| `value` | array |  |

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

Contains the HMAC algorithm and the resulting signature value used for verifying message integrity.

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

#### Signature

Defines the signature configuration, specifying whether and how messages are signed for webhook delivery.

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

#### SignatureValue

Includes the actual signature applied to a webhook message along with the algorithm used.

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

#### EventId

#### EventPayload

#### SubscriptionCommon

Basic configuration for a webhook subscription, including description and target notification URL.

| 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

Pagination information for the dataset.

| 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

Indicates a successful outcome of an API operation, including a generated ID and success message.

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

#### WebhooksErrorResponse

Wrapper for errors occurring during webhook subscription or delivery processing.

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


---

## Avalara E-Invoicing API

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

**Version:** 1.2
**Base URL:** https://api.sbx.avalara.com/einvoicing
**Endpoints:** 12

### Endpoints

#### Documents

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

`GET /documents`

Get a list of documents on the Avalara E-Invoicing platform that have a processing date within the specified date range.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `startDate` | string | query | No | Start date of documents to return. This defaults to the previous month. |
| `endDate` | string | query | No | End date of documents to return. This defaults to the current date. |
| `flow` | string | query | No | Optionally filter by document direction, where issued = `out` and received = `in` |
| `$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 |
| `$filter` | string | query | No | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |

##### Returns a copy of the document

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

When the document is available, use this endpoint to download it as text, XML, or PDF. The output format needs to be specified in the Accept header, and it will vary depending on the mandate. If the file has not yet been created, then status code 404 (not found) is returned.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `Accept` | string | header | Yes | This header indicates the MIME type of the document |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `documentId` |  | path | Yes | The unique ID for this document that was returned in the POST /einvoicing/document response body |

##### Checks the status of a document

`GET /documents/{documentId}/status`

Using the unique ID from POST /einvoicing/documents response body, request the current status of a document.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `documentId` |  | path | Yes | The unique ID for this document that was returned in the POST /einvoicing/documents response body |

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

`POST /documents/$fetch`

This API allows you to retrieve an inbound document. Pass key-value pairs as parameters in the request, such as the confirmation number, supplier number, and buyer VAT number.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |


#### Data Input Fields

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

`GET /data-input-fields`

This endpoint provides a list of required, conditional, and optional fields for each country mandate. You can use the mandates endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a 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. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 |


#### 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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a 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. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `mandateId` | string | path | Yes | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body |
| `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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "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 / OR operators. Search is performed only over the name and identifier value fields. For more information, refer to [Query options overview - OData.](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search). |
| `$filter` | string | query | No | Filters the results using the eq operator. Supported fields: network, country, documentType, idType. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `$filter` | string | query | No | Filters the results by field name. Only the eq operator and the name field is supported. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). |
| `count` | boolean | query | No | When set to true, returns the total count of matching records included as @recordSetCount in the response body. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "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 | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `id` | string | path | Yes | The ID of the batch search that was submitted earlier. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used. |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint". |
| `id` | string | path | Yes | The ID of the batch search for which the report should be downloaded. |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |


#### Interop

##### Submit a document

`POST /interop/documents`

This API used by the interoperability partners to submit a document to  their trading partners in Avalara on behalf of their customers.

**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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint" |
| `X-Correlation-ID` | string | header | No | The caller can use this as an identifier to use as a correlation id to trace the call. |

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

An object of the inbound document

| 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 | Status of the document |
| `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 |

#### StatusEvent

Displays when a status event occurred

| Property | Type | Description |
|---|---|---|
| `eventDateTime` | string | The date and time when the status event occured, 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. |

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

Response model providing a list of input fields required, optional, or conditional for different country mandates.

| 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

Mandates for which this field is required

| 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

An object representing the country 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 |
| `workflowIds` | array | Workflow ID list |

#### inputDataFormats

Format and version used when inputting the data

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

#### InputDataFormatVersions

Document format version

#### WorkflowIds

Workflow ID list

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

#### DirectorySearchResponse

Response schema for directory search results

| Property | Type | Description |
|---|---|---|
| `@recordSetCount` | integer | The count of records in the result set |
| `@nextLink` | string | The next page link to get the next set of results. |
| `value` | array |  |

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

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


---

## Avalara E-Invoicing API

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

**Version:** 1.1
**Base URL:** https://api.sbx.avalara.com/einvoicing
**Endpoints:** 7

### Endpoints

#### Documents

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

`GET /documents`

Get a list of documents on the Avalara E-Invoicing platform that have a processing date within the specified date range.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `startDate` | string | query | No | Start date of documents to return. This defaults to the previous month. |
| `endDate` | string | query | No | End date of documents to return. This defaults to the current date. |
| `flow` | string | query | No | Optionally filter by document direction, where issued = `out` and received = `in` |
| `$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 |
| `$filter` | string | query | No | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |

##### 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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |

##### Returns a copy of the document

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

When the document is available, use this endpoint to download it as text, XML, or PDF. The output format needs to be specified in the Accept header, and it will vary depending on the mandate. If the file has not yet been created, then status code 404 (not found) is returned.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `Accept` | string | header | Yes | This header indicates the MIME type of the document |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `documentId` |  | path | Yes | The unique ID for this document that was returned in the POST /einvoicing/document response body |

##### Checks the status of a document

`GET /documents/{documentId}/status`

Using the unique ID from POST /einvoicing/documents response body, request the current status of a document.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `documentId` |  | path | Yes | The unique ID for this document that was returned in the POST /einvoicing/documents response body |

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

`POST /documents/$fetch`

This API allows you to retrieve an inbound document. Pass key-value pairs as parameters in the request, such as the confirmation number, supplier number, and buyer VAT number.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |


#### Data Input Fields

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

`GET /data-input-fields`

This endpoint provides a list of required, conditional, and optional fields for each country mandate. You can use the mandates endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a 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. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 |


#### 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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a 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. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. |
| `mandateId` | string | path | Yes | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body |
| `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) |

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

An object of the inbound document

| 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 | Status of the document |
| `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 |

#### StatusEvent

Displays when a status event occurred

| Property | Type | Description |
|---|---|---|
| `eventDateTime` | string | The date and time when the status event occured, 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. |

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

Response model providing a list of input fields required, optional, or conditional for different country mandates.

| 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

Mandates for which this field is required

| 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

An object representing the country 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 |
| `workflowIds` | array | Workflow ID list |

#### inputDataFormats

Format and version used when inputting the data

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

#### InputDataFormatVersions

Document format version

#### WorkflowIds

Workflow ID list

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


---

## Avalara E-Invoicing API

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

  The ELR Postman collection is available here: [ELR Postman collection](https://documenter.getpostman.com/view/28852752/2s9YC7RW73).

**Version:** 1.0
**Base URL:** https://api.sbx.avalara.com/einvoicing
**Endpoints:** 5

### Endpoints

#### Documents

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

`GET /documents`

Get a list of documents on the Avalara E-Invoicing platform that have a processing date within the specified date range.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint" |
| `startDate` | string | query | No | Start date of documents to return. This defaults to the previous month. |
| `endDate` | string | query | No | End date of documents to return. This defaults to the current date. |
| `flow` | string | query | No | Optionally filter by document direction, where issued = `out` and received = `in` |
| `$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 |
| `$filter` | string | query | No | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |

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

`POST /documents`

For both e-invoices and credit notes, when a document is sent to this endpoint, it generates an invoice or credit note 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 e-invoice or credit note for reference purposes.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint" |

##### Returns a copy of the document

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

When the document is available, use this endpoint to download it as text, XML, or PDF. The output format needs to be specified in the Accept header and it will vary depending on the mandate. If the file has not yet been created, then status code 404 (not found) is returned.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `Accept` | string | header | Yes | This header indicates the MIME type of the document |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint" |
| `documentId` |  | path | Yes | The unique ID for this document that was returned in the POST /einvoicing/document response body |

##### Checks the status of a document

`GET /documents/{documentId}/status`

Using the unique ID from POST /einvoicing/documents response body, request the current status of a document.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "Fingerprint" |
| `documentId` |  | path | Yes | The unique ID for this document that was returned in the POST /einvoicing/documents response body |


#### Data Input Fields

##### Returns the mandatory and conditional invoice or creditnote input fields for different country mandates

`GET /data-input-fields`

This endpoint provides a list of required, conditional, and optional fields for each country mandate. You can use the mandates endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` | string | header | Yes | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "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. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 |


#### 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 | The HTTP Header meant to specify the version of the API intended to be used |
| `X-Avalara-Client` | string | header | No | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a "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. |
| `$top` | string | query | No | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | string | query | No | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. |
| `$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 |

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

#### 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 | Status of the transaction:  'Pending'  'Failed'  'Complete' |
| `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 invoices 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 transaction status:  'Pending'  'Failed'  'Complete' |
| `supplierName` | string | The name of the supplier in the transaction |
| `customerName` | string | The name of the customer in the transaction |
| `documentNumber` | string | The invoice document number |
| `documentDate` | string | The invoice issue date |
| `flow` | string | The invoice direction, where issued = `out` and received = `in` |
| `countryCode` | string | The two-letter ISO-3166 country code for the country where the e-invoice is being submitted |
| `countryMandate` | string | The e-invoicing mandate for the specified country |
| `interface` | string | The interface where the invoice data is sent |
| `receiver` | string | The invoice recipient based on the interface |

#### StatusEvent

Displays when a status event occurred

| Property | Type | Description |
|---|---|---|
| `eventDateTime` | string | The date and time when the status event occured, 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. |

#### SubmitDocument

Allows submission of a document.

| Property | Type | Description |
|---|---|---|
| `metadata` | object | Key value pairs of metadata for a document submission. dataFormat can be ubl-invoice or ubl-creditnote:  {  "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

Response model providing a list of input fields required, optional, or conditional for different country mandates.

| 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

Mandates for which this field is required

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

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

An object representing the country mandate

| Property | Type | Description |
|---|---|---|
| `mandateId` | string | Mandate UUID |
| `countryMandate` | string | The `countryMandate` is comprised of the country code, mandate type, and the network or regulation type (for example, PT-B2C-PDF). Keep in mind the following when specifying a `countryMandate`.
- A country can have multiple mandate types (B2C, B2B, B2G).
- A entity/company can opt in for multiple mandates.
- A `countryMandate` is the combination of country + mandate type + network/regulation. |
| `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 |
| `workflowIds` | array | Workflow ID list |

#### InputDataFormats

Format and version used when inputting the data

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

#### InputDataFormatVersions

Invoice format version

#### WorkflowIds

Workflow ID list

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