# Discount a transaction

Source: https://developer.avalara.com/vat-erp/transactions/discounts-and-overrides/discount-a-transaction/

AvaTax provides several options for handling discounts. However, before we get to into the details, we need to call out the different types of discounts you can apply, as AvaTax handles each differently. For example, vendor discounts are simply a price reduction in the sale amount of an item or service, while 3rd-party (manufacturer) discounts are, generally speaking, a price reduction sponsored by the manufacturer where the manufacturer compensates the vendor for the reduced price.

Below are some ways to represent a discount:

-   A reduction in the sale price

-   A discount to distribute among lines

-   A line item using a manufacturer discount tax code

## Price reduction discounts

With price reduction discounts, the discount occurs before sending the request to AvaTax for a tax calculation. For example, if an item has a cost of $100, and you want to apply a $10 discount, simply enter $90 for the amount of the item instead of $100. This is the simplest method for handling a discount because it doesn't involve any additional fields or lines in the request. Notice with this method, though, there is no way to determine that you applied a discount. You only know the discounted sale price of the transaction. In this case, consider adding a reference (`ref1`) to the line item of the transaction to indicate that it includes a discount.

[![Closed](https://avalara-devdocs-prod.mcoutput.com/avatax-for-ecom/Skins/Default/Stylesheets/Images/transparent.gif)View example](javascript:void\(0\);)

```
{  "type": "SalesInvoice",  "code": "PriceReductionDiscounts",  "companyCode": "DEFAULT",  "date": "2024-07-15",  "customerCode": "TESTCUSTOMER",  "addresses": {    "singleLocation": {      "line1": "100 Ravine Lane NE",      "city": "Bainbridge Island",      "region": "WA",      "country": "US",      "postalCode": "98110"    }  },  "lines": [    {      "number": "1",      "amount": 90,      "quantity": 1,      "taxCode": "P0000000",      "ref1": "Applying a $10 discount"    }  ]}  
```

## Automatically distributed discounts

Another method for discounting transactions is to automatically distribute a discount to lines in a transaction. To do this, specify a `discount` value at the document level, and then set `discounted` to `true` or `false` (default) for each line in the transaction. AvaTax will distribute the lines proportionally for all lines that are specified as `"discounted": true`.

Imagine these two scenarios:

-   Scenario 1:

    -   Specify a `discount` of $10 at the document level.

    -   Lines 1 and 2 of the transaction both include an amount of $100 and `"discounted": true`.

    -   AvaTax applies a $5 discount to each line.

-   Scenario 2:

    -   Specify a `discount` of $30 at the document level.

    -   Line 1 has an amount of $100 and `"discounted": true`.

    -   Line 2 has an amount of $200 and `"discounted": true`.

    -   AvaTax applies a discount of $10 to the first line item and a discount of $20 to the second line item.

The following example shows a sales invoice with two lines. The first line includes a discount of $10 during tax calculation. The second line doesn't include a discount.

[![Closed](https://avalara-devdocs-prod.mcoutput.com/vat-erp/Skins/Default/Stylesheets/Images/transparent.gif)View example](javascript:void\(0\);)

```
{  "type": "SalesInvoice",  "code": "AutomaticallyDistributedDiscount",  "companyCode": "DEFAULT",  "date": "2024-07-15",  "customerCode": "TESTCUSTOMER",  "discount": "10",  "addresses": {    "singleLocation": {      "line1": "100 Ravine Lane NE",      "city": "Bainbridge Island",      "region": "WA",      "country": "US",      "postalCode": "98110"    }  },  "lines": [    {      "number": "1",      "amount": 100,      "taxCode": "P0000000",      "discounted": "true"    },    {      "number": "2",      "amount": 75,      "taxCode": "P0000000",      "discounted": "false"    }  ]}        
```

## Manufacturer discounts

When working with discounts provided by a 3rd party (for example, a manufacturer coupon), include a line with a negative amount. In this line, include the tax code for Coupons (third party) - `OC030000`.

[![Closed](https://avalara-devdocs-prod.mcoutput.com/vat-erp/Skins/Default/Stylesheets/Images/transparent.gif)View example](javascript:void\(0\);)

```
{  "type": "SalesInvoice",  "code": "ManufacturerDiscountTaxCode",  "companyCode": "DEFAULT",  "date": "2024-07-15",  "customerCode": "TESTCUSTOMER",  "addresses": {    "singleLocation": {      "line1": "100 Ravine Lane NE",      "city": "Bainbridge Island",      "region": "WA",      "country": "US",      "postalCode": "98110"    }  },  "lines": [    {      "number": "1",      "amount": 100,      "taxCode": "P0000000"    },    {      "number": "2",      "amount": -10,      "taxCode": "OC030000"   }  ]}      
```