> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itspropel.com/llms.txt.
> For full documentation content, see https://docs.itspropel.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itspropel.com/_mcp/server.

# Set Primary Location

POST https://crm/customers/%7Bcustomer_id%7D/locations/%7Bcustomer_location_id%7D/set-primary
Content-Type: multipart/form-data

Set this location as the customer's primary location. Only one location per customer can be primary. This action automatically removes the primary flag from any other locations for this customer. Primary location is used as the default for new service orders.

Reference: https://docs.itspropel.com/propel-biz/05-crm/customers/customer-location-management/set-primary-location

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: PropelBiz
  version: 1.0.0
paths:
  /crm/customers/%7Bcustomer_id%7D/locations/%7Bcustomer_location_id%7D/set-primary:
    post:
      operationId: set-primary-location
      summary: Set Primary Location
      description: >-
        Set this location as the customer's primary location. Only one location
        per customer can be primary. This action automatically removes the
        primary flag from any other locations for this customer. Primary
        location is used as the default for new service orders.
      tags:
        - >-
          subpackage_05Crm.subpackage_05Crm/customers.subpackage_05Crm/customers/customerLocationManagement
      parameters:
        - name: '{{tenant_key_name}}'
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/05 CRM_Customers_Customer Location
                  Management_Set Primary Location_Response_200
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostCrmCustomers%7bcustomer_id%7dLocations%7bcustomer_location_id%7dSet-primaryRequestNotFoundError
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties: {}
servers:
  - url: https:/
components:
  schemas:
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataAudit:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
        created_by:
          type: integer
        deleted_at:
          description: Any type
        updated_at:
          type: string
          format: date-time
        updated_by:
          type: integer
      required:
        - created_at
        - created_by
        - updated_at
        - updated_by
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataAudit
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataFlags:
      type: object
      properties:
        is_billing_address:
          type: boolean
        is_primary_location:
          type: boolean
      required:
        - is_billing_address
        - is_primary_location
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataFlags
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataAccess:
      type: object
      properties:
        gate_code:
          description: Any type
        instructions:
          type: string
        lockbox_code:
          description: Any type
        parking_instructions:
          type: string
      required:
        - instructions
        - parking_instructions
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataAccess
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataAddress:
      type: object
      properties:
        city:
          type: string
        state:
          type: string
        county:
          description: Any type
        line_1:
          type: string
        line_2:
          type: string
        country:
          type: string
        postal_code:
          type: string
      required:
        - city
        - state
        - line_1
        - line_2
        - country
        - postal_code
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataAddress
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataService:
      type: object
      properties:
        area:
          description: Any type
        zone:
          description: Any type
        zone_id:
          description: Any type
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataService
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataCustomer:
      type: object
      properties:
        id:
          type: integer
        display_name:
          type: string
        business_name:
          description: Any type
        customer_type:
          type: string
      required:
        - id
        - display_name
        - customer_type
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataCustomer
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataProperty:
      type: object
      properties:
        type:
          type: string
        is_owned:
          type: boolean
        lot_size:
          description: Any type
        occupancy_type:
          type: string
        square_footage:
          description: Any type
      required:
        - type
        - is_owned
        - occupancy_type
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataProperty
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataSeasonal:
      type: object
      properties:
        end_date:
          description: Any type
        is_active:
          description: Any type
        start_date:
          description: Any type
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataSeasonal
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataConditions:
      type: object
      properties:
        dog_on_premises:
          type: boolean
        special_hazards:
          description: Any type
      required:
        - dog_on_premises
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataConditions
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataCoordinates:
      type: object
      properties:
        latitude:
          type: number
          format: double
        longitude:
          type: number
          format: double
      required:
        - latitude
        - longitude
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataCoordinates
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataCreatedByUser:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        email:
          type: string
          format: email
      required:
        - id
        - name
        - email
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataCreatedByUser
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataUpdatedByUser:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        email:
          type: string
          format: email
      required:
        - id
        - name
        - email
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataUpdatedByUser
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        id:
          type: string
          format: uuid
        audit:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataAudit
        flags:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataFlags
        access:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataAccess
        status:
          type: string
        address:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataAddress
        service:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataService
        customer:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataCustomer
        property:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataProperty
        seasonal:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataSeasonal
        conditions:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataConditions
        coordinates:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataCoordinates
        customer_id:
          type: string
          format: uuid
        location_code:
          description: Any type
        location_name:
          description: Any type
        location_type:
          type: string
        created_by_user:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataCreatedByUser
        updated_by_user:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaDataUpdatedByUser
      required:
        - id
        - audit
        - flags
        - access
        - status
        - address
        - service
        - customer
        - property
        - seasonal
        - conditions
        - coordinates
        - customer_id
        - location_type
        - created_by_user
        - updated_by_user
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaData
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaMeta:
      type: object
      properties:
        type:
          type: string
        version:
          type: string
        generated_at:
          type: string
          format: date-time
      required:
        - type
        - version
        - generated_at
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaMeta
    05 CRM_Customers_Customer Location Management_Set Primary Location_Response_200:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaData
        meta:
          $ref: >-
            #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaMeta
      required:
        - data
        - meta
      title: >-
        05 CRM_Customers_Customer Location Management_Set Primary
        Location_Response_200
    CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaErrorsItems:
      type: object
      properties:
        title:
          type: string
        detail:
          type: string
        status:
          type: string
      required:
        - title
        - detail
        - status
      title: >-
        CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaErrorsItems
    PostCrmCustomers%7bcustomer_id%7dLocations%7bcustomer_location_id%7dSet-primaryRequestNotFoundError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/CrmCustomers7BcustomerId7DLocations7BcustomerLocationId7DSetPrimaryPostResponsesContentApplicationJsonSchemaErrorsItems
      required:
        - errors
      title: >-
        PostCrmCustomers%7bcustomer_id%7dLocations%7bcustomer_location_id%7dSet-primaryRequestNotFoundError

