# Invoice mode

Source: https://developer.avalara.com/products/communications/integration-guides/communications-integration/poj0385860331587/

Guide: Communications

# Invoice mode

**Element type: Conditional**

**Enpoints/models used:** [Invoice](https://developer.avalara.com/api-reference/communications/v2/models/Invoice/)

Invoice Mode is used to calculate caps, thresholds, and tax rate tiers/brackets as applicable in taxing jurisdictions that have these kinds of communication tax rules in place.

-   Cap: Tax is capped, so after a given line count or sale amount, no additional tax is charged on the amount over the cap.

-   Threshold: Tax doesn’t apply until the threshold is crossed. After a given line count or sale amount, tax is then charged on the amount above the threshold.

-   Tax rate tiers/Brackets: Tax changes based on the accumulative line count or sale amount.

    Your integration should provide an option to indicate whether all line items within the invoice should be processed in invoice mode. Specifying invoice mode is done using the`invm` field in the [Invoice](https://developer.avalara.com/api-reference/communications/v2/models/Invoice/) model.

    -   `true`: (default) Line Items are part of a single invoice; caps, thresholds, tax rate brackets, and tax rate tiers are applied per invoice as a whole.

    -   `false`: Line Items are unrelated; caps, thresholds, tax rate brackets, and tax rate tiers are applied per line item individually.

This option isn’t necessary. An exception is if the Seller is trying to do many unrelated call detail records (CDR/UDR). Note the document code (`doc`) in this case can be thought of as a Batch Reference number.

In addition, `invm` is typically set to `true` when the Bill To (`bill`) location at the header doesn’t vary at the line. If the `bill` location at the line level is different than the header we recommend setting `invm` to `false`.

For a certified integration, you must provide a way to either set `invm` to `true` or `false` on a transaction OR provide a way to break the billing into separate transactions where the Bill To address doesn’t vary at the line level.

**View example**:

```
"inv": [
  {
    "doc": "StreamingContent1",
    "cmmt": false,
    "cust": 0,
    "date": "2021-01-01T12:00:00Z",
    "invm": true,
    "dtl": true,
    "summ": true,
    "acct": "Broadcaster",
    "custref": "Customer1234",
    "invn": "Invoice1234",
    "bcyc": "202010",
    "bpd": {
        "month": "10",
        "year": "2020"
    },
    "opt": [
        {
            "key": "1",
            "val": "StreamingSamples"
        }
    ],
    "bill": {
      ...
    },
    "itms": [
      {
        ...
      }
    ]
  }
] 
```