# Fact Pattern 6: Customer mode

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

Guide: Communications

# Fact Pattern 6: Customer mode

This example shows how to run a calculation request for cable television PPV service. In this example:

-   Customer type is `0` (Residential)
-   Bill-to PCode is `3606500`, which corresponds to Nashville, TN
-   Charge for first transaction is $10
-   Charge for second transaction is $10
-   T/S pair is `16/36` (Cable Television/Pay Per View Service)

The response should show that the user is correctly setting invoice mode. Look for tax amount`tid: 230` in the`txs` array.

## Request

**View example**:

```
curl --location --request POST 'https://communicationsua.avalara.net/api/v2/afc/CalcTaxes' \
--header 'client_id: 787' \
--header 'Authorization: Basic {Base64-encoded credentials}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "cmpn": {"bscl": 0,"svcl": 0,"fclt": false,"frch": false,"reg": false
    },
    "inv": [{    "invm": true,    "dtl": true,    "summ": true,    "doc": "Subtractor and Cap in TN using Cable Television/Pay Per View Service (16/36)2039a139-9145-4789-819e-8616e13e3d68",    "cmmt": false,    "bill": {
"pcd": 3606500    },    "cust": 0,    "lfln": false,    "date": "2022-04-21",    "itms": [
{
    "ref": "Line Item 1: 16/36 $10.00 Accumalative $10.00 - No Tax (Below threshold for all taxes)",
    "chg": 10,
    "line": 0,
    "sale": 1,
    "incl": false,
    "tran": 16,
    "serv": 36,
    "dbt": false,
    "adj": false
},
{
    "ref": "Line Item 2: 16/36 $10.00 Accumalative $20.00 - State Sales Tax-Video taxed : Below Threshold on other taxes",
    "chg": 10,
    "line": 0,
    "sale": 1,
    "incl": false,
    "tran": 16,
    "serv": 36,
    "dbt": false,
    "adj": false
}    ]}
    ]
}'
```

## Response

**View example**:

```
{
    "inv": [{    "doc": "Subtractor and Cap in TN using Cable Television/Pay Per View Service (16/36)11a3c06f-b197-4970-ab09-94bc100fc853",    "itms": [
{
    "ref": "Line Item 1: 16/36 $10.00 Accumalative $10.00 - No Tax (Below threshold for all taxes)",
    "txs": [{    "bill": true,    "cmpl": true,    "tm": 0.0,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Sales Tax-Video",    "exm": 10.0,    "lns": 0,    "min": 0.0,    "pcd": 3606500,    "rate": 0.0225,    "sur": false,    "tax": 0.0,    "lvl": 2,    "tid": 230},{    "bill": true,    "cmpl": true,    "tm": 0.0,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Sales Tax-Video",    "exm": 10.0,    "lns": 0,    "min": 0.0,    "pcd": 3606500,    "rate": 0.0825,    "sur": false,    "tax": 0.0,    "lvl": 1,    "tid": 230},{    "bill": true,    "cmpl": true,    "tm": 0.0,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Sales Tax",    "exm": 10.0,    "lns": 0,    "min": 0.0,    "pcd": 3606500,    "rate": 0.07,    "sur": false,    "tax": 0.0,    "lvl": 1,    "tid": 1}
    ]
},
{
    "ref": "Line Item 2: 16/36 $10.00 Accumalative $20.00 - State Sales Tax-Video taxed : Below Threshold on other taxes",
    "txs": [{    "bill": true,    "cmpl": true,    "tm": 0.0,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Sales Tax-Video",    "exm": 10.0,    "lns": 0,    "min": 0.0,    "pcd": 3606500,    "rate": 0.0225,    "sur": false,    "tax": 0.0,    "lvl": 2,    "tid": 230},{    "bill": true,    "cmpl": true,    "tm": 5.0,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Sales Tax-Video",    "exm": 5.0,    "lns": 0,    "min": 0.0,    "pcd": 3606500,    "rate": 0.0825,    "sur": false,    "tax": 0.4125,    "lvl": 1,    "tid": 230},{    "bill": true,    "cmpl": true,    "tm": 0.0,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Sales Tax",    "exm": 10.0,    "lns": 0,    "min": 0.0,    "pcd": 3606500,    "rate": 0.07,    "sur": false,    "tax": 0.0,    "lvl": 1,    "tid": 1}
    ]
}    ],    "summ": [
{
    "max": 2147483647.0,
    "min": 0.0,
    "tchg": 0.0,
    "calc": 1,
    "cat": "SALES AND USE TAXES",
    "cid": 1,
    "name": "Sales Tax-Video",
    "exm": 20.0,
    "lns": 0,
    "pcd": 3606500,
    "rate": 0.0225,
    "sur": false,
    "tax": 0.0,
    "lvl": 2,
    "tid": 230
},
{
    "max": 12.5,
    "min": 0.0,
    "tchg": 5.0,
    "calc": 1,
    "cat": "SALES AND USE TAXES",
    "cid": 1,
    "name": "Sales Tax-Video",
    "exm": 15.0,
    "lns": 0,
    "pcd": 3606500,
    "rate": 0.0825,
    "sur": false,
    "tax": 0.4125,
    "lvl": 1,
    "tid": 230
},
{
    "max": 2147483647.0,
    "min": 0.0,
    "tchg": 0.0,
    "calc": 1,
    "cat": "SALES AND USE TAXES",
    "cid": 1,
    "name": "Sales Tax",
    "exm": 20.0,
    "lns": 0,
    "pcd": 3606500,
    "rate": 0.07,
    "sur": false,
    "tax": 0.0,
    "lvl": 1,
    "tid": 1
}    ]}
    ]
}
```