Locations
The Location object represents a physical location (office, warehouse, etc.) for your company.
Endpoints
The Location object
Attributes
uuidstringUnique identifier for the location
namestringLocation name
location_codestring |nullOptional location code
address1stringFirst line of address
address2string |nullSecond line of address
citystringCity
statestring2-letter US state code
zipstringZIP code (5 or 9 digits)
phonestring |nullPhone number (xxx-xxx-xxxx format)
timezonestringTimezone (default: 'America/New_York')
business_hoursJSONB |nullBusiness hours configuration
default_tax_rulesJSONB |nullDefault tax rules
service_types_offeredJSONB |nullService types offered at this location
default_pricing_set_uuidUUID |nullDefault pricing set UUID
is_primarybooleanWhether this is the primary location
is_activebooleanWhether the location is active
created_atstringISO timestamp of creation
updated_atstringISO timestamp of last update
deleted_atstring |nullISO timestamp of soft deletion (null if not deleted)
THE LOCATION OBJECT
{ "uuid": "123e4567-e89b-12d3-a456-426614174000", "name": "Main Office", "address1": "123 Main St", "city": "Seattle", "state": "WA", "zip": "98101", "is_primary": true, "is_active": true}List locations
Returns a paginated list of locations for your company.
Parameters
include_deleted(boolean, default: false)requiredInclude soft-deleted locations
page(number, default: 1)requiredPage number
limit(number, default: 50, max: 100)requiredItems per page
curl -G \ https://customtradescrm.com/api/v1/locations \ -H "Authorization: Bearer ctc_live_..."Response
{ "success": true, "data": { "locations": [ { "uuid": "123e4567-e89b-12d3-a456-426614174000", "name": "Main Office", "address1": "123 Main St", "city": "Seattle", "state": "WA", "zip": "98101", "is_primary": true, "is_active": true } ], "pagination": { "page": 1, "limit": 50, "total": 1, "total_pages": 1 } }}Get a location
Returns a specific location by UUID.
curl -G \ https://customtradescrm.com/api/v1/locations/123e4567-e89b-12d3-a456-426614174000 \ -H "Authorization: Bearer ctc_live_..."Create a location
Creates a new location. **Request Body:**
Parameters
name(string)requiredLocation name
address1(string)requiredFirst line of address
city(string)requiredCity
state(string)required2-letter US state code (e.g., "WA", "CA")
zip(string)requiredZIP code (5 digits or 5+4 format)
location_code(string)Location code
address2(string)Second line of address
phone(string)Phone number (xxx-xxx-xxxx format)
timezone(string)Timezone (default: 'America/New_York')
business_hours(string)JSONB object
default_tax_rules(string)JSONB object
service_types_offered(string)JSONB object
default_pricing_set_uuid(string)UUID
is_primary(string)boolean (default: false)
curl -G \ Response
{ "success": true, "data": { "uuid": "123e4567-e89b-12d3-a456-426614174000", "name": "Main Office", "address1": "123 Main St", "city": "Seattle", "state": "WA", "zip": "98101", "is_primary": false, "is_active": true, "created_at": "2025-01-15T10:00:00Z" }}Update a location
Updates a location. All fields are optional (partial update). **Request Body:**
curl -G \ Response
{ "name": "Updated Office Name", "phone": "206-555-5678"}Delete a location
Soft deletes a location (sets `deleted_at` timestamp). Cannot delete primary location (`is_primary = true`).
Error codes
| HTTP status code | Description |
|---|---|
| 200 | Success |
| 400 | Validation error or cannot delete primary location |
| 401 | Unauthorized (invalid API key) |
| 403 | Forbidden (add-on required, IP restriction, or usage limit exceeded) |
| 404 | Location not found |
| 500 | Server error |
curl -X DELETE \ https://customtradescrm.com/api/v1/locations/123e4567-e89b-12d3-a456-426614174000 \ -H "Authorization: Bearer ctc_live_..."Response
{ "success": true, "data": { "message": "Location deleted successfully" }}