# SaasPro

APIs to interface with communications tax engine.The API requires Basic authentication.Users with access to multiple clients must also set request header parameters for client_id and client_profile_id.

Source: https://developer.avalara.com/products/communications/api/

**Version:** v1

---

## Endpoints

### Application

#### Get server time

`GET /api/v1/Application/ServerTime`

Returns the server time in UTC.

#### Get the version of the AFC tax engine

`GET /api/v1/Application/AFCEngineVersion`

Returns the version of the AFC tax engine.

#### Get the version of the Rest APIs

`GET /api/v1/Application/RESTVersion`

Returns the version of the REST APIs.

#### Get the AFC tax engine database version

`GET /api/v1/Application/AFCDatabaseEngineVersion`

Returns the AFC tax engine database version.


### CalculateAdjustments

#### Calculate tax adjustments on transaction

`POST /api/v1/CalculateAdjustments`

This method accepts transaction data and performs appropriate tax adjustment calculations.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `anAdjustment` |  | body | No | Transaction data. |


### CalculateJurisdiction

#### Determine jurisdiction for transaction

`POST /api/v1/CalculateJurisdiction`

Determines the taxing jurisdiction for a transaction and returns the PCode at the lowest jurisdiction level.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `aTransaction` |  | body | No | Transaction data. |


### CalculateProRated

#### Calculate taxes for a pro-rated transaction

`POST /api/v1/CalculateProRated/Taxes`

Accepts a pro-rated percentage that is used to calculate the taxable amount on the transaction 
            and perform tax calculations.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `transaction` |  | body | No | Transaction data with pro-rated percent specified as a decimal. |

#### Calculate tax adjustments for a pro-rated transaction

`POST /api/v1/CalculateProRated/Adjustments`

Accepts a pro-rated percentage that is used to calculate the taxable amount on the transaction 
            and perform tax adjustments.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `transaction` |  | body | No | Transaction data with pro-rated percent specified as a decimal. |


### CalculateTaxes

#### Calculate taxes on a transaction

`POST /api/v1/CalculateTaxes`

This method accepts transaction data and performs appropriate tax calculations.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `aTransaction` |  | body | No | Transaction data. |


### CalculateTaxesMulti

#### Calculates taxes on a transaction batch.

`POST /api/v1/CalculateTaxesMulti`

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `request` |  | body | No | List of transactions to process and default transaction values. |


### CalculateTaxInclusive

#### Perform a tax-inclusive tax adjustment

`POST /api/v1/CalculateTaxInclusive/Adjustments`

This method accepts transaction data and performs a reverse tax adjustment in order to arrive at the 
            base sale amount and taxes for the desired total charge.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `anAdjustment` |  | body | No | Transaction details. |

#### Perform a tax-inclusive tax calculation

`POST /api/v1/CalculateTaxInclusive/Taxes`

This method accepts transaction data and performs a reverse tax calculation in order to arrive at the 
            base sale amount and taxes for the desired total charge.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `aTransaction` |  | body | No | Transaction details. |


### CalculateWithOverrides

#### Calculate taxes using overrides

`POST /api/v1/CalculateWithOverrides/Taxes`

Accepts transaction and tax rate override data to perform tax calculations with the provided 
            override information.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `request` |  | body | No | Transaction data to be processed and tax rate override list. |

#### Calculate tax adjustments using overrides

`POST /api/v1/CalculateWithOverrides/Adjustments`

Accepts transaction and tax rate override data to perform tax adjustments with the provided 
            override information.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `request` |  | body | No | Transaction data to be processed and tax rate override list. |


### Commit

#### Calculate taxes on a transaction

`POST /api/v1/CommitTransactions`

This method accepts transaction data and performs appropriate tax calculations.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `commitData` |  | body | No | Document number and optional field information. |


### CustMode

#### Process transactions and adjustments in customer mode

`POST /api/v1/CustMode/CalcTaxesInCustMode`

