# Bundle

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

Guide: Communications

# Bundle

This example demonstrates adding a custom Transaction Service pairing (`20000`/`20001`) in an AFC request. Define the custom T/S pairings in the AFC Portal, or upload them beforehand. If the custom T/S pairing doesn’t exist, an error is returned as in the response below.

## 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 'client_profile_id;' \
--header 'Basic {Base64-encoded credentials}' \
--data-raw '{
    "cfg": {"incrf": true //--Return Reporting Information.
    },
    "cmpn": { "bscl": 1, //--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"). Streaming default to "1""svcl": 0, //--Service Class:  Is the provider Primarily a local service provider, or long distance?   0=Primary Local; 1=Primary Long Distance.  Streaming default: 0."fclt": false, //--Facilities:  Does the company providing the service have facilities to provide the service?  Streaming default: false."frch": false, //--Franchise:  Indicates if the company provides services sold pursuant to a franchise agreement between the carrier and jurisdiction. Streaming default: false."reg": false, //--Regulated:  Is the Seller is regulated?  Streaming default: false."idnt": "CertCompany"
    },
    "inv": [{    "doc": "CertTest_Bundle_Test", //--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:  Calculates taxed based on the granularity of the address. Options include: passing only Preassigned Pcode value in PCD value via the GEO/PCODE APIs.  The actual address fields: the more granular the address, the more accurate the results.
"pcd": 1363100     },    "cust": 0, //--Customer Type: Required.  Default to "0" for Streaming.    "date": "2022-04-21",    "itms": [
{
    "ref": "Trigger a Bundle Test",
    "chg": 500,
    "sale": 1,
    "incl": false,
    "tran": 20000,
    "serv": 20001,
    "adj": false
}    ],    "invm": true,  //--Returns Summary Tax Object for Invoice Presentation    "dtl": true,  //--Returns Line Item Detail Taxes    "summ": true,    "acct": "CertCompany",    "custref": "CertTest0",    "invn": "CertTest0",    "bcyc": "202204",    "bpd": { //--Billing Period Object: Used for reporting.
"month": "04",
"year": "2022"    }}
    ]
}'
```

## Response

**View example**:

```
{
    "inv": [{    "doc": "CertTest_Bundle_Test",    "itms": [
{
    "ref": "Trigger a Bundle Test",
    "err": [{    "code": -28,    "msg": "Invalid transaction/service pair."}
    ]
}    ],    "err": [
{
    "code": -2000,
    "msg": "One or more LineItems are invalid."
}    ]}
    ]
}
```