# Fact Pattern 4.1 - Single line sold to a residential customer in Dallas

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

Guide: Communications

# Fact Pattern 4.1 - Single line sold to a residential customer in Dallas

This reference provides details about a single voice line transaction sold to a residential customer in Dallas, including request parameters and example API requests and responses.

This transaction describes a single voice line being sold to a residential customer in Dallas.

**Request parameters**:

-   Customer type is `0` (Residential)
-   Bill-to PCode is `3726100`
-   Item 1
    -   Number of lines is `0`
    -   Sale type is `1` (Retail)
    -   T/S pair is `19/6`, (VoIP/Access Charge)
-   Item 2
    -   Number of lines is `1`
    -   Sale type is `1` (Retail)
    -   T/S pair is `19/21` (VoIP/Lines)
-   Item 3
    -   Number of lines is `0`
    -   Sale type is `1` (Retail)
    -   T/S pair is `19/43` (VoIP/Invoice)

## Request

**View example**:

```
curl --location --request POST 'https://communicationsua.avalara.net/api/v2/afc/CalcTaxes' \
--header 'Content-Type: application/json' \
--header 'client_id: 787' \
--header 'Authorization: Basic {Base64-encoded credentials}' \
--data-raw '{
    "cfg": {"incrf": true //--Return Reporting Information.
  },
    "cmpn": {"bscl": 0, //--Business Class: Typical value is "1". Is the provider and an Incumbant Local Exchange Carrier ("ILEC",  basically those companies that own the wire, antennas and switches of a network) or not?   0=ILEC, 1=NOT an ILEC (or Competitive Local Exchange Carrier "CLEC")"svcl": 0, //--Service Class:  Is the provider Primarily a local service provider, or long distance?   0=Primary Local; 1=Primary Long Distance. "fclt": true, //--Facilities:  Does the company providing the service have facilities to provide the service?    "frch": false, //--Franchise:  Indicates if the company provides services sold pursuant to a franchise agreement between the carrier and jurisdiction."reg": true, //--Regulated:  Is the Seller is regulated?"idnt": "CertCompany"
    },
    "inv": [{    "doc": "CertTest4_1_PCD_VoIP761310b2-7d50-463b-8fc6-b3ab7821c209", //--Document Code:  Required.  A unique value that is used to Commit transactions through the Commit API. Do NOT use InvoiceNumber.  GUID preferable. Every unique call must have a unique "doc".    "cmmt": false, //--Commit:  Required.  The status of transaction for end of period compliance reporting.  Previously CalcTaxes uncommitted transactions can be committed through the Commit API.    "bill": { //--Bill To Object:  Required.  Field usually originating from a customer account profile. The SoldTo address of the transaction.  AFC will return the level of granularity in taxation based on the granularity of the address provided.  This object can be JUST PCode value if you utilize the GEO or PCODE APIs for assigning a PCODE to a location.
"pcd": 3726100 //--PCode:  You can pass only this value in the BillTo object.  Preassigned values are handled via the GEO and PCODE APIs.    },    "cust": 0, //--Customer Type: Required.  Field usually originating from a customer account profile. 0=Residential; 1=Business; 2=Senior Citizen; 3=Industrial.  Different customer types could have different tax rules.    "lfln": true, //--Lifeline:  Field usually originating from a customer account profile.  Is the customer a lifeline participants?    "date": "2022-03-02", //--Date:  Effective Tax Rate Date to be applied to the invoice.  Most often Invoice Date generated through SysDate on the bill run.    "itms": [
{
    "ref": "1_CertTest4_1_PCD_BaseMRC", //--Reference Code.  Reference Id for a line item.
    "chg": 15, //--Charge:  Required.  Billed pre-tax amount if "incl"=false.  Billed after tax amount if "incl"=true.
      "line": 0, //--Lines:  Number of phone lines to be taxed.  Required for certain T/S Pairs.
    "sale": 1, //--Sale:  Sale Type:  0=Wholesale, 1=Retail, 2=Consumed (Sales and Use Only), 3=Vendor Use. REQUIRED
    "tran": 19, //--Transaction Type: Industry vertical...see mapping guidelines for this. REQUIRED
    "serv": 6, //--Service Type:  Billable services for an industry vertical....see mapping guidelines for this. REQUIRED
    "adj": false //--Adjustment:  True, will negate taxes. False, will return positive taxes.  Default is False.
},
{
    "ref": "1_CertTest4_1_PCD_LineCount", //--Reference Code.  Reference Id for a line item.
    "chg": 0, //--Charge:  Required.  Billed pre-tax amount if "incl"=false.  Billed after tax amount if "incl"=true.
      "line": 1, //--Lines:  Number of phone lines to be taxed.  Required for certain T/S Pairs.
    "sale": 1, //--Sale:  Sale Type:  0=Wholesale, 1=Retail, 2=Consumed (Sales and Use Only), 3=Vendor Use. REQUIRED
    "tran": 19, //--Transaction Type: Industry vertical...see mapping guidelines for this. REQUIRED
    "serv": 21, //--Service Type:  Billable services for an industry vertical....see mapping guidelines for this. REQUIRED
    "adj": false //--Adjustment:  True, will negate taxes. False, will return positive taxes.  Default is False.
},
{
    "ref": "1_CertTest4_1_PCD_InvoiceCharge", //--Reference Code.  Reference Id for a line item.
    "chg": 1, //--Charge:  Required.  Billed pre-tax amount if "incl"=false.  Billed after tax amount if "incl"=true.
      "line": 0, //--Lines:  Number of phone lines to be taxed.  Required for certain T/S Pairs.
    "sale": 1, //--Sale:  Sale Type:  0=Wholesale, 1=Retail, 2=Consumed (Sales and Use Only), 3=Vendor Use. REQUIRED
    "tran": 19, //--Transaction Type: Industry vertical...see mapping guidelines for this. REQUIRED
    "serv": 43, //--Service Type:  Billable services for an industry vertical....see mapping guidelines for this. REQUIRED
    "adj": false //--Adjustment:  True, will negate taxes. False, will return positive taxes.  Default is False.
}    ],    "invm": true,    "dtl": true,    "summ": true,    "acct": "CertCompany",    "custref": "CertTest4_1",    "invn": "CertTest4_1",    "bcyc": "202203",    "bpd": {
"month": 03,
"year": 2022    }}
    ]
}'
```

