Skip to main content

Version Docs Updated

Purpose

This endpoint is used to list the rental and transfer locations defined in the system (airports, hotels, city centers, etc.).

📍 Location Services Endpoint

Location data is fed from a central source for both the "Rent-a-Car" (Rental) and "Transfer" modules. The LocationProvider class processes the data returned by this endpoint to populate UI components.


📍 Endpoint Details

  • URL: /wp-json/mhm-rentiva/v1/locations
  • Method: GET
  • Permission: Public

🔍 1. Filtering and Query Parameters

The following parameters can be used to narrow down the location list as needed:

ParameterTypeValuesDescription
typestringrental, transfer, bothFilters by service type.
classstringairport, city, hotelFilters by location category.
active_onlybool0, 1Returns only published locations (Default: 1).
searchstringFree textSearches within location name or code.

📤 2. Response Structure Example

{
"success": true,
"data": [
{
"id": 101,
"title": "İstanbul Havalimanı (IST)",
"type": "both",
"class": "airport",
"coordinates": {
"lat": 41.2752,
"lng": 28.7519
},
"code": "IST"
},
{
"id": 102,
"title": "Sabiha Gökçen Havalimanı (SAW)",
"type": "both",
"class": "airport",
"coordinates": {
"lat": 40.8986,
"lng": 29.3092
},
"code": "SAW"
}
]
}

⚡ 3. Performance and Caching

Because location list data changes infrequently:

  • MetricCacheManager: Caches the location list for 1 hour.
  • LocationProvider: Minimizes JSON size by selecting only the necessary fields (ID, Title, Coordinates) when returning data.

🚀 4. Operational Notes

  • Geographic Data: Coordinates allow map-based selection.
  • Transfer Integration: Transfer distance and price calculations run on the IDs returned by this endpoint.
  • SEO-Friendly: The title and code fields enable user-friendly searches in search forms.

Section Summary

  • The Locations endpoint is the foundation of all location-based modules.
  • Offers flexible filtering by type and class.
  • Optimized with MetricCacheManager for high performance.

Changelog

DateVersionNote
23.04.20264.27.2English translation added.
19.03.20264.21.2Coordinate support, service type filters, and caching details added.