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, country, or coordinates. If country is omitted while updating coordinates, Mentium assumes US.
Request Body
Country/State format (ISO)
country: ISO 3166-1 alpha-2 (e.g.,US,CA,MX)state: ISO 3166-2 subdivision code (e.g.,US-IL,CA-ON,MX-CMX)
API Reference
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())Notes
- Partial Updates: Only include fields you want to update
- Re-geocoding: If you update
postal_code,state,country, or coordinates, the location may be re-geocoded - State autofill: If coordinates are provided and
stateis missing, Mentium attempts to inferstatefrom coordinates (using the offline postal dataset) - External Reference ID: Cannot be updated (it's the identifier used in the URL)