# addOrUpdateCustomerLocations

Provides a mechanism to update an existing location for an existing customer, or to add a new one if not present.

`PUT /v2/customers/{customerid}/locations/{locationid}`

**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/addOrUpdateCustomerLocations/

## Description

The PUT method of the locations endpoint provides a way to sync a partner location listing for a given customer to the MyLodgeTax system. All locations synced to MyLodgeTax for a given customer will be displayed to the customer during the property linking process.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `customerid` | string | path | Yes | Unique, partner-specific customer identifier assigned when posting a partnerLead (_customerId_). |
| `locationid` | string | path | Yes | Unique, partner-specific identifier of the location as defined in the calling system |

## Request Body

**Schema:** `PutLocationLeadRequest`

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

| Property | Type | Required | Description |
|---|---|---|---|
| `nickname` | string | No | Short name of the location |
| `address` | Address | No |  |
| `personOwners` | ArrayOfPersonOwners | No | Array of person owners for the location |
| `licenseInfo` | License | No | Optional license information for the location. |

## Responses

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

## Example Request

```bash
curl -X PUT "https://mylodgetaxapi-sbx.avalara.net/v2/customers/{customerid}/locations/{locationid}" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "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": ""
    }
  }
}'
```