Processes a batch of transactions and adjustments in customer mode.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `request` |  | body | No | Object containing batch of transactions and adjustments to be processed along
            with nexus and exclusion information. |


### Location

#### Determine PCode for a location

`POST /api/v1/Location/PCode`

Converts the given request data to a PCode. 
            Only one of the fields should be used for the conversion: ZipAddress, FipsCode or NPANXX.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `request` |  | body | No | Object containing ZipAddress, FipsCode or NPANXX to be converted. |

#### Convert a PCode to FIPS code

`GET /api/v1/Location/PCodeToFips/{pCode}`

This method returns the FIPS code for the specified PCode.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `pCode` | integer | path | Yes | PCode for jurisdiction. |

#### Get address information for a jurisdiction

`GET /api/v1/Location/Address/{pCode}`

This method returns a list of addresses for the specified jurisdiction.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `pCode` | integer | path | Yes | PCode for jurisdiction. |

#### Lookup jurisdictions by location name and/or postal code

`POST /api/v1/Location/ZipAddressLookup`

Searches jurisdiction matches for the address provided. The results may be an exact match or potential matches as
            specified by the BestMatch attribute in the input parameter object.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `request` |  | body | No | Object containig location search criteria. |

#### Lookup all countries in AFC

`GET /api/v1/Location/Address`

List of countries with details including name, PCode, ISO code and IOC code.

#### Lookup all states in a given country

`GET /api/v1/Location/Address/{countryIso}`

List of states/provinces/regions in a given country with details including name, two-letter code, and any counties within.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `countryIso` | string | path | Yes | Three-letter ISO Code identifying a country. |

#### Lookup all cities for a given country and state/province/region.

`GET /api/v1/Location/Address/{countryIso}/{stateCode}`

List of cities in a given country and state/province/region with details including name, Postal/ZIP Code, county and PCode.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `countryIso` | string | path | Yes | Three-letter ISO Code identifying a country. |
| `stateCode` | string | path | Yes | Two-letter state code identifying a state. |

#### List of all addresses raw.

`GET /api/v1/Location/Address/All`


### TaxLookup

#### Get tax category for a tax type

`GET /api/v1/TaxLookup/Category/{taxType}`

This method returns the tax category for the specified tax type.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `taxType` | integer | path | Yes | Tax type ID to get the category description for. |

#### Get the tax description for a tax type

`GET /api/v1/TaxLookup/Description/{taxType}`

This method returns the description for the specified tax type ID.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `taxType` | integer | path | Yes | Tax type ID to get the description for. |

#### Get tax rates for a jurisdiction

`GET /api/v1/TaxLookup/TaxRates/{pCode}`

Returns the tax rate information for a jurisdiction identified by the specified PCode.

**Parameters:**

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `pCode` | integer | path | Yes | PCode for jurisdiction. |

#### Get list of all Transaction-Service pairs.

`GET /api/v1/TaxLookup/TransactionServices`

---

## Models

### Transaction

