CenResService

<back to all web services

StayHistoryRequest

The following routes are available for this service:
GET/v2/stayhistory/{Query}/{CendynPropertyId}
GET/v2/stayhistory/{Query}
import Foundation
import ServiceStack

public class StayHistoryRequest : Codable
{
    public var cendynPropertyId:String?
    public var query:StayHistoryQueryType?
    public var id:String?

    required public init(){}
}

public enum StayHistoryQueryType : String, Codable
{
    case ProfileId
    case ResId
}

public class StayHistoryResponse : CenResResponse
{
    public var records:[StayHistory] = []

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case records
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        records = try container.decodeIfPresent([StayHistory].self, forKey: .records) ?? []
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if records.count > 0 { try container.encode(records, forKey: .records) }
    }
}

public class CenResResponse : Codable
{
    public var status:RequestStatus?
    public var statusMessage:String?
    public var recordsReturned:Int?
    public var recordsAvailable:Int?
    public var pageNumber:Int?
    public var pageSize:Int?

    required public init(){}
}

public enum RequestStatus : String, Codable
{
    case Success
    case Warning
    case Error
    case NotAuthorized
    case Failure
}

public class StayHistory : Codable
{
    public var cendynPropertyID:String?
    public var resortID:String?
    public var externalProfileID1:String?
    public var externalResId1:String?
    public var crsBookNo:String?
    public var resortBookNo:String?
    public var resortLegNo:Int?
    public var confirmationID:String?
    public var reservationStatus:String?
    public var hasDailyRooms:Bool?
    public var rateRoomType:String?
    public var actualArrivalDate:Date?
    public var actualDepartureDate:Date?
    public var bookDate:Date?
    public var bookedArrivalDate:Date?
    public var bookedDepartureDate:Date?
    public var compYN:String?
    public var adults:Int?
    public var children:Int?
    public var roomCategory:String?
    public var roomNumber:String?
    public var rateAmount:Double?
    public var rateCode:String?
    public var rateAmountCurrencyCode:String?
    public var currencyCode:String?
    public var sourceCode:String?
    public var marketCode:String?
    public var travelAgentID:String?
    public var companyID:String?
    public var channel:String?
    public var paymentMethod:String?
    public var rateCurrencyCode:String?
    public var totalRevenue:Double?
    public var roomRevenue:Double?
    public var fbRevenue:Double?
    public var membershipType:String?
    public var membershipID:String?
    public var transactionID:String?
    public var transactionStatus:String?
    public var uniqueIDs:[UniqueIDType] = []
    public var stayHistoryRevenueCollection:[StayHistoryRevenue] = []
    public var stayHistoryDailyRateCollection:[StayHistoryDailyRate] = []

    required public init(){}
}

public class UniqueIDType : Codable
{
    public var id:String?
    public var type:String?
    public var context:String?

    required public init(){}
}

public class StayHistoryRevenue : Codable
{
    public var recordStatus:String?
    // @DataMember(IsRequired=true)
    public var revenueGroup:String?

    // @DataMember(IsRequired=true)
    public var revenueType:String?

    // @DataMember(IsRequired=true)
    public var amount:Double?

    public var currencyCode:String?
    public var folioWindow:String?
    public var transactionDate:Date?
    public var inactiveDate:Date?

    required public init(){}
}

public class StayHistoryDailyRate : Codable
{
    public var recordStatus:String?
    public var transactionDate:Date?
    public var rateCode:String?
    public var marketCode:String?
    public var amount:Double?
    public var currencyCode:String?
    public var roomNumber:String?
    public var resourceID:String?
    public var pseudoRoom:String?
    public var roomCategory:String?
    public var rateRoomType:String?
    public var inactiveDate:Date?

    required public init(){}
}


