Skip to main content

Map Hotel Regions API

Overview​

Maps a HotelMaster property to one or more CityRegion entities using a many-to-many join table (HotelCityRegionMap). Synchronizes active region mappings, activating new target mappings and deactivating omitted entries.

  • Endpoint: /api/hotels/map-regions
  • Method: POST

Request Body Schema​

FieldTypeRequiredDescription
hotelIdString (UUID)RequiredUUID of the HotelMaster record
regionIdsArray of StringsOptionalArray of CityRegion UUIDs or numeric cityRegionId strings
cityRegionIdsArray of StringsOptionalAlternative alias for regionIds

Request Body Example​

{
"hotelId": "7a8b9c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"regionIds": [
"c1b2a3d4-5678-90ef-1234-567890abcdef",
"1002"
]
}

Response Example (200 OK)​

{
"success": true,
"data": {
"id": "7a8b9c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"name": "Grand Palace Resort & Spa",
"tripjackHotelId": "100234",
"regionMaps": [
{
"id": "map-uuid-101",
"hotelId": "7a8b9c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"cityRegionId": "c1b2a3d4-5678-90ef-1234-567890abcdef",
"active": true,
"cityRegion": {
"id": "c1b2a3d4-5678-90ef-1234-567890abcdef",
"cityRegionId": 1001,
"cityName": "MUMBAI",
"regionName": "Juhu",
"countryName": "INDIA"
}
}
]
},
"message": "Hotel city regions mapped successfully"
}