# Interstate/intrastate determination

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

Guide: Communications

# Interstate/intrastate determination

The Communications REST v2 Interstate/Intrastate Determination feature allows you to apply interstate or intrastate charges without specifying either the transaction type or the service type.

To use the Interstate/Intrastate Determination feature, pick one of the following:

-   Transaction Type Determination: Set the transaction type (`tran`) to "-1" and the service type (`serv`) to a supported auto-fill service type.

-   Service Type Determination: Set the transaction type (`tran`) to a supported auto-fill transaction type and the service type (`serv`) to "-1".

REST v2 determines the correct interstate or intrastate transaction or service type based on the jurisdiction and Transaction/Service Pair provided.

## How to use Interstate/Intrastate determination

**Interstate vs Intrastate determination**

The RESTv2 API will examine the relationship of the`from` and`to` jurisdictions when auto-fill (`-1`) for either the transaction type or service type has been set.

-   The jurisdictions must reside in the same country or an error will occur.
-   If the `from` and `to` state are the same, then auto-fill will use the INTRASTATE pairings.
-   If the `from` and `to` states are different, then auto-fill will use the INTERSTATE pairings.
-   By definition, if neither the `from` nor `to` is to the state level (both at country level), it will be handled as an INTRASTATE pairing.
-   By definition, if only one of either `from` or `to` is to the state level or below, and the other is to the country level, it will be handled as an INTERSTATE pairing.
-   The usage of PCodes, Addresses, NpaNxx, FIPS, or embedded Geocoding for jurisdiction selection is immaterial. All valid jurisdiction specifications are supported.

## Transaction type auto selection

For Transaction Type auto selection, use the applicable **service type** (`serv`) from the table below, and set the **transaction type** (`tran`) to`-1`.

Service type

Service type description

Transaction type set for Interstate

Transaction type set for Intrastate

1

TOLL

1: Interstate

2: Intrastate

2

TOLL FREE

1: Interstate

2: Intrastate

3

WATS

1: Interstate

2: Intrastate

4

PRIVATE LINE

1: Interstate

2: Intrastate

14

LATE CHARGE

1: Interstate

2: Intrastate

16

900

1: Interstate

2: Intrastate

27

DATA

1: Interstate

2: Intrastate

54

DIRECTORY ASSISTANCE

1: Interstate

2: Intrastate

635

TOLL FREE NUMBER

1: Interstate

2: Intrastate

## Service type auto selection

For Service Type auto selection, use the applicable **transaction type** (`tran`) from the table below, and set the **service type** (`serv`) to`-1`.

Table 1. 

Transaction type

Transaction type description

Service type set for Interstate

Service type set for Intrastate

13

CELLULAR

49: Interstate Usage

50: Intrastate Usage

64

CONFERENCING

684: Interstate dial in with enhanced features

685: Intrastate dial in with enhanced features

3

OTHER

608: Conference bridge-interstate with dial in

576: Conference bridge-intrastate with dial in

21

PAYPHONE

49: Interstate Usage

50: Intrastate Usage

19

VoIP

49: Interstate Usage

50: Intrastate Usage

20

VoIPA

49: Interstate Usage

50: Intrastate Usage

59

VoIP NOMADIC

49: Interstate Usage

50: Intrastate Usage

65

NON-INTERCONNECTED VoIP

49: Interstate Usage

50: Intrastate Usage

61

VPN

49: Interstate Usage

50: Intrastate Usage

## Error messages unique to auto selection

The table below lists error messages associated with Auto Selection.

Error code

Error message

Description

\-28

`"A valid TransactionType and/or ServiceType are required."`

Line-item error in response.

This occurs when both the **transaction type** and the **service type** are set to`-1`.

\-28

`"TransactionType does not support auto-determination of ServiceType."`

Line-item error in response.

This occurs when the **transaction type** isn’t a supported value.

\-28

`"ServiceType does not support auto-determination of TransactionType."`

Line-item error in response.

This occurs when the **service type** isn’t a supported value.

\-28

`"TransactionType is invalid."`

Line-item error in response.

This occurs when the **transaction type** isn’t a valid transaction type and the **service type** is`-1`.

