# Download the document

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

Guide: E-Invoicing and Live Reporting

# Download the document

Download documents and available formats from ELR.

**Endpoint**: `GET /einvoicing/documents/:id/$download`

Download a document. For details, see [DownloadDocument](https://developer.avalara.com/api-reference/e-invoicing/v1.6/methods/Documents/DownloadDocument/).

When a document is available (status is **Complete**), you can download it in one or more media types (for example, application/xml or application/pdf). Specify the desired MIME type in the `Accept` header.

The available formats depend on the mandate. Use the [GetMandates](https://developer.avalara.com/api-reference/e-invoicing/v1.6/methods/Mandates/GetMandates/) endpoint to retrieve the supported MIME types for each `countryMandate`.

For every `countryMandate`, the `application/vnd.oasis.ubl+xml` format (UBL) is available:

-   For outbound documents, this is the document submitted to ELR.
-   For inbound documents, this is the converted document returned by ELR.

If you pass an invalid `Accept` header value, the API returns a 406 error with a message that describes the supported values.

If the file isn’t yet available, the API returns a 404 Not Found response.

**Headers**

Name

Description

**Accept**

Specify the media type to download. Examples: `application/xml`, `application/pdf`, `application/vnd.oasis.ubl+xml`.

**avalara-version**

Specifies the version of the API to use.

**X-Avalara-Client**

Provided by Avalara.

**Path parameter**

Name

Description

`id`

(Required) The document ID.

## Example request

```
curl --location '/einvoicing/documents/73996704-77a3-4934-ac6d-900007b550af/$download' \
--header 'Accept: application/vnd.oasis.ubl+xml' \
--header 'avalara-version: 1.5' \
--header 'X-Avalara-Client: ProvidedToYouByAvalara'
```

## Example response

**Response body**

```

 urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 PEPPOL-1234-credit 2025-09-10 381 Please note we have a new phone number: 22 22 22 22 EUR 4025:123:4343 0150abc   PEPPOL-EU-1234     GB987123654  987654321   Avalara Europe Ltd.   Lancaster House, Trafalgar Pl 1st Floor Brighton BN1 4FU  GB    GB1232434  VAT    Avalara Europe Ltd. GB987654321      AVALARATEST  BuyerTradingName AS   Hovedgatan 32 Po box 878 Stockholm 456 34  SE    SE4598375937  VAT    Buyer Official Name 39937423947   Lisa Johnson 23434234 lj@buyer.se     2023-01-30  9483759475923478  Delivery street 2 Building 56 Stockholm 21234  SE      Delivery party Name     30 Snippet1  IBAN32423940 AccountName  BIC324098     Payment within 10 days, 2% discount   true Insurance 25  S 25.0  VAT     331.25  1325 331.25  S 25.0  VAT      1300 1325 1656.25 25 1656.25   1 7 2800 Konteringsstreng  123   Description of item item name  21382183120983   NO   09348023   S 25.0  VAT     400    2 -3 -1500  123   Description 2 item name 2  21382183120983   NO   09348023   S 25.0  VAT     500  
```

**Response headers**

Name

Value

Date

Mon, 06 Oct 2025 13:48:01 GMT

Content-Type

application/xml

Content-Length

7702

Connection

keep-alive

content-security-policy

```
default-src 'self' *.fullstory.com file: data: blob: filesystem: *.avalara.io *.avalara.com *.vimeocdn.com *.vimeo.com *.youtube.com; script-src 'self' 'unsafe-inline' 'nonce-83d7e22f-adf0-4850-a4a1-0ff7433a7fa6' 'strict-dynamic' *.avalara.com *.fullstory.com iph.zoominsoftware.io *.siteintercept.qualtrics.com www.googletagmanager.com; style-src 'self' 'nonce-83d7e22f-adf0-4850-a4a1-0ff7433a7fa6' *.avalara.com *.avalara.io https://fonts.googleapis.com; img-src 'self' *.avalara.com *.avalara.io data: *.vimeocdn.com *.vimeo.com *.youtube.com; font-src 'self' *.avalara.com *.avalara.io https://fonts.gstatic.com; base-uri 'self'; form-action 'self'; frame-ancestors 'self'; object-src 'none'; script-src-attr 'none'; upgrade-insecure-requests; require-trusted-types-for 'script'
```

cross-origin-opener-policy

same-origin

cross-origin-resource-policy

same-origin

origin-agent-cluster

?1

referrer-policy

no-referrer

strict-transport-security

max-age=31536000; includeSubDomains

X-Content-Type-Options

nosniff

x-dns-prefetch-control

off

x-download-options

noopen

x-frame-options

SAMEORIGIN

x-permitted-cross-domain-policies

none

x-xss-protection

0

pragma

no-cache

cache-control

no-cache, no-store, must-revalidate

x-correlation-id

4b6f7163-89d8-40cd-b76e-8ce68bafb879

x-avalara-uid

4b6f7163-89d8-40cd-b76e-8ce68bafb879v