# Discount a transaction

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

# Discount a transaction

Learn about the different types of discounts and how AvaTax handles them.

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 third-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

Learn how to apply price reduction discounts before sending a tax calculation request to AvaTax.

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.

**Example**

```
{
  "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

Understand how AvaTax automatically distributes discounts across transaction lines.

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 the `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.

**Example**

```
{
  "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

Understand how to handle manufacturer discounts using tax codes.

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

**Example**

```
{
  "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"
   }
  ]
}
```