# Avalara E-Invoicing API

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

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

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

---

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