# InitiateExportDocumentLineReport

Initiate an ExportDocumentLine report task

`POST /api/v2/companies/{companyId}/reports/exportdocumentline/initiate`

**API:** AvaTax API
**Tag:** Reports
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/crossborder/api/methods/Reports/InitiateExportDocumentLineReport/

## Description

Begins running an `ExportDocumentLine` report task and returns the identity of the report.
            
Reports are run as asynchronous report tasks on the server.  When complete, the report file will be available for download
for up to 30 days after completion.  To run an asynchronous report, you should follow these steps:
            
* Begin a report by calling the report's Initiate API.
* In the result of the Initiate API, you receive back a report's `id` value.
* All reports with `InQueue` status are picked up by the report service and processed in the background.
* Reports that are picked up by the report service will have an `InProgress` status.
* Reports will be updated to `Completed` status when the report is ready for download.
* Check the status of a report by calling `GetReport` and passing in the report's `id` value.
* When a report's status is `Completed`, call `DownloadReport` to retrieve the file.
            
The `ExportDocumentLine` report produces information about invoice lines recorded within your account.
            
Set `compression` to `GZIP` to reduce the size of the report file and increase download speed.
            
The currently supported reports are: **Document**, **Document Summary**, **Document Line**, **Document Line Detail**, **Multitax Line Detail**, **Liability**, **Tax Region**, **AP Document**, **AP Document Detail**, and **Document Line Detail All Taxes**.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, ReturnsOnlyAccountAdmin, ReturnsOnlyCompanyAdmin, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | The unique ID number of the company to report on. |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `ExportDocumentLineModel`

An input model for executing a report detailed to the document line level