## Response

**View example**:

```
{
    "inv": [{    "doc": "CertTest4_1_PCD_VoIP77e28945-8cc9-45f8-b48f-dc28b2b23cda",    "itms": [
{
    "ref": "1_CertTest4_1_PCD_BaseMRC",
    "txs": [{    "bill": true,    "cmpl": true,    "tm": 15.0,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Transit Tax",    "exm": 0.0,    "lns": 0,    "min": 0.0,    "pcd": 3726100,    "rate": 0.01,    "sur": false,    "tax": 0.15,    "lvl": 3,    "tid": 33},{    "bill": true,    "cmpl": true,    "tm": 15.0,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Sales Tax",    "exm": 0.0,    "lns": 0,    "min": 0.0,    "pcd": 3726100,    "rate": 0.01,    "sur": false,    "tax": 0.15,    "lvl": 3,    "tid": 1},{    "bill": true,    "cmpl": true,    "tm": 15.0,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Sales Tax",    "exm": 0.0,    "lns": 0,    "min": 0.0,    "pcd": 3726100,    "rate": 0.0625,    "sur": false,    "tax": 0.9375,    "lvl": 1,    "tid": 1}
    ]
},
{
    "ref": "1_CertTest4_1_PCD_LineCount",
    "txs": [{    "bill": true,    "cmpl": true,    "tm": 0.0,    "calc": 4,    "cat": "E-911 CHARGES",    "cid": 7,    "name": "E911 Equalization Surcharge",    "exm": 0.0,    "lns": 1,    "min": 0.0,    "pcd": 3671300,    "rate": 0.06,    "sur": false,    "tax": 0.06,    "lvl": 1,    "tid": 297},{    "bill": true,    "cmpl": true,    "tm": 0.0,    "calc": 4,    "cat": "RIGHT OF WAY FEES",    "cid": 9,    "name": "Municipal Right of Way",    "exm": 0.0,    "lns": 1,    "min": 0.0,    "pcd": 3726100,    "rate": 1.72,    "sur": true,    "tax": 1.72,    "lvl": 3,    "tid": 51},{    "bill": true,    "cmpl": true,    "tm": 0.0,    "calc": 4,    "cat": "E-911 CHARGES",    "cid": 7,    "name": "E-911",    "exm": 0.0,    "lns": 1,    "min": 0.0,    "pcd": 3726100,    "rate": 0.62,    "sur": false,    "tax": 0.62,    "lvl": 3,    "tid": 10},{    "bill": true,    "cmpl": true,    "tm": 1.72,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Transit Tax",    "exm": 0.0,    "lns": 0,    "min": 0.0,    "pcd": 3726100,    "rate": 0.01,    "sur": false,    "tax": 0.0172,    "lvl": 3,    "tid": 33},{    "bill": true,    "cmpl": true,    "tm": 1.72,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Sales Tax",    "exm": 0.0,    "lns": 0,    "min": 0.0,    "pcd": 3726100,    "rate": 0.01,    "sur": false,    "tax": 0.0172,    "lvl": 3,    "tid": 1},{    "bill": true,    "cmpl": true,    "tm": 1.72,    "calc": 1,    "cat": "SALES AND USE TAXES",    "cid": 1,    "name": "Sales Tax",    "exm": 0.0,    "lns": 0,    "min": 0.0,    "pcd": 3726100,    "rate": 0.0625,    "sur": false,    "tax": 0.1075,    "lvl": 1,    "tid": 1}
    ]
},
{
    "ref": "1_CertTest4_1_PCD_InvoiceCharge",
    "txs": []
}    ],    "summ": [
{
    "max": 2147483647.0,
    "min": 0.0,
    "tchg": 16.72,
    "calc": 1,
    "cat": "SALES AND USE TAXES",
    "cid": 1,
    "name": "Transit Tax",
    "exm": 0.0,
    "lns": 0,
    "pcd": 3726100,
    "rate": 0.01,
    "sur": false,
    "tax": 0.1672,
    "lvl": 3,
    "tid": 33
},
{
    "max": 2147483647.0,
    "min": 0.0,
    "tchg": 16.72,
    "calc": 1,
    "cat": "SALES AND USE TAXES",
    "cid": 1,
    "name": "Sales Tax",
    "exm": 0.0,
    "lns": 0,
    "pcd": 3726100,
    "rate": 0.01,
    "sur": false,
    "tax": 0.1672,
    "lvl": 3,
    "tid": 1
},
{
    "max": 2147483647.0,
    "min": 0.0,
    "tchg": 16.72,
    "calc": 1,
    "cat": "SALES AND USE TAXES",
    "cid": 1,
    "name": "Sales Tax",
    "exm": 0.0,
    "lns": 0,
    "pcd": 3726100,
    "rate": 0.0625,
    "sur": false,
    "tax": 1.045,
    "lvl": 1,
    "tid": 1
},
{
    "max": 2147483647.0,
    "min": 0.0,
    "tchg": 0.0,
    "calc": 4,
    "cat": "E-911 CHARGES",
    "cid": 7,
    "name": "E911 Equalization Surcharge",
    "exm": 0.0,
    "lns": 1,
    "pcd": 3671300,
    "rate": 0.06,
    "sur": false,
    "tax": 0.06,
    "lvl": 1,
    "tid": 297
},
{
    "max": 2147483647.0,
    "min": 0.0,
    "tchg": 0.0,
    "calc": 4,
    "cat": "RIGHT OF WAY FEES",
    "cid": 9,
    "name": "Municipal Right of Way",
    "exm": 0.0,
    "lns": 1,
    "pcd": 3726100,
    "rate": 1.72,
    "sur": false,
    "tax": 1.72,
    "lvl": 3,
    "tid": 51
},
{
    "max": 2147483647.0,
    "min": 0.0,
    "tchg": 0.0,
    "calc": 4,
    "cat": "E-911 CHARGES",
    "cid": 7,
    "name": "E-911",
    "exm": 0.0,
    "lns": 1,
    "pcd": 3726100,
    "rate": 0.62,
    "sur": false,
    "tax": 0.62,
    "lvl": 3,
    "tid": 10
}    ],    "incrf": {
"acct": "CertCompany",
"custref": "CertTest4_1",
"invn": "CertTest4_1",
"bcyc": "202204"    }}
    ]
}
```