Swift StayHistoryRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v2/stayhistory/{Query}/{CendynPropertyId} HTTP/1.1 
Host: cert.cendyn.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<StayHistoryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CenResSS.ServiceModel">
  <PageNumber>0</PageNumber>
  <PageSize>0</PageSize>
  <RecordsAvailable>0</RecordsAvailable>
  <RecordsReturned>0</RecordsReturned>
  <Status>Success</Status>
  <StatusMessage>String</StatusMessage>
  <Records>
    <StayHistory>
      <ActualArrivalDate>0001-01-01T00:00:00</ActualArrivalDate>
      <ActualDepartureDate>0001-01-01T00:00:00</ActualDepartureDate>
      <Adults>0</Adults>
      <BookDate>0001-01-01T00:00:00</BookDate>
      <BookedArrivalDate>0001-01-01T00:00:00</BookedArrivalDate>
      <BookedDepartureDate>0001-01-01T00:00:00</BookedDepartureDate>
      <CRSBookNo>String</CRSBookNo>
      <CendynPropertyID>String</CendynPropertyID>
      <Channel>String</Channel>
      <Children>0</Children>
      <CompYN>String</CompYN>
      <CompanyID>String</CompanyID>
      <ConfirmationID>String</ConfirmationID>
      <CurrencyCode>String</CurrencyCode>
      <ExternalProfileID1>String</ExternalProfileID1>
      <ExternalResId1>String</ExternalResId1>
      <FbRevenue>0</FbRevenue>
      <HasDailyRooms>false</HasDailyRooms>
      <MarketCode>String</MarketCode>
      <MembershipID>String</MembershipID>
      <MembershipType>String</MembershipType>
      <PaymentMethod>String</PaymentMethod>
      <RateAmount>0</RateAmount>
      <RateAmountCurrencyCode>String</RateAmountCurrencyCode>
      <RateCode>String</RateCode>
      <RateCurrencyCode>String</RateCurrencyCode>
      <RateRoomType>String</RateRoomType>
      <ReservationStatus>String</ReservationStatus>
      <ResortBookNo>String</ResortBookNo>
      <ResortID>String</ResortID>
      <ResortLegNo>0</ResortLegNo>
      <RoomCategory>String</RoomCategory>
      <RoomNumber>String</RoomNumber>
      <RoomRevenue>0</RoomRevenue>
      <SourceCode>String</SourceCode>
      <StayHistoryDailyRateCollection>
        <StayHistoryDailyRate>
          <Amount>0</Amount>
          <CurrencyCode>String</CurrencyCode>
          <InactiveDate>0001-01-01T00:00:00</InactiveDate>
          <MarketCode>String</MarketCode>
          <PseudoRoom>String</PseudoRoom>
          <RateCode>String</RateCode>
          <RateRoomType>String</RateRoomType>
          <RecordStatus>String</RecordStatus>
          <ResourceID>String</ResourceID>
          <RoomCategory>String</RoomCategory>
          <RoomNumber>String</RoomNumber>
          <TransactionDate>0001-01-01T00:00:00</TransactionDate>
        </StayHistoryDailyRate>
      </StayHistoryDailyRateCollection>
      <StayHistoryRevenueCollection>
        <StayHistoryRevenue>
          <Amount>0</Amount>
          <CurrencyCode>String</CurrencyCode>
          <FolioWindow>String</FolioWindow>
          <InactiveDate>0001-01-01T00:00:00</InactiveDate>
          <RecordStatus>String</RecordStatus>
          <RevenueGroup>String</RevenueGroup>
          <RevenueType>String</RevenueType>
          <TransactionDate>0001-01-01T00:00:00</TransactionDate>
        </StayHistoryRevenue>
      </StayHistoryRevenueCollection>
      <TotalRevenue>0</TotalRevenue>
      <TransactionID>String</TransactionID>
      <TransactionStatus>String</TransactionStatus>
      <TravelAgentID>String</TravelAgentID>
      <UniqueIDs>
        <UniqueIDType>
          <Context>String</Context>
          <ID>String</ID>
          <Type>String</Type>
        </UniqueIDType>
      </UniqueIDs>
    </StayHistory>
  </Records>
</StayHistoryResponse>