| Property | Type | Required | Description |
|---|---|---|---|
| `format` | string | No | The file format. Values: `CSV`, `JSON`. Example: `CSV`. |
| `startDate` | string | No | The start date filter for report execution. If no date provided, same date of last month will be used as the startDate.
Accepts date in short format yyyy-mm-dd as well as date time stamp Example: `2026-06-02T00:00:00+00:00`. |
| `endDate` | string | No | The end date filter for report execution. If no date provided, today's date will be used as the endDate.
Accepts date in short format yyyy-mm-dd as well as date time stamp Example: `2026-07-02T00:00:00+00:00`. |
| `country` | string | No | The transactions in the country you wish to run a report.
Use "ALL" for all countries
Use "ALL Non-US" for all international countries
Or use a single 2-char ISO country code Example: `US`. |
| `state` | string | No | The state associated with the transactions you wish to run a report.
Use "ALL" for all states or 2-char state code. Example: `All`. |
| `dateFilter` | string | No | The type of date to filter your transactions Values: `DocumentDate`, `ModifiedDate`, `PaymentDate`, `ReportingDate`, `TaxDate`. Example: `DocumentDate`. |
| `docType` | string | No | The transaction type you want to run a report on Values: `All`, `ConsumerUse`, `Sales`. Example: `All`. |
| `currencyCode` | string | No | The currency your report is displayed in.
Accepts "USD" or leave this blank to get all the documents with all the currencies Example: `USD`. |
| `numberOfPartitions` | integer | No | DEPRECATED - Date: 02/18/2026, Version: 26.3.0, Message: This field is deprecated. Please do not use it. This will be removed from the model on 08/18/2027.
Number of partitions (2 - 250) to split the report into.
If a value is provided for this property, a value must also be provided for the partition property. |
| `partition` | integer | No | DEPRECATED - Date: 02/18/2026, Version: 26.3.0, Message: This field is deprecated. Please do not use it. This will be removed from the model on 08/18/2027.
The zero-based partition number to retrieve in this export request.
If a value is provided for this property, a value must also be provided for the numberOfPartitions property. |
| `isLocked` | boolean | No | If true, include only documents that are locked.
If false, include only documents that are not locked.
Defaults to false if not specified. Example: `false`. |
| `merchantSellerIdentifier` | string | No | If set, include only documents associated with these merchantSellerIds.Multiple merchantSellerIds should be sent by comma separated values. Example: `abc,xyz`. |
| `documentStatus` | string | No | DocumentStatus
For documentStatus, accepted values are: Saved, Posted, Committed, Cancelled Values: `Temporary`, `Saved`, `Posted`, `Committed`, `Cancelled`, `Adjusted`, `Queued`, `PendingApproval`, `Uncommitted`, `Any`. Example: `Temporary`. |
| `isModifiedDateSameAsDocumentDate` | boolean | No | Use this parameter when dateFilter = ModifiedDate.
For dateFilter = DocumentDate, PaymentDate, TaxDate or ReportingDate, the isModifiedDateSameAsDocumentDate parameter is ignored.
Set this parameter to true when you would like to get Documents which have the Document Date same as Modified Date.
Defaults to false if not specified. Example: `false`. |
| `taxGroup` | string | No | TaxGroup is required to support Sales tax (Sales + SellersUse) and VAT (Input+ Output).
TaxTypes, such as Lodging, Bottle, LandedCost, Ewaste, BevAlc, etc Example: `Alcohol`. |
| `taxName` | string | No | The description of the tax Example: `VAT`. |
| `taxCode` | string | No | The AvaTax tax code or customer tax code associated with the item or SKU in the transaction Example: `123`. |
| `customerVendorCode` | string | No | The code your business application uses to identify a customer or vendor |
| `taxSubType` | string | No | Defines the individual taxes associated with a TaxType category, such as Lodging TaxType which supports numerous TaxSubTypes, including Hotel, Occupancy, ConventionCenter, Accommotations, etc. Example: `Prepared Food and Beverage`. |
| `reportSource` | string | No | Defines report source. Values: `SNOWFLAKE`, `MONGODB`, `RETURNSAPI`, `TAXREGION`, `APDOCUMENT`, `APDOCUMENTLINEDETAIL`, `DOCUMENTLINEDETAILALLTAXES`, `DOCUMENTSUMMARY`, `DOCUMENT`. Example: `SNOWFLAKE`. |
| `liabilityParameters` | LiabilityParametersModel | No | Liability Parameters to access Returns API |
| `compression` | string | No | Defines the compression mode of the result file
For compression, the accepted values are: NONE, GZIP Values: `NONE`, `GZIP`. Example: `NONE`. |
| `includeDocumentLineDetails` | boolean | No | If true, include document line details in the generated report.
If false, include only document line in the generated report.
Defaults to false if not specified. Example: `false`. |
| `includeMultiTaxLineDetails` | boolean | No | If true, include multi tax line details in the generated report.
If false, include document or document line in the generated report based on includeDocumentLineDetails.
Defaults to false if not specified. Example: `false`. |
| `incorrectCurrencyOnly` | boolean | No | If true, shows all transactions that are in the incorrect currency.
If false, hides all transactions that are in the incorrect currency.
Defaults to false if not specified. Example: `false`. |
| `includeAdditionalAttributes` | boolean | No | If true, shows all additional transaction attributes.
If false, hides all additional transaction attributes.
Defaults to false if not specified. |
| `includeUserDefinedFields` | boolean | No | If true, shows all user defined fields.
If false, hides all user defined fields.
Defaults to false if not specified. |
| `importId` | string | No | Sets the ImportId for Accounts Payable reports.
Defaults to an empty string if not specified. |
| `filterAtLineLevel` | boolean | No | If true, filter using the user-defined field at the document line level.
If false, filter using the user-defined field at the document level.
Defaults to true if not specified. |
| `udfFilter` | object | No | Sets a user-defined field filter as a name/value pair.
Only one name/value pair is allowed.
Returns null if both name and value are not set. |
| `jurisdictionNames` | string[] | No | The names of the jurisdictions for which document lines are fetched.
Defaults to null if not specified. |
| `includePOAandPOO` | boolean | No | If true, include Point of Order Acceptance (POA) and Point of Order Origin (POO) in the generated report.
If false, exclude POA and POO from the generated report.
Defaults to false if not specified. Example: `false`. |
| `companyIds` | integer[] | No | List of company IDs to include in the report.
If not specified, only the current company is included. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success |  |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |
| 404 | Not Found |  |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/reports/exportdocumentline/initiate" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "format": "CSV",
  "startDate": "2026-06-02T00:00:00+00:00",
  "endDate": "2026-07-02T00:00:00+00:00",
  "country": "US",
  "state": "All",
  "dateFilter": "DocumentDate",
  "docType": "Sales",
  "currencyCode": "USD",
  "isLocked": false,
  "merchantSellerIdentifier": "abc,xyz",
  "documentStatus": "Committed",
  "isModifiedDateSameAsDocumentDate": false,
  "taxGroup": "Alcohol",
  "taxName": "VAT",
  "taxCode": "123",
  "taxSubType": "Prepared Food and Beverage",
  "reportSource": "SNOWFLAKE",
  "compression": "NONE",
  "includeDocumentLineDetails": false,
  "includeMultiTaxLineDetails": false,
  "incorrectCurrencyOnly": false,
  "includePOAandPOO": false,
  "companyIds": [
    12345,
    67890
  ]
}'
```