\-28

`"ServiceType is invalid."`

Line-item error in response.

This occurs when the **service type** isn’t a valid service type and **transaction type** is`-1`.

\-48

"Transaction/service auto-determination not supported for cross-country transaction."

Line-item error in response.

This occurs when from/to locations aren’t in the same country.

## Interstate/intrastate determination example

These are the Interstate/intrastate determination examples

**Example 1: Transaction type determination**

The Transaction Type (`tran`) is set to`-1` and is automatically determined based on the jurisdiction and Service Type (`serv`) provided. In this example the `from` and `to` addresses are in the same country but in different states. The auto-fill will set the transaction type to "1: Interstate and calculate taxes using 1/4 as the transaction/service pair." If instead the `from`/`to` were in the same state, then 2/4 (intrastate) would have been used.

**View request**:

```
{
    "cfg": {"retnb": true,"retext": true,"incrf": true
    },
    "cmpn": {"idnt": "VoIP BSU","bscl": 0,"svcl": 0,"fclt": false,"frch": false,"reg": false
    },
    "inv": [{    "doc": "TEST AUTOFILL TRANSACTION TYPE INVOICE",    "acct": "ABC Services",    "custref": "Customer Z-00A1",    "invn": "INV-BD0134627",    "cmmt": false,    "bill": {
"ctry": "USA",
"st": "CA",
"cnty": "San Francisco",
"city": "San Francisco",
"zip": "94102",
"int": true    },    "cust": 0,    "lfln": false,    "date": "2024-01-01T12:00:00Z",    "itms": [
{
    "ref": "Line Item 001: -1/4 Private Line Interstate Test",
    "glref": "GL-001-3561A",
    "from": {"ctry": "US","st": "WA"
    },
    "to": {"ctry": "US","st": "CA"
    },
    "chg": 100,
    "line": 0,
    "sale": 1,
    "incl": false,
    "tran": -1,
    "serv": 4,
    "dbt": false,
    "adj": false
}    ],    "bpd": {
"month": 1,
"year": 2024    },    "ccycd": "USD",    "invm": true,    "dtl": true,    "summ": false}
    ]
}
```

**View response**:

```
{
    "inv": [{    "doc": "TEST AUTOFILL TRANSACTION TYPE INVOICE",    "itms": [
{
    "ref": "Line Item 001: -1/4 Private Line Interstate Test",
    "txs": [{    "bill": true,    "cmpl": true,    "tm": 100.0,    "calc": 1,    "cat": "CONNECTIVITY CHARGES",    "cid": 5,    "name": "Fed Universal Service Fund",    "exm": 0.0,    "lns": 0,    "min": 0.0,    "pcd": 0,    "taxpcd": 377300,    "rate": 0.346,    "sur": false,    "tax": 34.6,    "lvl": 0,    "tid": 18,    "usexm": false,    "notax": false,    "trans": 1,    "svc": 4,    "chg": 100.0},{    "bill": false,    "cmpl": true,    "tm": 100.0,    "calc": 1,    "cat": "CONNECTIVITY CHARGES",    "cid": 5,    "name": "Telecom Relay Surcharge",    "exm": 0.0,    "lns": 0,    "min": 0.0,    "pcd": 0,    "taxpcd": 377300,    "rate": 0.00025,    "sur": false,    "tax": 0.025,    "lvl": 0,    "tid": 23,    "usexm": false,    "notax": false,    "trans": 1,    "svc": 4,    "chg": 100.0},{    "bill": true,    "cmpl": true,    "tm": 100.0,    "calc": 1,    "cat": "REGULATORY CHARGES",    "cid": 6,    "name": "FCC Regulatory Fee (Wireline)",    "exm": 0.0,    "lns": 0,    "min": 0.0,    "pcd": 0,    "taxpcd": 377300,    "rate": 0.0054,    "sur": false,    "tax": 0.54,    "lvl": 0,    "tid": 169,    "usexm": false,    "notax": false,    "trans": 1,    "svc": 4,    "chg": 100.0},{    "bill": false,    "cmpl": true,    "tm": 100.0,    "calc": 1,    "cat": "CONNECTIVITY CHARGES",    "cid": 5,    "name": "Telecom Relay Surcharge IP CTS",    "exm": 0.0,    "lns": 0,    "min": 0.0,    "pcd": 0,    "taxpcd": 377300,    "rate": 0.01615,    "sur": false,    "tax": 1.615,    "lvl": 0,    "tid": 585,    "usexm": false,    "notax": false,    "trans": 1,    "svc": 4,    "chg": 100.0}
    ]
}    ],    "incrf": {
"acct": "ABC Services",
"custref": "Customer Z-00A1",
"invn": "INV-BD0134627",
"ccycd": "USD",
"ccydesc": "US Dollar"    }}
    ]
}
```

