# Document type

Source: https://developer.avalara.com/avatax-for-vat/vky3194044342601/

# Document type

Learn about the document type field, its purpose, and how to use it in your integration.

This topic is specific to the VAT ERP and ecommerce solution.

**Element type:** Required

**Endpoints/models used:** [CreateTransactionModel](https://developer.avalara.com/api-reference/avatax/rest/v2/models/CreateTransactionModel/)

Your integration must provide a way for users to enter a document type, which specifies the type of document to create. A document type ending with `Invoice` is a permanent transaction that will be recorded in AvaTax. A document type ending with `Order` is a temporary estimate that won't be preserved.

This value should be optional for users. If they omit this value, the API will default to creating a `SalesOrder`.

Document types are added to your application using the type field in the [CreateTransactionModel](https://developer.avalara.com/api-reference/avatax/rest/v2/models/CreateTransactionModel/).

**Example**

```
{
  "type": "SalesInvoice",
  "companyCode": "DEFAULT",
  "date": "2024-07-16",
  "code": "MyDocumentCode",
  "customerCode": "ABC",
  "purchaseOrderNo": "123456789",
  "commit": true,
  "currencyCode": "USD",
  "description": "Yarn",
  ...,
}
```