```

## SDK Code Examples

```python 05 CRM_Customers_Customer Location Management_Set Primary Location_example
import requests

url = "https://https/crm/customers/%7Bcustomer_id%7D/locations/%7Bcustomer_location_id%7D/set-primary"

payload = "-----011000010111000001101001--\r\n"
headers = {
    "{{tenant_key_name}}": "{{tenant_key_value1}}|{{tenant_key_value2}}",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript 05 CRM_Customers_Customer Location Management_Set Primary Location_example
const url = 'https://https/crm/customers/%7Bcustomer_id%7D/locations/%7Bcustomer_location_id%7D/set-primary';
const form = new FormData();

const options = {
  method: 'POST',
  headers: {'{{tenant_key_name}}': '{{tenant_key_value1}}|{{tenant_key_value2}}'}
};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 05 CRM_Customers_Customer Location Management_Set Primary Location_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/crm/customers/%7Bcustomer_id%7D/locations/%7Bcustomer_location_id%7D/set-primary"

	payload := strings.NewReader("-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 05 CRM_Customers_Customer Location Management_Set Primary Location_example
require 'uri'
require 'net/http'

url = URI("https://https/crm/customers/%7Bcustomer_id%7D/locations/%7Bcustomer_location_id%7D/set-primary")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["{{tenant_key_name}}"] = '{{tenant_key_value1}}|{{tenant_key_value2}}'
request.body = "-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java 05 CRM_Customers_Customer Location Management_Set Primary Location_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/crm/customers/%7Bcustomer_id%7D/locations/%7Bcustomer_location_id%7D/set-primary")
  .header("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}")
  .body("-----011000010111000001101001--\r\n")
  .asString();
```

```php 05 CRM_Customers_Customer Location Management_Set Primary Location_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/crm/customers/%7Bcustomer_id%7D/locations/%7Bcustomer_location_id%7D/set-primary', [
  'headers' => [
    'Content-Type' => 'multipart/form-data; boundary=---011000010111000001101001',
    '{{tenant_key_name}}' => '{{tenant_key_value1}}|{{tenant_key_value2}}',
  ],
]);

echo $response->getBody();
```

```csharp 05 CRM_Customers_Customer Location Management_Set Primary Location_example
using RestSharp;

var client = new RestClient("https://https/crm/customers/%7Bcustomer_id%7D/locations/%7Bcustomer_location_id%7D/set-primary");
var request = new RestRequest(Method.POST);
request.AddHeader("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}");
request.AddHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddParameter("undefined", "-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 05 CRM_Customers_Customer Location Management_Set Primary Location_example
import Foundation

let headers = ["{{tenant_key_name}}": "{{tenant_key_value1}}|{{tenant_key_value2}}"]
let parameters = []

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://https/crm/customers/%7Bcustomer_id%7D/locations/%7Bcustomer_location_id%7D/set-primary")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```