Skip to main content

Overview

The Locations API provides comprehensive location management for the UAE market, including cities and areas with Arabic translations. This system supports delivery zone configuration, store location setup, and customer address management. Location: convex/shared/locations.ts

Get Cities

Retrieves all available cities in the UAE.

Get Areas by City

Retrieves all areas within a specific city.
cityId
Id<'cities'>
required
City ID to get areas for

Get Location Hierarchy

Retrieves the complete location hierarchy for the entire UAE.

Get Location Details

Retrieves detailed location information for a specific city or area.
cityId
Id<'cities'>
City ID for city details
areaId
Id<'areas'>
Area ID for area details

Search Areas

Searches for areas by name (supports both English and Arabic).
searchTerm
string
required
Search term (supports partial matching)

Add Area

Adds a new area to a city (admin function).
cityId
Id<'cities'>
required
City ID to add area to
name
string
required
Area name in English
nameArabic
string
required
Area name in Arabic
type
string
required
Area type: district, neighborhood, community, sector, or zone

Clear Location Data

Clears all location data from the system (admin function - use with caution).

Location Picker Component

Here’s a complete location picker component for your frontend:

Area Types

The system supports different area types for better organization:

District

Large administrative divisions within cities (e.g., Downtown Dubai, Marina)

Neighborhood

Residential areas within districts (e.g., Jumeirah 1, Al Barsha)

Community

Planned communities or compounds (e.g., Arabian Ranches, The Springs)

Sector

Industrial or commercial sectors (e.g., DIFC, DMCC)

Error Handling

Status Code: 404
Status Code: 404
Status Code: 400
The location system is specifically designed for the UAE market with comprehensive coverage of major cities and areas, including Arabic translations for better user experience.
Use the search functionality to provide users with a fast way to find their location, especially useful for areas with similar names across different cities.