# Discounting a transaction

Source: https://developer.avalara.com/avatax-dm-combined-erp/sales-tax-badge/transactions/discounts-and-overrides/discounting-a-transaction/

# Discounting 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 each is handled 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 vendor is compensated 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 the Manufacturer Discount TaxCode

## Price reduction discounts

With price reduction discounts, the discount is performed before sending the request to AvaTax for a tax calculation. So for example, if an item has a cost of $100 and 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 as it does not involve any additional fields or lines in the request. Notice with this method, though, there is no way to determine that a discount has been applied. You only know the discounted sale price of the transaction. You may consider adding a reference (`ref1`) to the [line item](https://developer.avalara.com/api-reference/avatax/rest/v2/models/LineItemModel/) of the transaction to indicate that a discount was applied.

Click on **Example request** below to see a sample API call.

Example request

```
{  "type": "SalesInvoice",  "code": "PriceReductionDiscounts",  "companyCode": "DEFAULT",  "date": "2020-12-15",  "customerCode": "TESTCUSTOMER",  "addresses": {    "singleLocation": {      "line1": "100 Ravine Lane NE",      "city": "Bainbridge Island",      "region": "WA",      "country": "US",      "postalCode": "98110"    }  },  "lines": [    {      "number": "1",      "amount": 90,      "taxCode": "P0000000",      "ref1": "Price reflects $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` amount at the document level, and 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 will apply 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 will apply a discount of $10 to the first line item and $20 to the second line item.

Click on **Example request** below to view a sample API call. This example shows a sales invoice with two lines. The first line will include a discount of $10 during tax calculation. The second line is not discounted.

Example request

```
{  "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 discount tax code

When working with discounts provided by a 3rd party (for example, a manufacturer coupon), the process is very similar to the discount method of adding a line with a negative amount. However in this case, instead of using the same tax code as the item being discounted, you will use the [tax code for Coupons (third party)](https://taxcode.avatax.avalara.com/) - OC030000 when entering the negative line item amount.

Click on **Example request** below to see a sample API call.

Example request

```
{  "type": "SalesInvoice",  "code": "ManufacturerDiscountTaxCode",  "companyCode": "DEFAULT",  "date": "2020-12-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"   }  ]}
```

[Previous](/avatax-dm-combined-erp/sales-tax-badge/transactions/discounts-and-overrides)

[Next](/avatax-dm-combined-erp/sales-tax-badge/transactions/discounts-and-overrides/tax-overrides)