# Document submission in ELR

Source: https://developer.avalara.com/products/e-invoicing/integration-guides/elr/ico9970909753970/

Guide: E-Invoicing and Live Reporting

# Document submission in ELR

Understand how document submission works in ELR, including required request objects and response behavior.

Sending a document to this endpoint creates a document in the format required by the country mandate and triggers the workflow to transmit the document to the authority, if required, or to the end customer.

This form-data request requires the following part objects.

Key

Description

metadata

The metadata instructs the E-Invoicing and Live Reporting (ELR) service how to process the data (invoice) provided. You can call and optionally filter the [Get mandates](/elr/getmandates_1/) endpoint to retrieve all available `countryMandate` details and values to populate the properties in this metadata object.

data

The data object contains the details of the invoice in the `dataFormat` and `dataFormatVersion` schema. Currently, UBL 2.1 is the only supported data input schema. Each `countryMandate` has different required or conditional fields. You can filter the **Admin and Utilities > Get data input fields by mandate** endpoint to retrieve the required fields and links to their descriptions for a given `countryMandate`.

Attention

If there is a structural or validation error in the metadata object, the response returns an error that explains what must be corrected. To check for issues in the posted XML file, use **Get document status**.

This collection includes saved examples for all `countryMandate` supported at the time of publishing, and error code examples.

Note

The data object in this request and its saved examples contain the environment variables `{{documentNumber}}` and `{{documentDate}}`. The prerequest script recalculates and sets these values so that you don’t create duplicate invoice numbers or invalid dates.

## Response

The response includes a unique `id` that you can use to request document status and confirm whether the document was accepted or rejected.

You can also use the `id` to download a copy of the document.