def json = """{
  "regions": [{
    "regionId": 10,
    "hotels": [{
        "roomInformation": [{
          "hotelRoomId": 1,
          "availableRooms": 1,
          "roomPrice": 100,
          "occupancySequenceOrder": 1,
          "providerRoomId": 1,
          "isExtranet": true
        }],
        "regionId": 1,
        "hotelId": 1,
        "boardTypeId": 1,
        "startDate": "2017-10-23T00:00:00",
        "endDate": "2017-10-30T00:00:00",
        "totalPrice": 1000,
        "providerInformation": {
          "hotelSpecialOfferDetails": [],
          "ratePlanCode": "xxx",
          "allAvailableResults": []
        },
        "providerHotelId": 25
      },

      {
        "roomInformation": [{
          "hotelRoomId": 1,
          "availableRooms": 1,
          "roomPrice": 100,
          "occupancySequenceOrder": 1,
          "providerRoomId": 1,
          "isExtranet": true
        }],
        "regionId": 1,
        "hotelId": 1,
        "boardTypeId": 1,
        "startDate": "2017-10-23T00:00:00",
        "endDate": "2017-10-30T00:00:00",
        "totalPrice": 1000,
        "providerInformation": {
          "hotelSpecialOfferDetails": [],
          "ratePlanCode": "ggg",
          "allAvailableResults": []
        },
        "providerHotelId": 31
      }
    ],
    "errors": null
  }],
  "errors": null
}"""

def jsonRes = new groovy.json.JsonSlurper().parseText(json)
def providerhotelid = jsonRes.regions.hotels.providerHotelId.flatten()[0]
def rateplancode = jsonRes.regions.hotels.providerInformation.ratePlanCode.flatten()[0]

println providerhotelid
println rateplancode