| Property | Type | Description |
|---|---|---|
| `OriginationAddress` | ZipAddress |  |
| `OriginationFipsCode` | string |  |
| `OriginationPCode` | integer |  |
| `OriginationNpaNxx` | integer |  |
| `TerminationAddress` | ZipAddress |  |
| `TerminationFipsCode` | string |  |
| `TerminationPCode` | integer |  |
| `TerminationNpaNxx` | integer |  |
| `BillToAddress` | ZipAddress |  |
| `BillToFipsCode` | string |  |
| `BillToPCode` | integer |  |
| `BillToNpaNxx` | integer |  |
| `IsPrivateLine` | boolean |  |
| `PrivateLineSplit` | number |  |
| `CustomerType` | integer |  |
| `BusinessClass` | integer |  |
| `Sale` | boolean |  |
| `TransactionType` | integer |  |
| `ServiceType` | integer |  |
| `ServiceClass` | integer |  |
| `Date` | string |  |
| `Charge` | number |  |
| `Incorporated` | boolean |  |
| `FederalExempt` | boolean |  |
| `StateExempt` | boolean |  |
| `CountyExempt` | boolean |  |
| `LocalExempt` | boolean |  |
| `FederalPCode` | integer |  |
| `StatePCode` | integer |  |
| `CountyPCode` | integer |  |
| `LocalPCode` | integer |  |
| `Exemptions` | array |  |
| `ExemptionType` | integer |  |
| `InvoiceNumber` | integer |  |
| `Optional` | integer |  |
| `CustomerNumber` | string |  |
| `CompanyIdentifier` | string |  |
| `OptionalAlpha1` | string |  |
| `Optional4` | integer |  |
| `Optional5` | integer |  |
| `Optional6` | integer |  |
| `Optional7` | integer |  |
| `Optional8` | integer |  |
| `Optional9` | integer |  |
| `Optional10` | integer |  |
| `AdjustmentMethod` | integer |  |
| `Lines` | integer |  |
| `Locations` | integer |  |
| `Minutes` | number |  |
| `Debit` | boolean |  |
| `AdjustmentDiscount` | integer |  |
| `FacilitiesBased` | boolean |  |
| `Franchise` | boolean |  |
| `Lifeline` | boolean |  |
| `Regulated` | boolean |  |
| `ServiceLevelNumber` | integer |  |
| `Exclusions` | array |  |
| `CategoryExemptions` | array |  |
| `OptionalFields` | array |  |
| `TaxInclusive` | boolean |  |
| `SafeHarborOverrides` | array |  |
| `DocumentCode` | string |  |
| `Commit` | boolean |  |

### ZipAddress

| Property | Type | Description |
|---|---|---|
| `CountryISO` | string |  |
| `County` | string |  |
| `Locality` | string |  |
| `State` | string |  |
| `ZipCode` | string |  |
| `ZipP4` | string |  |

### TaxExemption

| Property | Type | Description |
|---|---|---|
| `PCode` | integer |  |
| `TaxLevel` | integer |  |
| `TaxType` | integer |  |

### Exclusion

| Property | Type | Description |
|---|---|---|
| `CountryISO` | string |  |
| `State` | string |  |
| `ExclusionOn` | boolean |  |

### CategoryExemption

| Property | Type | Description |
|---|---|---|
| `CountryISO` | string |  |
| `State` | string |  |
| `TaxCategory` | integer |  |

### OptionalField

| Property | Type | Description |
|---|---|---|
| `OptionalKeyNo` | integer |  |
| `OptionalValue` | string |  |

### SafeHarborOverride

| Property | Type | Description |
|---|---|---|
| `SafeHarborType` | integer |  |
| `OriginalFederalTam` | number |  |
| `NewFederalTam` | number |  |

### TaxData

| Property | Type | Description |
|---|---|---|
| `AdjustmentType` | integer |  |
| `Billable` | boolean |  |
| `CalculationType` | integer |  |
| `CategoryDescription` | string |  |
| `CategoryID` | integer |  |
| `CompanyIdentifier` | string |  |
| `Compliance` | boolean |  |
| `CustomerNumber` | string |  |
| `Description` | string |  |
| `ExemptionType` | integer |  |
| `ExemptSaleAmount` | number |  |
| `InvoiceNumber` | integer |  |
| `Optional` | integer |  |
| `OptionalAlpha1` | string |  |
| `Optional4` | integer |  |
| `Optional5` | integer |  |
| `Optional6` | integer |  |
| `Optional7` | integer |  |
| `Optional8` | integer |  |
| `Optional9` | integer |  |
| `Optional10` | integer |  |
| `PCode` | integer |  |
| `Rate` | number |  |
| `RefundUncollect` | number |  |
| `ServiceLevelNumber` | integer |  |
| `Surcharge` | boolean |  |
| `TaxableMeasure` | number |  |
| `TaxAmount` | number |  |
| `TaxLevel` | integer |  |
| `TaxType` | integer |  |
| `Lines` | integer |  |
| `Minutes` | number |  |
| `OptionalFields` | array |  |
| `TransCharge` | number |  |

