# AddShipToStatesForCustomer

Add ship-to states to a customer

`POST /api/v2/companies/{companyId}/customers/{customerCode}/shiptostate`

**API:** AvaTax API
**Tag:** Customers
**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/Customers/AddShipToStatesForCustomer/

## Description

Adds one or more ship-to states to the specified customer.
            
Before you can use any exemption certificates endpoints, you must set up your company for exemption certificate data storage.
Companies that do not have this storage system set up will see `CertCaptureNotConfiguredError` when they call exemption
certificate related APIs. To check if this is set up for a company, call `GetCertificateSetup`.  To request setup of exemption
certificate storage for this company, call `RequestCertificateSetup`.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
* This API depends on the following active services:*Required* (all):  AvaTaxPro, ECMEssentials, ECMPro, ECMPremium, VEMPro, VEMPremium, ECMProComms, ECMPremiumComms.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | The unique ID number of the company that recorded this customer |
| `customerCode` | string | path | Yes | The unique code representing this customer |
| `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:** `StateModel[]`

Defines a state, region, or province as known to Avalara's certificate management system.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | A unique ID number that represents this state, region, or province. Example: `56844`. |
| `name` | string | No | The state, region, or province name as known in US English. Example: `Ohio`. |
| `initials` | string | No | The abbreviated two or three character ISO 3166 state, province, or region code. Example: `OH`. |
| `geoCode` | integer | No | A geocoding identification number for this state Example: `241897`. |
| `country` | CountryModel | No | Information about the country in which this state exists. |

## Responses

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

### 200 Response: `StateModelFetchResult`

| Property | Type | Required | Description |
|---|---|---|---|
| `@recordsetCount` | integer | No |  |
| `value` | StateModel[] | No |  |
| `@nextLink` | string | No |  |
| `pageKey` | string | No |  |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/customers/{customerCode}/shiptostate" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '[
  {
    "id": 56844,
    "name": "Ohio",
    "initials": "OH",
    "geoCode": 241897,
    "country": {
      "id": 48371,
      "name": "United States",
      "initials": "US"
    }
  }
]'
```