# DeclareNexusByAddress

Creates nexus for a list of addresses.

`POST /api/v2/companies/{companyId}/nexus/byaddress`

**API:** AvaTax API
**Tag:** Nexus
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/crossborder/api/methods/Nexus/DeclareNexusByAddress/

## Description

This call is intended to simplify adding all applicable nexus to a company, for an address or addresses. Calling this
API declares nexus for this company, for the list of addresses provided,
for the date range provided. You may also use this API to extend effective date on an already-declared nexus.
            
The concept of Nexus indicates a place where your company is legally obligated to collect and remit transactional
taxes.  The legal requirements for nexus may vary per country and per jurisdiction; please seek advice from your
accountant or lawyer prior to declaring nexus.
            
Note that not all fields within a nexus can be updated; Avalara publishes a list of all defined nexus at the
'/api/v2/definitions/nexus' endpoint.
            
You may only define nexus matching the official list of declared nexus.
            
Please note that nexus changes may not take effect immediately and you should plan to update your nexus settings in advance
of calculating tax for a location.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AvaTaxOnlyAccountAdmin, AvaTaxOnlyCompanyAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, ReturnsOnlyAccountAdmin, ReturnsOnlyCompanyAdmin, SSTAdmin, TechnicalSupportAdmin.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | The ID of the company that will own this nexus. |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `DeclareNexusByAddressModel[]`

Use this object to provide an address and date range where your company does business.
This address will be used to determine what jurisdictions you should declare nexus and
calculate tax.

| Property | Type | Required | Description |
|---|---|---|---|
| `effectiveDate` | string | No | The earliest date on which your company does business at this address.  If you omit
a value in this field, nexus will be declared at the earliest possible date for this
jurisdiction. Example: `2018-01-01T00:00:00`. |
| `endDate` | string | No | The date on which your company stopped doing business at this address, or empty if
your company has no plans to stop doing business at this address. Example: `2020-12-31T00:00:00`. |
| `taxTypeGroup` | string | No | The type group of nexus that this company is declaring
Use [ListTaxTypeGroups](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListTaxTypeGroups/) API for a list of nexus tax type groups.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`.
NOTE: This optional field will trigger nexus subtype lookup when populated. When using make sure TaxTypeGroup matches corresponding NexusTaxTypeGroup |
| `nexusTaxTypeGroup` | string | No | The type of nexus that this company is declaring.Replaces NexusTypeId.
Use [ListNexusTaxTypeGroups](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListNexusTaxTypeGroups/) API for a list of nexus tax type groups.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. |
| `line1` | string | No | First line of the street address Example: `2000 Main Street`. |
| `textCase` | string | No | Specify the text case for the validated address result.  If not specified, will return uppercase. Values: `Default`, `Upper`, `Mixed`. Example: `Default`. |
| `line2` | string | No | Second line of the street address |
| `line3` | string | No | Third line of the street address |
| `city` | string | No | City component of the address Example: `Irvine`. |
| `region` | string | No | Name or ISO 3166 code identifying the region within the country.
            
This field supports many different region identifiers:
 * Two and three character ISO 3166 region codes
 * Fully spelled out names of the region in ISO supported languages
 * Common alternative spellings for many regions
            
For a full list of all supported codes and names, please see the Definitions API `ListRegions`. Example: `CA`. |
| `country` | string | No | Name or ISO 3166 code identifying the country.
            
This field supports many different country identifiers:
 * Two character ISO 3166 codes
 * Three character ISO 3166 codes
 * Fully spelled out names of the country in ISO supported languages
 * Common alternative spellings for many countries
            
For a full list of all supported codes and names, please see the Definitions API `ListCountries`. Example: `US`. |
| `postalCode` | string | No | Postal Code / Zip Code component of the address. Example: `92614`. |
| `latitude` | number | No | Geospatial latitude measurement, in Decimal Degrees floating point format. |
| `longitude` | number | No | Geospatial longitude measurement, in Decimal Degrees floating point format. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success |  |
| 400 | Bad Request | `ProblemDetails` |
| 401 | Unauthorized | `ProblemDetails` |
| 404 | Not Found | `ProblemDetails` |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/nexus/byaddress" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '[
  {
    "effectiveDate": "2018-01-01T00:00:00",
    "endDate": "2020-12-31T00:00:00",
    "line1": "2000 Main Street",
    "city": "Irvine",
    "region": "CA",
    "country": "US",
    "postalCode": "92614"
  }
]'
```