# CreateNexus

Create a new nexus

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

**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/avatax/api/methods/Nexus/CreateNexus/

## Description

Creates one or more new nexus declarations attached to this company.
            
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.
            
To create a nexus declaration for your company, you must first call the Definitions API `ListNexus` to obtain a
list of Avalara-defined nexus.  Once you have determined which nexus you wish to declare, you should customize
only the user-selectable fields in this object.
            
The user selectable fields for the nexus object are `companyId`, `effectiveDate`, `endDate`, `localNexusTypeId`,
`taxId`, `nexusTypeId`, `hasPermanentEstablishment`, and `isSellerImporterOfRecord`.
            
When calling `CreateNexus` or `UpdateNexus`, all values in your nexus object except for the user-selectable fields
must match an Avalara-defined system nexus object.  You can retrieve a list of Avalara-defined system nexus objects
by calling `ListNexus`.  If any data does not match, AvaTax may not recognize your nexus declaration.
            
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 owns 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:** `NexusModel[]`

Represents a declaration of nexus within a particular taxing jurisdiction.
            
To create a nexus declaration for your company, you must first call the Definitions API `ListNexus` to obtain a
list of Avalara-defined nexus.  Once you have determined which nexus you wish to declare, you should customize
only the user-selectable fields in this object.
            
The user selectable fields for the nexus object are `companyId`, `effectiveDate`, `endDate`, `localNexusTypeId`,
`taxId`, `nexusTypeId`, `hasPermanentEstablishment`, and `isSellerImporterOfRecord`.
            
When calling `CreateNexus` or `UpdateNexus`, all values in your nexus object except for the user-selectable fields
must match an Avalara-defined system nexus object.  You can retrieve a list of Avalara-defined system nexus objects
by calling `ListNexus`.  If any data does not match, AvaTax may not recognize your nexus declaration.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The unique ID number of this declaration of nexus.
            
This field is defined automatically when you declare nexus.  You do not need to provide a value for this field. Example: `0`. |
| `companyId` | integer | No | The unique ID number of the company that declared nexus.
            
This field is user-selectable and should be provided when creating or updating a nexus object. Example: `0`. |
| `country` | string | **Yes** | Name or ISO 3166 code identifying the country in which this company declared nexus.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Example: `US`. |
| `region` | string | **Yes** | Name or ISO 3166 code identifying the region within the country.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Example: `CA`. |
| `jurisTypeId` | string | No | DEPRECATED - Date: 12/20/2017, Version: 18.1, Message: Please use jurisdictionTypeId instead.
The jurisdiction type of the jurisdiction in which this company declared nexus. Values: `STA`, `CTY`, `CIT`, `STJ`, `CNT`. Example: `STA`. |
| `jurisdictionTypeId` | string | **Yes** | The type of the jurisdiction in which this company declared nexus.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Values: `Country`, `State`, `County`, `City`, `Special`. Example: `Country`. |
| `jurisCode` | string | **Yes** | The code identifying the jurisdiction in which this company declared nexus.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Example: `06`. |
| `jurisName` | string | **Yes** | The common name of the jurisdiction in which this company declared nexus.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Example: `CALIFORNIA`. |
| `effectiveDate` | string | No | The date when this nexus began.  If not known, set to null.
            
This field is user-selectable and should be provided when creating or updating a nexus object. |
| `endDate` | string | No | If this nexus will end or has ended on a specific date, set this to the date when this nexus ends.
            
This field is user-selectable and should be provided when creating or updating a nexus object. |
| `shortName` | string | No | The short name of the jurisdiction.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Example: `CA`. |
| `signatureCode` | string | No | The signature code of the boundary region as defined by Avalara.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Example: ``. |
| `stateAssignedNo` | string | No | The state assigned number of this jurisdiction.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Example: ``. |
| `nexusTypeId` | string | No | The type of nexus that this company is declaring.
            
If you are voluntarily declaring nexus in a jurisdiction, you should select `SalesOrSellersUseTax` for your
nexus type option.  This option allows you to calculate tax correctly whether you are selling in-state or
shipping from an out-of-state location.
            
If you are legally obligated to declare nexus due to physical presence or other sufficient nexus, you
should select `SalesTax`.  This indicates that, as a legal requirement, your company must always collect
and remit full sales tax in this jurisdiction.
            
If you are participating in the Streamlined Sales Tax program, your SST administrator will select nexus
settings for you in all SST jurisdictions.  Do not select any SST options by yourself.
            
This field is user-selectable and should be provided when creating or updating a nexus object. Values: `None`, `SalesOrSellersUseTax`, `SalesTax`, `SSTVolunteer`, `SSTNonVolunteer`. Example: `None`. |
| `sourcing` | string | No | Indicates whether this nexus is defined as origin or destination nexus.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Values: `Mixed`, `Destination`, `Origin`. Example: `Mixed`. |
| `hasLocalNexus` | boolean | No | True if you are also declaring local nexus within this jurisdiction.
Many U.S. states have options for declaring nexus in local jurisdictions as well as within the state.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Example: `true`. |
| `localNexusTypeId` | string | No | If you are declaring local nexus within this jurisdiction, this indicates whether you are declaring only
a specified list of local jurisdictions, all state-administered local jurisdictions, or all local jurisdictions.
            
