Avalara Developer Network Developer

NoLinesDiscounted

Summary

You attempted to specify a discount, but did not identify any lines to discount.

Example

{
  "code": "NoLinesDiscounted",
  "target": "Unknown",
  "details": [
    {
      "code": "NoLinesDiscounted",
      "number": 190,
      "message": "Transaction has no lines which are discounted.",
      "description": "The CreateTransactionModel object with discount amount set must have at least one line which is discounted.",
      "faultCode": "Client",
      "helpLink": "http://developer.avalara.com/avatax/errors/NoLinesDiscounted",
      "severity": "Error"
    }
  ]
}

Explanation

The CreateTransaction API allows you to specify a discount for a transaction. When you specify a discount field on your CreateTransactionModel, you must also specify the field discounted = true on each LineItemModel you wish to discount.

This behavior is explained in the AvaTax Developer Guide chapter on Customizing Transactions chapter.

To fix this error, choose one or more lines within your transaction and set the discounted = true value on each line you wish to discount.