# ImportLocationsController_ImportLocations_Put

Imports locations.

`PUT /api/v1/ImportLocations/ImportLocations`

**API:** Excise Platform API
**Tag:** ImportLocationsController
**API Version:** v1
**Base URL:** https://excise.avalara.com
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** Basic (username + license key)

Source: https://developer.avalara.com/products/excise/api/methods/ImportLocationsController/ImportLocationsController_ImportLocations_Put/

## Description

Imports location records into the Excise Platform. The import engine processes the provided
locations and returns a summary of the results including inserted, updated, and failed records.
            
The request supports options for matching existing locations by various fields such as country code,
jurisdiction, description, address, airport code, and more.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `x-company-id` | integer | header | Yes | Company ID that owns the data. |
| `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. |

## Request Body

**Schema:** `Avalara.Excise.Common.Contracts.Services.LocationImportRequest`

Represents a request object for importing location data through the REST service.
This class contains all the necessary information to perform a location import operation,
including the locations to import, import configuration options, matching behavior settings,
and exact match criteria for various location attributes.

| Property | Type | Required | Description |
|---|---|---|---|
| `Locations` | Avalara.Excise.Common.Contracts.Services.RestLocation[] | No | Gets or sets an array of locations to be imported.
Each location contains the data that will be processed and imported into the system
for tax compliance and regulatory reporting purposes. |
| `ImportName` | string | No | Gets or sets the name identifier for this import operation.
This name is used to identify and track the import operation in logs and reports. Example: `string`. |
| `UpdateMatchesMode` | string | No | Gets or sets the update matching mode that determines how existing records are handled during import.
This setting controls whether and how the system should match and update existing locations
when duplicates are found during the import process. Values: `NONE`, `INSERT`, `UPDATE`, `COPY`. Example: `NONE`. |
| `TerminateNewRecords` | boolean | No | Gets or sets a boolean value indicating whether new records should be terminated after import.
When true, newly imported records will be marked as terminated, typically used for historical data imports. Example: `false`. |
| `ExactMatchCountryCode` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on country code.
When true, only locations with identical country codes will be considered matches. Example: `false`. |
| `ExactMatchJurisdiction` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on jurisdiction.
When true, only locations with identical jurisdictions will be considered matches. Example: `false`. |
| `ExactMatchDescription` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on description.
When true, only locations with identical descriptions will be considered matches. Example: `false`. |
| `ExactMatchAddress1` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on address line 1.
When true, only locations with identical first address lines will be considered matches. Example: `false`. |
| `ExactMatchAddress2` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on address line 2.
When true, only locations with identical second address lines will be considered matches. Example: `false`. |
| `ExactMatchCity` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on city.
When true, only locations with identical cities will be considered matches. Example: `false`. |
| `ExactMatchPostalCode` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on postal code.
When true, only locations with identical postal codes will be considered matches. Example: `false`. |
| `ExactMatchAlternateJurisdiction` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on alternate jurisdiction.
When true, only locations with identical alternate jurisdictions will be considered matches. Example: `false`. |
| `ExactMatchAlternateFacilityNumber` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on alternate facility number.
When true, only locations with identical alternate facility numbers will be considered matches. Example: `false`. |
| `ExactMatchAirportCode` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on airport code.
When true, only locations with identical airport codes will be considered matches. Example: `false`. |
| `ExactMatchCounty` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on county name.
When true, only locations with identical county names will be considered matches. Example: `false`. |
| `ExactMatchCountyCode` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on county code.
When true, only locations with identical county codes will be considered matches. Example: `false`. |
| `ExactMatchDepNumber` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on depot number.
When true, only locations with identical depot numbers will be considered matches. Example: `false`. |
| `ExactMatchLocationType` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on location type.
When true, only locations with identical location types will be considered matches. Example: `false`. |
| `ExactMatchOutsideCityLimit` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on outside city limit indicator.
When true, only locations with identical outside city limit indicators will be considered matches. Example: `false`. |
| `ExactMatchStateAssignedCode` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on state assigned code.
When true, only locations with identical state assigned codes will be considered matches. Example: `false`. |
| `ExactMatchSiteCode` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on site code.
When true, only locations with identical site codes will be considered matches. Example: `false`. |
| `ExactMatchSpecialJurisdiction` | boolean | No | Gets or sets a boolean value indicating whether to require exact matching on special jurisdiction indicator.
When true, only locations with identical special jurisdiction indicators will be considered matches. Example: `false`. |
| `LoadId` | string | No | Gets or sets the unique identifier for this import load operation.
This GUID is used to correlate related import operations and track the overall import process. Example: `a1b2c3d4-e5f6-7890-abcd-ef1234567890`. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Returns a summary of the location import results. | `Avalara.Excise.Common.Contracts.Services.RestLocationImportResultSummary` |

### 200 Response: `Avalara.Excise.Common.Contracts.Services.RestLocationImportResultSummary`

Summarizes the results of a location import operation, including counts and per-record results.

| Property | Type | Required | Description |
|---|---|---|---|
| `LocationResults` | Avalara.Excise.Common.Contracts.Services.RestLocationResult[] | No | The per-record import results for each location. |
| `Status` | string | No | The overall processing status of the import operation. Example: `Inserted`. |
| `NumberProcessed` | integer | No | The total number of records processed during the import. Example: `10`. |
| `NumberInserted` | integer | No | The count of locations successfully inserted during the import. Example: `8`. |
| `NumberUpdated` | integer | No | The total number of records updated during the import. Example: `1`. |
| `NumberFailed` | integer | No | The total number of records that failed during the import. Example: `1`. |

## Example Request

```bash
curl -X PUT "https://excise.avalara.com/api/v1/ImportLocations/ImportLocations" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "Locations": [
    {
      "LocationMappingId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "EffectiveDate": "2024-01-01T00:00:00",
      "ObsoleteDate": "2028-12-31T23:59:59",
      "TerminalCode": "T01ME1000",
      "CustomId": "CUST-001",
      "Description": "Montgomery Fuel Terminal",
      "Address1": "123 Main Street",
      "Address2": "Suite 200",
      "City": "Montgomery",
      "Jurisdiction": "AL",
      "PostalCode": "36104",
      "CountryCode": "USA",
      "County": "Montgomery",
      "CountyCode": "MONT",
      "AirportCode": "MGM",
      "AlternateJurisdiction": "AL-ALT",
      "AlternateFacilityNumber": "FAC-2024-001",
      "DepNumber": "DEP-001",
      "LocationType": "Terminal",
      "OutsideCityLimitInd": "No",
      "StateAssignedCode": "SAC-001",
      "SiteCode": "SITE-001",
      "SpecialJurisdiction": "SJ-001"
    }
  ],
  "ImportName": "string",
  "UpdateMatchesMode": "NONE",
  "TerminateNewRecords": false,
  "ExactMatchCountryCode": false,
  "ExactMatchJurisdiction": false,
  "ExactMatchDescription": false,
  "ExactMatchAddress1": false,
  "ExactMatchAddress2": false,
  "ExactMatchCity": false,
  "ExactMatchPostalCode": false,
  "ExactMatchAlternateJurisdiction": false,
  "ExactMatchAlternateFacilityNumber": false,
  "ExactMatchAirportCode": false,
  "ExactMatchCounty": false,
  "ExactMatchCountyCode": false,
  "ExactMatchDepNumber": false,
  "ExactMatchLocationType": false,
  "ExactMatchOutsideCityLimit": false,
  "ExactMatchStateAssignedCode": false,
  "ExactMatchSiteCode": false,
  "ExactMatchSpecialJurisdiction": false,
  "LoadId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}'
```