# Room Rates Push

The Room Rates Push service allows you to receive real-time updates about room rates and availability directly from hotels. This service is part of our Smart Feed API and provides instant notifications when rates change.

# Authentication & Authorization

It follows standard UBIO authentication and authorization process. Please refer to the authentication documentation for more details.

# Common Response Codes

  • 200 OK - Request successful
  • 400 Bad Request - Invalid request parameters
  • 401 Unauthorized - Invalid or missing authentication
  • 403 Forbidden - Valid authentication but insufficient permissions
  • 404 Not Found - Resource not found
  • 500 Server Error - Internal server error

# Push Request Structure

Field Type Description
hotelId string Unique identifier for the hotel
checkIn string Check-in date in YYYY-MM-DD format
nights number Number of nights for the stay
guests array Array of guest numbers for each room
rooms array Array of room objects with updated rates

# How It Works

  1. Hotels send real-time updates about room rates and availability
  2. Updates are pushed to your configured endpoint
  3. Your system processes the updates and updates its database
  4. Changes are immediately reflected in your application

# Client Requirements

  • Must have a publicly accessible HTTPS endpoint
  • Must respond within 5 seconds
  • Must handle concurrent requests
  • Must implement proper error handling
  • Must validate incoming data
  • Must acknowledge receipt of updates

# Important Data Handling Guidelines

  1. Complete State Updates: Each push request contains the complete state for the specified hotel and date range
  2. Empty Room Sets: An empty rooms array indicates no availability
  3. Rate Changes: All rate changes must be processed immediately
  4. Data Validation: Validate all incoming data before processing
  5. Error Handling: Implement proper error handling for malformed requests
  6. Idempotency: Handle duplicate updates gracefully
  7. Concurrency: Process concurrent updates correctly
  8. Data Persistence: Store updates reliably

# Request Format

# Headers

  • Authorization (string, required): The basic authorization header to authorize against the API.

    • Format: Authorization: Basic {base64_encoded_credentials}
    • Example: Authorization: Basic QVBJX0tFWTo=

    Note: You must include valid API credentials encoded in base64 format. Contact your system administrator for proper authentication credentials.

# Request Body

{
  "hotelId": "string",
  "checkIn": "string",
  "nights": "number",
  "guests": ["number"],
  "rooms": [
    {
      "name": "string",
      "id": "string",
      "description": "string",
      "capacity": "number",
      "rates": [
        {
          "rateId": "string",
          "price": "number",
          "currency": "string",
          "cancellationPolicy": "string",
          "boardBasis": "string",
          "available": "boolean"
        }
      ]
    }
  ]
}

# Example Push Request

{
  "hotelId": "hotel-id-333",
  "checkIn": "2024-03-20",
  "nights": 2,
  "guests": [2],
  "rooms": [
    {
      "name": "Deluxe Room",
      "id": "room-123",
      "description": "Spacious room with city view",
      "capacity": 2,
      "rates": [
        {
          "rateId": "rate-456",
          "price": 150.00,
          "currency": "USD",
          "cancellationPolicy": "Free cancellation until 24h before check-in",
          "boardBasis": "Room Only",
          "available": true
        }
      ]
    }
  ]
}

# Response Requirements

Your endpoint must respond with:

  1. HTTP 200 OK for successful processing
  2. HTTP 400 Bad Request for invalid data
  3. HTTP 500 Server Error for processing failures

# Example Success Response

{
  "status": "success",
  "message": "Update processed successfully"
}

# Example Error Response

{
  "status": "error",
  "message": "Invalid request data",
  "details": {
    "field": "price",
    "error": "Price must be greater than 0"
  }
}