### ProRatedTransaction

| Property | Type | Description |
|---|---|---|
| `ProRatedPercent` | number |  |
| `Transaction` | Transaction |  |

### MultiRequestInput

| Property | Type | Description |
|---|---|---|
| `DefaultValues` | MultiRequestItem |  |
| `Transactions` | array |  |

### MultiRequestItem

| Property | Type | Description |
|---|---|---|
| `AdjustmentDiscount` | integer |  |
| `AdjustmentMethod` | integer |  |
| `Charge` | number |  |
| `CountyExempt` | boolean |  |
| `CountyPCode` | integer |  |
| `Date` | string |  |
| `Debit` | boolean |  |
| `ExemptionType` | integer |  |
| `FacilitiesBased` | boolean |  |
| `FederalExempt` | boolean |  |
| `FederalPCode` | integer |  |
| `Franchise` | boolean |  |
| `Incorporated` | boolean |  |
| `InvoiceNumber` | integer |  |
| `IsAdjustment` | boolean |  |
| `Lifeline` | boolean |  |
| `Lines` | integer |  |
| `LocalExempt` | boolean |  |
| `LocalPCode` | integer |  |
| `Locations` | integer |  |
| `Minutes` | number |  |
| `StateExempt` | boolean |  |
| `StatePCode` | integer |  |
| `ProRatedPct` | number |  |
| `Optional` | integer |  |
| `Optional4` | integer |  |
| `Optional5` | integer |  |
| `Optional6` | integer |  |
| `Optional7` | integer |  |
| `Optional8` | integer |  |
| `Optional9` | integer |  |
| `Optional10` | integer |  |
| `Regulated` | boolean |  |
| `Sale` | boolean |  |
| `ServiceLevelNumber` | integer |  |
| `ServiceType` | integer |  |
| `TaxInclusive` | boolean |  |
| `TransactionType` | integer |  |
| `OriginationAddress` | ZipAddress |  |
| `OriginationFipsCode` | string |  |
| `OriginationPCode` | integer |  |
| `OriginationNpaNxx` | integer |  |
| `TerminationAddress` | ZipAddress |  |
| `TerminationFipsCode` | string |  |
| `TerminationPCode` | integer |  |
| `TerminationNpaNxx` | integer |  |
| `BillToAddress` | ZipAddress |  |
| `BillToFipsCode` | string |  |
| `BillToPCode` | integer |  |
| `BillToNpaNxx` | integer |  |
| `IsPrivateLine` | boolean |  |
| `PrivateLineSplit` | number |  |
| `CustomerType` | integer |  |
| `BusinessClass` | integer |  |
| `ServiceClass` | integer |  |
| `Exemptions` | array |  |
| `CustomerNumber` | string |  |
| `CompanyIdentifier` | string |  |
| `OptionalAlpha1` | string |  |
| `Exclusions` | array |  |
| `CategoryExemptions` | array |  |
| `OptionalFields` | array |  |
| `SafeHarborOverrides` | array |  |
| `DocumentCode` | string |  |
| `Commit` | boolean |  |

### MultiRequestResult

| Property | Type | Description |
|---|---|---|
| `BaseSaleAmount` | number |  |
| `ErrorMessage` | string |  |
| `Taxes` | array |  |

### ReverseTaxResults

| Property | Type | Description |
|---|---|---|
| `BaseSaleAmount` | number |  |
| `Taxes` | array |  |

### CalculateWithOverridesRequest

| Property | Type | Description |
|---|---|---|
| `Transaction` | Transaction |  |
| `Overrides` | array |  |

### TaxRateOverrideInfo

| Property | Type | Description |
|---|---|---|
| `Pcode` | integer |  |
| `Scope` | integer |  |
| `TaxType` | integer |  |
| `TaxLevel` | integer |  |
| `LevelExemptible` | boolean |  |
| `BracketInfo` | array |  |