**Example 2: Service type determination**

The Service Type (`serv`) is set to`-1` and is automatically determined based on the jurisdiction provided.

**View request**:

```
{
  "cmpn": {
    "bscl": 0,
    "svcl": 0,
    "fclt": false,
    "frch": false,
    "reg": false
  },
  "inv": [
    {
      "doc": "TEST-VOIP INVOICE",
      "cmmt": false,
      "bill": {"cnty": "San Francisco","ctry": "USA","int": true,"geo": false,"city": "San Francisco","st": "CA","zip": "94102"
      },
      "cust": 0,
      "lfln": false,
      "date": "2017-05-01T12:00:00Z",
      "itms": [{  "ref": "Line Item 002: 19/-1 Intra/Inter for Service (Intrastate Test)",  "chg": 100,  "line": 10,  "sale": 1,  "incl": false,  "tran": 19,  "serv": -1,  "dbt": false,  "adj": false}
      ],
      "invm": true,
      "dtl": true,
      "summ": true,
      "opt": [{  "key": "1",  "val": "VoIP Sample Line Items Invoice ABC-ZZZ"}
      ]
    }
  ]
}
```

Taxes are returned based on the **Intrastate** service type since San Francisco is the only jurisdiction set in the `CalcTaxes` request.

**View response**

