# Understand T/S pairs and input types

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

Guide: Communications

# Understand T/S pairs and input types

Learn about Transaction Types and Service Types (T/S pairs) and their input types for accurate tax calculations in AFC.

AFC uses a paired numbering system to represent the Transaction Types and Service Types (T/S) for the service you want to tax. Pass a valid T/S pair for AFC to calculate the appropriate tax for a specific jurisdiction. AFC won’t return accurate tax if an improper T/S pair is specified.

AFC provides a [GetTsPairs](https://developer.avalara.com/api-reference/communications/v2/methods/Lookups/GetTsPairs/) endpoint for retrieving valid T/S pairs. The response includes:

-   Transaction type value and description

-   Service type value and description

-   T/S pair description

-   Market type

-   Interface type

-   Input type

-   Whether the pair is part of a bundle

**View example**:

```
 [
    {
        "TransactionType": 0,
        "ServiceType": 0,
        "MarketType": 6,
        "InterfaceType": 1,
        "InputType": 15,
        "IsBundle": false,
        "TransactionDescription": "No Tax",
        "ServiceDescription": "No Tax",
        "TSPairDescription": "No Tax/No Tax"
    },
    {
        "TransactionType": 1,
        "ServiceType": 1,
        "MarketType": 1,
        "InterfaceType": 1,
        "InputType": 9,
        "IsBundle": false,
        "TransactionDescription": "Interstate",
        "ServiceDescription": "Toll",
        "TSPairDescription": "Interstate/Toll"
    },
    ....
] 
```

After retrieving the T/S pairs, review the `InputType` for a T/S pair that you want to include in a transaction. The input type shows the fields that might be used when calculating taxes. This calculation can be based on Charges, Lines, Minutes, Locations (deprecated), or a combination of these. Available input types include:

-   `0`: None. Tax is based per invoice per account per billing cycle. Taxable amount or numbers of lines are irrelevant for the T/S pair.

-   `1`: Charge (`chg`)

-   `2`: Lines (`line`)

-   `4`: Locations (`loc`) (deprecated)

-   `8`: Minutes (`min`)

-   `9`: Charge and Minutes (`chg` and `min`)

-   `11`: Charge, Lines, and Minutes (`chg`,`line`, and `min`)

-   `15`: Charge, Lines, Locations (deprecated), and Minutes (`chg`,`line`, `loc`, and `min`)

For example, when calculating taxes for a T/S pair with an `InputType` of`1`, then you may also want to specify a `chg` amount. You can populate additional fields, but only the fields that apply to the specific request (taxing jurisdiction rules for the T/S pair) will be used.

```
"itms": [
    {
        "ref": "test",
        "chg": 15,
        "sale": 1,
        "tran": 1,
        "serv": 14,
        "adj": false
    }
] 
```

Note

When multiple fields are listed, then only charge (`chg`) is required unless the jurisdiction in question (the one the user is taxing in) requires additional input types for taxation.

For any given line item that is to be taxed, AFC collects 2 types of data for filing purposes:

-   Taxes generated
-   Revenue

A line-based T/S pair will have a corresponding charge-based T/S pair that is to be taxed with the lines.