Forum Discussion

AmitA's avatar
AmitA
Occasional Contributor
10 years ago

[Res] How to use Count in jsonpath

Hi Team

In Xpath I am using 'count' to count the nodes like in the below example I am counting number of HotelStay.Please tell me how to count the same in jsonpath.I want to count the CancellationPolicies given below

Xpath:
def UAPIResultCount = context.expand( '${#TestCase#UAPIXML#declare namespace ns1=\'UniversalAirAPI\';count(//OTA_HotelAvailRS[1]/HotelStays[1]/HotelStay)}' )

Json path:
def Cancellationpolicy = context.expand( '${BlockRoomFixedBE#Response#$.BlockRoomResult.HotelRoomsDetails[0].CancellationPolicies[1]}' )

8 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    Since this is a complex json and there are multiple HotelRoomsDetails node within the BlockRoomResult,
    I had to use a for loop to capture all the json node count, refer this script,


    import groovy.json.JsonSlurper
    def response = context.expand( '${BlockRoomFixedBE#Response}')
    def slurper = new JsonSlurper()
    def result = slurper.parseText(response)
    def policyCount = 0

    def hotelrcount = result.BlockRoomResult.HotelRoomsDetails.size()-1

    log.info hotelrcount
    for (j in 0..hotelrcount-1){
    policyCount = result.BlockRoomResult.HotelRoomsDetails[j].CancellationPolicies.size()
    log.info policyCount

    }




    Thanks,
    Jeshtha
  • SiKing's avatar
    SiKing
    Community Expert
    You can use ResponseAsXml, so SoapUI will internally translate your JSON to XML, and then just XPath as normal.
    def Cancellationpolicy = context.expand( '${BlockRoomFixedBE#ResponseAsXml#count(//*:BlockRoomResult/*:HotelRoomsDetails[0]/*:CancellationPolicies)}' )
  • AmitA's avatar
    AmitA
    Occasional Contributor
    Hi Team
    In JSon response I am getting </xml> and using responseAsxml, json not getting converted into xml and in Json count is not working .In the above reply given JSON count for cancelaltionpolicy is not working.Please suggest
    I am getting the error in logs when JSon response is not getting converted.It would be better if you provide solution for the error that 'why json is not getting converted into xml' that would be helpful for me
    Please find the attachment for the error
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    I am getting the error in logs when JSon response is not getting converted.It would be better if you provide solution for the error that 'why json is not getting converted into xml' that would be helpful for me


    Can you post the JSON that is suppose to be converted to xml? There may be some content in the JSON that can not be converted to XML. Also, what version of SoapUI Pro are you using? There is a JsonPath Count assertion in SoapUI Pro 5.1.x you should consider using.


    Regards,
    Marcus
    SmartBear Support
  • AmitA's avatar
    AmitA
    Occasional Contributor
    Hi Marcus

    Below is the JSON request and response and I am using version 5.1.2. and the resolution provided by you for counting cancellation policy
    "def Cancellationpolicy = context.expand( '${BlockRoomFixedBE#ResponseAsXml#count(//*:BlockRoomResult/*:HotelRoomsDetails[0]/*:CancellationPolicies)}' )" is not working it is giving me count 0 and on the same time I am using count assertion its giving me count 8.Please refer the screen shot for the same and important thing is I dont want to use assertions,I am using groovy scripting and I want to use count there ,like I was using count in Xpath


    "def CancellationPolicies = context.expand( '${BE RoomDetails#ResponseAsXml#declare namespace ns1=\'http://iapi.tbotechnology.in/searchrequest/\'; count(//ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e['+m+']/ns1:CancellationPolicies[1]/ns1:e)}' )"

    Please provide the solution that why Json that I am providing is not getting converted into xml and how to apply count in JSON using Grrovy scripting

    JSON Request:

    {
    "AgencyId": 8428,
    "ResultIndex": 1,
    "HotelCode": "${BE Request#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:HotelSearchResult[1]/ns1:HotelResults[1]/ns1:e[1]/ns1:HotelCode[1]}",
    "HotelName": "${BE Request#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:HotelSearchResult[1]/ns1:HotelResults[1]/ns1:e[1]/ns1:HotelName[1]}",
    "GuestNationality": "IN",
    "NoOfRooms": 4,
    "ClientReferenceNo": 0,
    "HotelRoomsDetails": [
    {
    "RoomIndex": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:RoomCombinations[1]/ns1:RoomCombination[1]/ns1:e[3]/ns1:RoomIndex[1]/ns1:e[1]}",
    "RoomTypeCode": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:RoomTypeCode[1]}",
    "RoomTypeName": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:RoomTypeName[1]}",
    "RatePlanCode": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:RatePlanCode[1]}",
    "BedTypeCode": null,
    "SmokingPreference": 0,
    "Supplements": null,
    "Price": {
    "RoomPrice": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:RoomPrice[1]}",
    "Tax": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:Tax[1]}",
    "ExtraGuestCharge": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:ExtraGuestCharge[1]}",
    "ChildCharge": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:ChildCharge[1]}",
    "OtherCharges": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:OtherCharges[1]}",
    "Discount": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:Discount[1]}",
    "PublishedPrice": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:PublishedPrice[1]}",
    "PublishedPriceRoundedOff": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:OfferedPriceRoundedOff[1]}",
    "OfferedPrice": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:OfferedPrice[1]}",
    "OfferedPriceRoundedOff": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:OfferedPriceRoundedOff[1]}",
    "AgentCommission": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:AgentCommission[1]}",
    "AgentMarkUp": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:AgentMarkUp[1]}",
    "ServiceTax": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:ServiceTax[1]}",
    "TDS": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[3]/ns1:Price[1]/ns1:TDS[1]}"
    },
    "HotelPassenger": [
    {
    "Title": "mr",
    "Firstname": "Rohit",
    "Middlename": null,
    "Lastname": "Bisariya",
    "Phoneno": null,
    "Email": null,
    "PaxType": 1,
    "LeadPassenger": true,
    "Age": 0,
    "PassportNo": null,
    "PassportIssueDate": null,
    "PassportExpDate": null
    },
    {
    "Title": "mr",
    "Firstname": "Rohit",
    "Middlename": "two",
    "Lastname": "Bisariya",
    "Phoneno": null,
    "Email": null,
    "PaxType": 2,
    "LeadPassenger": false,
    "Age": 12,
    "PassportNo": null,
    "PassportIssueDate": null,
    "PassportExpDate": null
    },
    {
    "Title": "mr",
    "Firstname": "Rohit",
    "Middlename": "two",
    "Lastname": "Bisariya",
    "Phoneno": null,
    "Email": null,
    "PaxType": 2,
    "LeadPassenger": false,
    "Age": 16,
    "PassportNo": null,
    "PassportIssueDate": null,
    "PassportExpDate": null
    }
    ]
    },
    {
    "RoomIndex": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:RoomCombinations[1]/ns1:RoomCombination[1]/ns1:e[4]/ns1:RoomIndex[1]/ns1:e[1]}",
    "RoomTypeCode": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:RoomTypeCode[1]}",
    "RoomTypeName": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:RoomTypeName[1]}",
    "RatePlanCode": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:RatePlanCode[1]}",
    "BedTypeCode": null,
    "SmokingPreference": 0,
    "Supplements": null,
    "Price": {
    "RoomPrice": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:RoomPrice[1]}",
    "Tax": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:Tax[1]}",
    "ExtraGuestCharge": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:ExtraGuestCharge[1]}",
    "ChildCharge": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:ChildCharge[1]}",
    "OtherCharges": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:OtherCharges[1]}",
    "Discount": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:Discount[1]}",
    "PublishedPrice": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:PublishedPrice[1]}",
    "PublishedPriceRoundedOff": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:OfferedPriceRoundedOff[1]}",
    "OfferedPrice": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:OfferedPrice[1]}",
    "OfferedPriceRoundedOff": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:OfferedPriceRoundedOff[1]}",
    "AgentCommission": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:AgentCommission[1]}",
    "AgentMarkUp": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:AgentMarkUp[1]}",
    "ServiceTax": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:ServiceTax[1]}",
    "TDS": "${BE RoomDetails#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:GetHotelRoomResult[1]/ns1:HotelRoomsDetails[1]/ns1:e[4]/ns1:Price[1]/ns1:TDS[1]}"
    },
    "HotelPassenger": [
    {
    "Title": "mr",
    "Firstname": "Rohit",
    "Middlename": null,
    "Lastname": "Bisariya",
    "Phoneno": null,
    "Email": null,
    "PaxType": 1,
    "LeadPassenger": true,
    "Age": 0,
    "PassportNo": null,
    "PassportIssueDate": null,
    "PassportExpDate": null
    }
    ]
    }
    ],
    "EndUserIp": "123.1.1.1",
    "TokenId": "${LOGIN (Authenticate)#Response#declare namespace a='SharedServices'; declare namespace ns1='http://tempuri.org/'; //ns1:AuthenticateResponse[1]/ns1:AuthenticateResult[1]/a:TokenId[1]}",
    "ClientId": "nishant",
    "TokenAgencyId": 8428,
    "TokenMemberId": 9611,
    "TraceId": "${BE Request#ResponseAsXml#declare namespace ns1='http://iapi.tbotechnology.in/searchrequest/'; //ns1:Response[1]/ns1:HotelSearchResult[1]/ns1:TraceId[1]}"
    }


    JSON Response


    {"GetBookingResult": {
    "TraceId": "",
    "ResponseStatus": 2,
    "Error": {
    "ErrorCode": 2,
    "ErrorMessage": "Object reference not set to an instance of an object."
    },
    "BookingRefNo": null,
    "ConfirmationNo": null,
    "Status": 0
    }}
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    Below is the JSON request and response and I am using version 5.1.2. and the resolution provided by you for counting cancellation policy
    "def Cancellationpolicy = context.expand( '${BlockRoomFixedBE#ResponseAsXml#count(//*:BlockRoomResult/*:HotelRoomsDetails[0]/*:CancellationPolicies)}' )" is not working it is giving me count 0 and on the same time I am using count assertion its giving me count 8.


    I did not give you that solution, it was posted by Siking. The solution I gave was for you to use the JSONPath Count assertion. Since you would rather use Groovy to get the count then you should parse the JSON with JsonSlurper, example below.


    import groovy.json.JsonSlurper
    def response = context.expand( '${BlockRoomFixedBE#Response}')
    def slurper = new JsonSlurper()
    def result = slurper.parseText(response)
    def policyCount = 0

    for(hrd in result.BookResult.HotelRoomDetails)
    {
    policyCount = policyCount + hrd.CancellationPolicies.length
    }

    log.info policyCount



    Regards,
    Marcus
    SmartBear Support
  • AmitA's avatar
    AmitA
    Occasional Contributor
    Hi Marcus

    The solution provided by is not working its giving output -0 for the below response.Please find the attached screenshot

    Response:

    {"BlockRoomResult": {
    "TraceId": "e272f3dc-f362-4cfa-a863-0c15076ba6e7",
    "ResponseStatus": 1,
    "Error": {
    "ErrorCode": 0,
    "ErrorMessage": ""
    },
    "IsPriceChanged": true,
    "IsCancellationPolicyChanged": false,
    "HotelRoomsDetails": [
    {
    "RoomIndex": 1,
    "RoomTypeCode": "45000000022|1",
    "RoomTypeName": "Executive Room on Room basis",
    "RatePlanCode": "990000000014",
    "RatePlanName": "",
    "InfoSource": "FixedCombination",
    "SequenceNo": "IB~~1000000014~1",
    "DayRates": [
    {
    "Amount": 2368.91,
    "Date": "2014-12-28T00:00:00"
    },
    {
    "Amount": 2368.91,
    "Date": "2014-12-29T00:00:00"
    }
    ],
    "Price": {
    "CurrencyCode": "INR",
    "RoomPrice": 4737.82,
    "Tax": 923.25,
    "ExtraGuestCharge": 0,
    "ChildCharge": 0,
    "OtherCharges": 0,
    "Discount": 0,
    "PublishedPrice": 5661.07,
    "PublishedPriceRoundedOff": 5661,
    "OfferedPrice": 5661.07,
    "OfferedPriceRoundedOff": 5661,
    "AgentCommission": 0,
    "AgentMarkUp": 780.84,
    "ServiceTax": 48.8,
    "TDS": 0
    },
    "RoomPromotion": "",
    "Amenities": ["Accommodation"],
    "SmokingPreference": "NoPreference",
    "BedTypes": [],
    "Supplements": [],
    "SupplierSpecificData": null,
    "CancellationPolicies": [
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-09-30T00:00:00",
    "ToDate": "2014-12-19T09:59:00"
    },
    {
    "Charge": 1,
    "ChargeType": 3,
    "Currency": null,
    "FromDate": "2014-12-19T10:00:00",
    "ToDate": "2014-12-23T09:59:00"
    },
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-12-23T10:00:00",
    "ToDate": "2014-12-26T09:59:00"
    },
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-12-26T09:59:01",
    "ToDate": "2014-12-30T23:59:59"
    }
    ],
    "LastCancellationDate": "2014-09-29T00:00:00",
    "CancellationPolicy": "Executive Room on Room basis#^#100.00% of total amount will be charged, If cancelled between 30-Sep-2014 00:00:00 and 19-Dec-2014 09:59:00.| Charge of 1 night(s) will be charged, If cancelled between 19-Dec-2014 10:00:00 and 23-Dec-2014 09:59:00.|100.00% of total amount will be charged, If cancelled between 23-Dec-2014 10:00:00 and 26-Dec-2014 09:59:00.|100.00% of total amount will be charged, If cancelled between 26-Dec-2014 09:59:01 and 30-Dec-2014 23:59:59.|#!#"
    },
    {
    "RoomIndex": 2,
    "RoomTypeCode": "45000000022|2",
    "RoomTypeName": "Executive Room on Room basis",
    "RatePlanCode": "990000000014",
    "RatePlanName": "",
    "InfoSource": "FixedCombination",
    "SequenceNo": "IB~~1000000014~1",
    "DayRates": [
    {
    "Amount": 2368.91,
    "Date": "2014-12-28T00:00:00"
    },
    {
    "Amount": 2368.91,
    "Date": "2014-12-29T00:00:00"
    }
    ],
    "Price": {
    "CurrencyCode": "INR",
    "RoomPrice": 4737.82,
    "Tax": 923.25,
    "ExtraGuestCharge": 0,
    "ChildCharge": 0,
    "OtherCharges": 0,
    "Discount": 0,
    "PublishedPrice": 5661.07,
    "PublishedPriceRoundedOff": 5661,
    "OfferedPrice": 5661.07,
    "OfferedPriceRoundedOff": 5661,
    "AgentCommission": 0,
    "AgentMarkUp": 780.84,
    "ServiceTax": 48.8,
    "TDS": 0
    },
    "RoomPromotion": "",
    "Amenities": ["Accommodation"],
    "SmokingPreference": "NoPreference",
    "BedTypes": [],
    "Supplements": [],
    "SupplierSpecificData": null,
    "CancellationPolicies": [
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-09-30T00:00:00",
    "ToDate": "2014-12-19T09:59:00"
    },
    {
    "Charge": 1,
    "ChargeType": 3,
    "Currency": null,
    "FromDate": "2014-12-19T10:00:00",
    "ToDate": "2014-12-23T09:59:00"
    },
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-12-23T10:00:00",
    "ToDate": "2014-12-26T09:59:00"
    },
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-12-26T09:59:01",
    "ToDate": "2014-12-30T23:59:59"
    }
    ],
    "LastCancellationDate": "2014-09-29T00:00:00",
    "CancellationPolicy": "Executive Room on Room basis#^#100.00% of total amount will be charged, If cancelled between 30-Sep-2014 00:00:00 and 19-Dec-2014 09:59:00.| Charge of 1 night(s) will be charged, If cancelled between 19-Dec-2014 10:00:00 and 23-Dec-2014 09:59:00.|100.00% of total amount will be charged, If cancelled between 23-Dec-2014 10:00:00 and 26-Dec-2014 09:59:00.|100.00% of total amount will be charged, If cancelled between 26-Dec-2014 09:59:01 and 30-Dec-2014 23:59:59.|#!#"
    },
    {
    "RoomIndex": 3,
    "RoomTypeCode": "45000000022|3",
    "RoomTypeName": "Executive Room on Room basis",
    "RatePlanCode": "990000000014",
    "RatePlanName": "",
    "InfoSource": "FixedCombination",
    "SequenceNo": "IB~~1000000014~1",
    "DayRates": [
    {
    "Amount": 2368.91,
    "Date": "2014-12-28T00:00:00"
    },
    {
    "Amount": 2368.91,
    "Date": "2014-12-29T00:00:00"
    }
    ],
    "Price": {
    "CurrencyCode": "INR",
    "RoomPrice": 4737.82,
    "Tax": 923.25,
    "ExtraGuestCharge": 0,
    "ChildCharge": 0,
    "OtherCharges": 0,
    "Discount": 0,
    "PublishedPrice": 5661.07,
    "PublishedPriceRoundedOff": 5661,
    "OfferedPrice": 5661.07,
    "OfferedPriceRoundedOff": 5661,
    "AgentCommission": 0,
    "AgentMarkUp": 780.84,
    "ServiceTax": 48.8,
    "TDS": 0
    },
    "RoomPromotion": "",
    "Amenities": ["Accommodation"],
    "SmokingPreference": "NoPreference",
    "BedTypes": [],
    "Supplements": [],
    "SupplierSpecificData": null,
    "CancellationPolicies": [
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-09-30T00:00:00",
    "ToDate": "2014-12-19T09:59:00"
    },
    {
    "Charge": 1,
    "ChargeType": 3,
    "Currency": null,
    "FromDate": "2014-12-19T10:00:00",
    "ToDate": "2014-12-23T09:59:00"
    },
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-12-23T10:00:00",
    "ToDate": "2014-12-26T09:59:00"
    },
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-12-26T09:59:01",
    "ToDate": "2014-12-30T23:59:59"
    }
    ],
    "LastCancellationDate": "2014-09-29T00:00:00",
    "CancellationPolicy": "Executive Room on Room basis#^#100.00% of total amount will be charged, If cancelled between 30-Sep-2014 00:00:00 and 19-Dec-2014 09:59:00.| Charge of 1 night(s) will be charged, If cancelled between 19-Dec-2014 10:00:00 and 23-Dec-2014 09:59:00.|100.00% of total amount will be charged, If cancelled between 23-Dec-2014 10:00:00 and 26-Dec-2014 09:59:00.|100.00% of total amount will be charged, If cancelled between 26-Dec-2014 09:59:01 and 30-Dec-2014 23:59:59.|#!#"
    },
    {
    "RoomIndex": 4,
    "RoomTypeCode": "45000000022|4",
    "RoomTypeName": "Executive Room on Room basis",
    "RatePlanCode": "990000000014",
    "RatePlanName": "",
    "InfoSource": "FixedCombination",
    "SequenceNo": "IB~~1000000014~1",
    "DayRates": [
    {
    "Amount": 2368.91,
    "Date": "2014-12-28T00:00:00"
    },
    {
    "Amount": 2368.91,
    "Date": "2014-12-29T00:00:00"
    }
    ],
    "Price": {
    "CurrencyCode": "INR",
    "RoomPrice": 4737.82,
    "Tax": 923.25,
    "ExtraGuestCharge": 0,
    "ChildCharge": 0,
    "OtherCharges": 0,
    "Discount": 0,
    "PublishedPrice": 5661.07,
    "PublishedPriceRoundedOff": 5661,
    "OfferedPrice": 5661.07,
    "OfferedPriceRoundedOff": 5661,
    "AgentCommission": 0,
    "AgentMarkUp": 780.84,
    "ServiceTax": 48.8,
    "TDS": 0
    },
    "RoomPromotion": "",
    "Amenities": ["Accommodation"],
    "SmokingPreference": "NoPreference",
    "BedTypes": [],
    "Supplements": [],
    "SupplierSpecificData": null,
    "CancellationPolicies": [
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-09-30T00:00:00",
    "ToDate": "2014-12-19T09:59:00"
    },
    {
    "Charge": 1,
    "ChargeType": 3,
    "Currency": null,
    "FromDate": "2014-12-19T10:00:00",
    "ToDate": "2014-12-23T09:59:00"
    },
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-12-23T10:00:00",
    "ToDate": "2014-12-26T09:59:00"
    },
    {
    "Charge": 100,
    "ChargeType": 2,
    "Currency": null,
    "FromDate": "2014-12-26T09:59:01",
    "ToDate": "2014-12-30T23:59:59"
    }
    ],
    "LastCancellationDate": "2014-09-29T00:00:00",
    "CancellationPolicy": "Executive Room on Room basis#^#100.00% of total amount will be charged, If cancelled between 30-Sep-2014 00:00:00 and 19-Dec-2014 09:59:00.| Charge of 1 night(s) will be charged, If cancelled between 19-Dec-2014 10:00:00 and 23-Dec-2014 09:59:00.|100.00% of total amount will be charged, If cancelled between 23-Dec-2014 10:00:00 and 26-Dec-2014 09:59:00.|100.00% of total amount will be charged, If cancelled between 26-Dec-2014 09:59:01 and 30-Dec-2014 23:59:59.|#!#"
    }
    ]
    }}
  • AmitA's avatar
    AmitA
    Occasional Contributor
    Hi Jeshtha

    Thank you so much for the resolution