{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/upsellguru/json-schema/upsellguru-save-booked-extra-request-schema.json",
  "title": "SaveBookedExtraRequest",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/upsellguru-openapi.yml#/components/schemas/SaveBookedExtraRequest",
  "type": "object",
  "required": [
    "hotelId",
    "reservationId",
    "extraTypeId",
    "touchpoint",
    "sourceChannel",
    "price",
    "quantity"
  ],
  "properties": {
    "hotelId": {
      "type": "integer",
      "description": "The Hotel ID"
    },
    "reservationId": {
      "type": "integer",
      "description": "The Reservation ID"
    },
    "extraTypeId": {
      "type": "integer",
      "description": "The Extra Type ID"
    },
    "variationId": {
      "type": "integer",
      "description": "The Extra Type variation ID"
    },
    "quantity": {
      "type": "integer",
      "description": "Quantity of the extra being booked"
    },
    "price": {
      "type": "number",
      "format": "float",
      "description": "Price per unit"
    },
    "dynamicPricing": {
      "type": "object",
      "description": "Map of variations with their quantities and prices",
      "required": [
        "range",
        "roomTypePrice",
        "limit"
      ],
      "properties": {
        "limit": {
          "type": "string",
          "description": "End date for the dynamic pricing"
        },
        "range": {
          "type": "object",
          "description": "Quantity of the extra being booked",
          "properties": {
            "fromHour": {
              "type": "integer",
              "description": "Start time (in hours) for applying dynamic pricing rules"
            },
            "toHour": {
              "type": "integer",
              "description": "End time (in hours) for applying dynamic pricing rules"
            },
            "roomRatePercentage": {
              "type": "integer",
              "description": "Room rate percentage used for dynamic pricing"
            }
          }
        },
        "roomTypePrice": {
          "type": "object",
          "description": "Dynamic pricing details (required only for dynamic pricing model)",
          "properties": {
            "amount": {
              "type": "number",
              "format": "float",
              "description": "Price"
            },
            "currency": {
              "type": "string",
              "description": "Currency"
            }
          }
        }
      }
    },
    "touchpoint": {
      "$ref": "#/$defs/Touchpoint"
    },
    "sourceChannel": {
      "$ref": "#/$defs/SourceChannel"
    }
  },
  "$defs": {
    "SourceChannel": {
      "type": "string",
      "enum": [
        "EMAIL",
        "SMS",
        "WHATSAPP",
        "QR_CODE",
        "AT_DESK",
        "PHONE"
      ]
    },
    "Touchpoint": {
      "type": "string",
      "enum": [
        "AT_RESERVATION",
        "RESERVATION_CONFIRMATION",
        "PRE_ARRIVAL_UPSELLING",
        "PRE_ARRIVAL_UPSELLING_REMINDER",
        "ALTERNATIVE_UPGRADE",
        "GUEST_RETARGETING",
        "REGISTRATION_CARD",
        "FRONT_DESK",
        "SPA",
        "F_AND_B",
        "INHOUSE_EXTRAS",
        "HOTEL_DIRECTORY"
      ]
    }
  }
}