```
{
  "inv": [
    {
      "doc": "TEST-VOIP INVOICE",
      "itms": [{  "ref": "Line Item 002: 19/-1 Intra/Inter for Service (Intrastate Test)",  "txs": [    {      "bill": true,      "cmpl": true,      "tm": 35.099999999999994,      "calc": 1,      "cat": "CONNECTIVITY CHARGES",      "cid": 5,      "name": "Universal Lifeline Telephone Service Charge (VoIP)",      "exm": 64.9,      "lns": 0,      "min": 0,      "pcd": 253500,      "rate": 0.0475,      "sur": true,      "tax": 1.6672499999999997,      "lvl": 1,      "tid": 454    },    {      "bill": true,      "cmpl": true,      "tm": 35.099999999999994,      "calc": 1,      "cat": "CONNECTIVITY CHARGES",      "cid": 5,      "name": "CA Teleconnect Fund (VoIP)",      "exm": 64.9,      "lns": 0,      "min": 0,      "pcd": 253500,      "rate": 0.0108,      "sur": true,      "tax": 0.37908,      "lvl": 1,      "tid": 452    },    {      "bill": true,      "cmpl": true,      "tm": 35.099999999999994,      "calc": 1,      "cat": "CONNECTIVITY CHARGES",      "cid": 5,      "name": "CA High Cost Fund A (VoIP)",      "exm": 64.9,      "lns": 0,      "min": 0,      "pcd": 253500,      "rate": 0.0035,      "sur": true,      "tax": 0.12284999999999999,      "lvl": 1,      "tid": 450    },    {      "bill": true,      "cmpl": true,      "tm": 35.099999999999994,      "calc": 1,      "cat": "CONNECTIVITY CHARGES",      "cid": 5,      "name": "TRS (VoIP)",      "exm": 64.9,      "lns": 0,      "min": 0,      "pcd": 253500,      "rate": 0.005,      "sur": true,      "tax": 0.17549999999999996,      "lvl": 1,      "tid": 217    },    {      "bill": true,      "cmpl": true,      "tm": 35.099999999999994,      "calc": 1,      "cat": "E-911 CHARGES",      "cid": 7,      "name": "E911 (VoIP)",      "exm": 64.9,      "lns": 0,      "min": 0,      "pcd": 253500,      "rate": 0.0075,      "sur": false,      "tax": 0.26324999999999993,      "lvl": 1,      "tid": 161    },    {      "bill": true,      "cmpl": true,      "tm": 64.9,      "calc": 1,      "cat": "CONNECTIVITY CHARGES",      "cid": 5,      "name": "FUSF (VoIP)",      "exm": 35.099999999999994,      "lns": 10,      "min": 0,      "pcd": 0,      "rate": 0.174,      "sur": false,      "tax": 11.2926,      "lvl": 0,      "tid": 162    },    {      "bill": true,      "cmpl": true,      "tm": 64.9,      "calc": 1,      "cat": "REGULATORY CHARGES",      "cid": 6,      "name": "FCC Regulatory Fee (VoIP)",      "exm": 35.099999999999994,      "lns": 10,      "min": 0,      "pcd": 0,      "rate": 0.00302,      "sur": false,      "tax": 0.19599800000000003,      "lvl": 0,      "tid": 226    }  ]}
      ],
      "summ": [{  "max": 2147483647,  "min": 0,  "tchg": 35.099999999999994,  "calc": 1,  "cat": "CONNECTIVITY CHARGES",  "cid": 5,  "name": "Universal Lifeline Telephone Service Charge (VoIP)",  "exm": 64.9,  "lns": 0,  "pcd": 253500,  "rate": 0.0475,  "sur": true,  "tax": 1.6672499999999997,  "lvl": 1,  "tid": 454},{  "max": 2147483647,  "min": 0,  "tchg": 35.099999999999994,  "calc": 1,  "cat": "CONNECTIVITY CHARGES",  "cid": 5,  "name": "CA Teleconnect Fund (VoIP)",  "exm": 64.9,  "lns": 0,  "pcd": 253500,  "rate": 0.0108,  "sur": true,  "tax": 0.37908,  "lvl": 1,  "tid": 452},{  "max": 2147483647,  "min": 0,  "tchg": 35.099999999999994,  "calc": 1,  "cat": "CONNECTIVITY CHARGES",  "cid": 5,  "name": "CA High Cost Fund A (VoIP)",  "exm": 64.9,  "lns": 0,  "pcd": 253500,  "rate": 0.0035,  "sur": true,  "tax": 0.12284999999999999,  "lvl": 1,  "tid": 450},{  "max": 2147483647,  "min": 0,  "tchg": 35.099999999999994,  "calc": 1,  "cat": "CONNECTIVITY CHARGES",  "cid": 5,  "name": "TRS (VoIP)",  "exm": 64.9,  "lns": 0,  "pcd": 253500,  "rate": 0.005,  "sur": true,  "tax": 0.17549999999999996,  "lvl": 1,  "tid": 217},{  "max": 2147483647,  "min": 0,  "tchg": 35.099999999999994,  "calc": 1,  "cat": "E-911 CHARGES",  "cid": 7,  "name": "E911 (VoIP)",  "exm": 64.9,  "lns": 0,  "pcd": 253500,  "rate": 0.0075,  "sur": false,  "tax": 0.26324999999999993,  "lvl": 1,  "tid": 161},{  "max": 2147483647,  "min": 0,  "tchg": 64.9,  "calc": 1,  "cat": "CONNECTIVITY CHARGES",  "cid": 5,  "name": "FUSF (VoIP)",  "exm": 35.099999999999994,  "lns": 10,  "pcd": 0,  "rate": 0.174,  "sur": false,  "tax": 11.2926,  "lvl": 0,  "tid": 162},{  "max": 2147483647,  "min": 0,  "tchg": 64.9,  "calc": 1,  "cat": "REGULATORY CHARGES",  "cid": 6,  "name": "FCC Regulatory Fee (VoIP)",  "exm": 35.099999999999994,  "lns": 10,  "pcd": 0,  "rate": 0.00302,  "sur": false,  "tax": 0.19599800000000003,  "lvl": 0,  "tid": 226}
      ]
    }
  ]
}
```