This field is user-selectable and should be provided when creating or updating a nexus object. Values: `Selected`, `StateAdministered`, `All`. Example: `Selected`. |
| `hasPermanentEstablishment` | boolean | No | Set this value to true if your company has a permanent establishment within this jurisdiction.
            
This field is user-selectable and should be provided when creating or updating a nexus object. Example: `true`. |
| `taxId` | string | No | Optional - the tax identification number under which you declared nexus.
            
This field is user-selectable and should be provided when creating or updating a nexus object. |
| `streamlinedSalesTax` | boolean | No | DEPRECATED - Date: 4/29/2017, Version: 19.4, Message: Please use isSSTActive instead.
For the United States, this flag indicates whether this particular nexus falls within a U.S. State that participates
in the Streamlined Sales Tax program.  For countries other than the US, this flag is null.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Example: `false`. |
| `isSSTActive` | boolean | No | For the United States, this flag indicates whether this particular nexus falls within a U.S. State that participates
in the Streamlined Sales Tax program and if the account associated with the Nexus has an active AvaTaxCsp subscription.
For countries other than the US, this flag is null.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. Example: `false`. |
| `createdDate` | string | No | The date when this record was created.
            
This field is defined automatically when you declare nexus.  You do not need to provide a value for this field. Example: `2006-10-09T05:55:50.25`. |
| `createdUserId` | integer | No | The User ID of the user who created this record.
            
This field is defined automatically when you declare nexus.  You do not need to provide a value for this field. Example: `0`. |
| `modifiedDate` | string | No | The date/time when this record was last modified.
            
This field is defined automatically when you declare nexus.  You do not need to provide a value for this field. Example: `2018-01-24T03:43:37.31`. |
| `modifiedUserId` | integer | No | The user ID of the user who last modified this record.
            
This field is defined automatically when you declare nexus.  You do not need to provide a value for this field. Example: `0`. |
| `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 Example: `SalesAndUse`. |
| `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`. Example: `SalesAndUse`. |
| `taxAuthorityId` | integer | No | A unique ID number of the tax authority that is associated with this nexus.
            
This field is defined by Avalara.  All Avalara-defined fields must match an Avalara-defined nexus object found by calling `ListNexus`. |
| `isSellerImporterOfRecord` | boolean | No | For nexus declarations at the country level, specifies whether this company is considered the importer of record in this nexus region.
            
Some taxes only apply if the seller is the importer of record for a product.  In cases where companies are working together to
ship products, there may be mutual agreement as to which company is the entity designated as importer of record.  The importer
of record will then be the company designated to pay taxes marked as being obligated to the importer of record.
            
Set this value to `true` to consider your company as the importer of record and collect these taxes.  Leave this value as false
or null and taxes will be calculated as if your company is not the importer of record.
            
This value may also be set during each transaction API call.  See `CreateTransaction()` for more information.
            
This field is user-selectable and should be provided when creating or updating a nexus object. Example: `false`. |
| `taxName` | string | No | A description of corresponding tax type applied to the nexus.
            
When a custom nexus is created, it'll have to be matched to a system nexus to be validated successfully. The matched system nexus has a
field to describe the tax type applied to it, that field will be copied over to the nexus that is being created.
            
This field is defined by Avalara. Its main purpose is to give a simple description of the tax type associated with the nexus so
users have a better understanding of the nexus when it is displayed. |
| `parameters` | NexusParameterDetailModel[] | No | List of nexus parameters. |
| `taxableNexus` | boolean | No | Shows if system nexus records are associated with tax collection |

## 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" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '[
  {
    "id": 0,
    "companyId": 0,
    "country": "US",
    "region": "CA",
    "jurisTypeId": "STA",
    "jurisdictionTypeId": "State",
    "jurisCode": "06",
    "jurisName": "CALIFORNIA",
    "shortName": "CA",
    "signatureCode": "",
    "stateAssignedNo": "",
    "nexusTypeId": "SalesOrSellersUseTax",
    "hasLocalNexus": true,
    "hasPermanentEstablishment": true,
    "streamlinedSalesTax": false,
    "isSSTActive": false,
    "createdDate": "2006-10-09T05:55:50.25",
    "createdUserId": 0,
    "modifiedDate": "2018-01-24T03:43:37.31",
    "modifiedUserId": 0,
    "taxTypeGroup": "SalesAndUse",
    "nexusTaxTypeGroup": "SalesAndUse",
    "isSellerImporterOfRecord": false
  }
]'
```