### TaxBracketInfo

| Property | Type | Description |
|---|---|---|
| `Rate` | number |  |
| `MaxBase` | number |  |
| `CountyOverrideTax` | number |  |
| `StateOverrideTax` | number |  |
| `StateOverrideOn` | boolean |  |
| `CountyOverrideOn` | boolean |  |

### CommitData

| Property | Type | Description |
|---|---|---|
| `DocumentCode` | string |  |
| `Committed` | boolean |  |
| `CustomerNumber` | string |  |
| `InvoiceNumber` | integer |  |
| `Optional` | integer |  |
| `Optional4` | integer |  |
| `Optional5` | integer |  |
| `Optional6` | integer |  |
| `Optional7` | integer |  |
| `Optional8` | integer |  |
| `Optional9` | integer |  |
| `Optional10` | integer |  |
| `OptionalAlpha1` | string |  |
| `OptionalFields` | array |  |

### CalcTaxesInCustModeRequest

| Property | Type | Description |
|---|---|---|
| `Transactions` | array |  |
| `Adjustments` | array |  |
| `Exclusions` | array |  |
| `ReturnDetail` | boolean |  |
| `DocumentCode` | string |  |
| `Commit` | boolean |  |

### CustomerResults

| Property | Type | Description |
|---|---|---|
| `Taxes` | array |  |
| `SummarizedTaxes` | array |  |

### CustomerTaxData

| Property | Type | Description |
|---|---|---|
| `PCode` | integer |  |
| `TaxType` | integer |  |
| `TaxLevel` | integer |  |
| `CalculationType` | integer |  |
| `Rate` | number |  |
| `TaxAmount` | number |  |
| `ExemptSaleAmount` | number |  |
| `Description` | string |  |
| `Surcharge` | integer |  |
| `MaxBase` | number |  |
| `MinBase` | number |  |
| `ExcessTax` | number |  |
| `TotalCharge` | number |  |
| `CategoryID` | integer |  |
| `CategoryDescription` | string |  |
| `Lines` | integer |  |
| `Minutes` | number |  |

### RequestPCodeDetail

| Property | Type | Description |
|---|---|---|
| `FipsCode` | string |  |
| `NpaNxx` | integer |  |
| `ZipAddress` | ZipAddress |  |

### AddressData

| Property | Type | Description |
|---|---|---|
| `CountryISO` | string |  |
| `County` | string |  |
| `Locality` | string |  |
| `State` | string |  |
| `TaxLevel` | integer |  |
| `ZipBegin` | string |  |
| `ZipEnd` | string |  |
| `ZipP4Begin` | string |  |
| `ZipP4End` | string |  |

### PCodeLookupRequest

| Property | Type | Description |
|---|---|---|
| `CountryIso` | string |  |
| `State` | string |  |
| `County` | string |  |
| `City` | string |  |
| `ZipCode` | string |  |
| `BestMatch` | boolean |  |
| `LimitResults` | integer |  |
| `NpaNxx` | string |  |
| `Fips` | string |  |

### PCodeLookupResult

| Property | Type | Description |
|---|---|---|
| `LocationData` | array |  |
| `MatchCount` | integer |  |
| `InputMatchType` | string |  |
| `MatchTypeApplied` | string |  |
| `ResultsLimit` | integer |  |

### LocationItem

| Property | Type | Description |
|---|---|---|
| `IsAlternate` | boolean |  |
| `CountryIso` | string |  |
| `State` | string |  |
| `County` | string |  |
| `Locality` | string |  |
| `PCode` | integer |  |

### TaxRateInfo

| Property | Type | Description |
|---|---|---|
| `TaxType` | integer |  |
| `TaxLevel` | integer |  |
| `RateHistory` | array |  |

### TaxRateHistory

| Property | Type | Description |
|---|---|---|
| `EffectiveDate` | string |  |
| `LevelExemptible` | boolean |  |
| `BracketInfo` | array |  |
