Skip to content

Update Location

PUT /v2/tms-api/locations/{external_reference_id}

Update an existing location by its external reference ID. All fields are optional - only provided fields will be updated.

INFO

Locations are automatically re-geocoded if you update postal_code, state, or country fields.

Path Parameters

external_reference_idstringrequired
The location's external reference ID (from your system)

Request Body

All fields are optional. Only provided fields will be updated.

namestring
Location name
address_line1string
Street address line 1
address_line2string
Street address line 2
citystring
City name
statestring
State/Province code
postal_codestring
Postal/ZIP code (will trigger re-geocoding if updated)
countrystring
Country code (will trigger re-geocoding if updated)
latitudenumber
Latitude (-90 to 90)
longitudenumber
Longitude (-180 to 180)
emailstring
Contact email address
phone_numberstring
Contact phone number
internal_notesstring
Internal notes (max 2000 characters)

Request Examples

bash
curl -X PUT "https://api.mentium.io/v2/tms-api/locations/LOC-CHICAGO-001" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Chicago Main Warehouse",
    "phone_number": "312-555-9999",
    "weekday_open_hours": "07:00",
    "weekday_close_hours": "18:00"
  }'
python
import requests

response = requests.put(
    "https://api.mentium.io/v2/tms-api/locations/LOC-CHICAGO-001",
    headers={
        "X-API-Key": "your_api_key_here",
        "Content-Type": "application/json"
    },
    json={
        "name": "Chicago Main Warehouse",
        "phone_number": "312-555-9999",
        "weekday_open_hours": "07:00",
        "weekday_close_hours": "18:00"
    }
)
print(response.json())

Response

200 OK

json
{
  "id": "loc_abc123def456",
  "external_reference_id": "LOC-CHICAGO-001",
  "name": "Chicago Main Warehouse",
  "address_line1": "123 Industrial Blvd",
  "address_line2": null,
  "city": "Chicago",
  "state": "IL",
  "postal_code": "60601",
  "country": "US",
  "latitude": 41.8781,
  "longitude": -87.6298,
  "email": "warehouse@example.com",
  "phone_number": "312-555-9999",
  "weekday_open_hours": "07:00",
  "weekday_close_hours": "18:00",
  "weekend_open_hours": null,
  "weekend_close_hours": null,
  "internal_notes": null,
  "created_at": "2026-01-15T10:30:00Z",
  "updated_at": "2026-01-29T14:20:00Z"
}

404 Not Found

json
{
  "detail": "Location with external_reference_id 'LOC-CHICAGO-001' not found"
}

Notes

  • Partial Updates: Only include fields you want to update
  • Re-geocoding: If you update postal_code, state, or country, the location will be automatically re-geocoded
  • External Reference ID: Cannot be updated (it's the identifier used in the URL)

Mentium TMS API Documentation