{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hotel-engine/json-schema/hotel-engine-v1-preview-cancellation-response-schema.json",
  "title": "Book_Lodging_Service_PreviewCancellationResponse_v1",
  "description": "Returns the expected result and availability of a cancellation.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hotel-engine-lodgingbookingservice-api-openapi.yml#/components/schemas/v1PreviewCancellationResponse",
  "type": "object",
  "properties": {
    "availableActions": {
      "$ref": "#/$defs/v1AvailableActions",
      "description": "Details the means in which a cancellation could occur."
    },
    "refund": {
      "$ref": "#/$defs/v1Refund",
      "description": "Optionally, the refund details if they can be determined.\nIf cancellation is not possible or cannot be done through the API, this field will not be set.\nSee [ActionAvailability] for more information."
    }
  },
  "$defs": {
    "v1ActionAvailability": {
      "type": "string",
      "enum": [
        "ACTION_AVAILABILITY_UNKNOWN",
        "ACTION_AVAILABILITY_UNAVAILABLE",
        "ACTION_AVAILABILITY_AVAILABLE",
        "ACTION_AVAILABILITY_AVAILABLE_VIA_VENDOR",
        "ACTION_AVAILABILITY_AVAILABLE_VIA_SUPPORT"
      ],
      "default": "ACTION_AVAILABILITY_UNKNOWN",
      "description": "Describes the means by which an action may be taken on a [BookingDetails].\n\n - ACTION_AVAILABILITY_UNKNOWN: It is unknown if the action is available. It might be available directly through the vendor.\n - ACTION_AVAILABILITY_UNAVAILABLE: The action is not available through the API. It is unknown whether it can be performed in another context, such as through the vendor or support.\n - ACTION_AVAILABILITY_AVAILABLE: The action is available through the API.\n - ACTION_AVAILABILITY_AVAILABLE_VIA_VENDOR: The action is available, but only through the service provider.\n - ACTION_AVAILABILITY_AVAILABLE_VIA_SUPPORT: The action is available, but only through customer support.",
      "title": "Common_ActionAvailability_v1"
    },
    "v1AvailableActions": {
      "type": "object",
      "properties": {
        "cancel": {
          "$ref": "#/$defs/v1ActionAvailability",
          "description": "Describes the availability of the cancel action."
        },
        "modify": {
          "$ref": "#/$defs/v1ActionAvailability",
          "description": "Describes the availability of the modify action."
        }
      },
      "description": "Describes the availability of actions on a [BookingDetails].",
      "title": "Common_AvailableActions_v1"
    },
    "v1CurrencyValue": {
      "type": "object",
      "properties": {
        "currencyCode": {
          "type": "string",
          "title": "The 3-character ISO-4217 alphabetic currency code.\nFor example: USD\nSee https://www.iso.org/iso-4217-currency-codes.html"
        },
        "value": {
          "type": "string",
          "description": "The non-localized decimal representation of the amount of currency represented by this object.\nFor example, \"123456.789\"."
        }
      },
      "description": "A safe encoding of a monetary value and its paired currency code.",
      "title": "Common_CurrencyValue_v1"
    },
    "v1Refund": {
      "type": "object",
      "properties": {
        "amount": {
          "$ref": "#/$defs/v1CurrencyValue",
          "description": "The full amount of the refund."
        }
      },
      "description": "Details that describe any refund due or granted related to a modification or cancellation of a [BookingDetails].",
      "title": "Common_Refund_v1"
    }
  }
}