# createLocation

Creates a new location for a customer

`POST /v2/locations`

**API:** Avalara MyLodgeTax API
**Tag:** Customer Information
**API Version:** v1.2
**Base URL:** https://mylodgetaxapi-sbx.avalara.net
**Content-Type:** `application/json`
**Authentication:** API Key (`Authorization` in header)

Source: https://developer.avalara.com/products/mylodge/api/methods/Customer%20Information/createLocation/

## Description

The POST method of the location endpoint provides a way to create a new location for a customer in the MyLodgeTax system.

## Request Body

**Schema:** `PostLocationRequest`

Represents a location definition to create as part of a POST request. The address must currently be in the United States (country: us).

| Property | Type | Required | Description |
|---|---|---|---|
| `customerId` | string | **Yes** | Unique, partner-specific customer identifier |
| `locationId` | string | **Yes** | Unique, partner-specific identifier of the location |
| `nickname` | string | **Yes** | Short name of the location |
| `address` | Address | **Yes** |  |
| `personOwners` | ArrayOfPersonOwners | No | Array of person owners for the location |
| `licenseInfo` | License | No | Optional license information for the location. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 201 | Created |  |
| 400 | Bad request: check response body message for details | `ErrorResponse` |
| 401 | Unauthorized | `ErrorResponse` |
| 404 | Customer not found | `ErrorResponse` |
| 409 | Conflict | `ErrorResponse` |
| 422 | Unsupported country <> -OR- Unsupported state <> | `ErrorResponse` |
| 429 | Exceeded API Rate Limits | `ErrorResponse` |
| 500 | Unknown Error | `ErrorResponse` |

## Example Request

```bash
curl -X POST "https://mylodgetaxapi-sbx.avalara.net/v2/locations" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "customerId": "",
  "locationId": "",
  "nickname": "",
  "address": {
    "addressLine1": "",
    "addressLine2": "",
    "city": "",
    "state": "",
    "country": "",
    "postalCode": ""
  },
  "personOwners": [
    {
      "firstName": "",
      "lastName": "",
      "ssn": "",
      "percentageOwned": "",
      "phone": "",
      "ownerInfo": {
        "addressLine1": "",
        "addressLine2": "",
        "city": "",
        "state": "",
        "postalCode": "",
        "isDefaultOwner": "",
        "email": ""
      }
    }
  ],
  "licenseInfo": {
    "numBedrooms": "",
    "maxOccupancy": "",
    "estimatedAnnualGrossReceipts": "",
    "hasExistingLicenses": "",
    "localContact": {
      "firstName": "",
      "lastName": "",
      "addressLine1": "",
      "addressLine2": "",
      "city": "",
      "state": "",
      "postalCode": "",
      "phone": "",
      "email": ""
    }
  }
}'
```