{
  "openapi": "3.1.0",
  "info": {
    "title": "Hotel Bergsonne Allgäu Booking API",
    "version": "1.2.0",
    "description": "Search availability, get pricing, and create reservations at Hotel Bergsonne Allgäu. All query parameters are case-insensitive. Dates accept YYYY-MM-DD, DD.MM.YYYY, MM/DD/YYYY, or natural language. roomId values are abbreviation codes (KAPDZ, KDZ, KFZ, SDZ) returned by the availability endpoint. All prices are in EUR, inclusive of VAT.",
    "contact": {
      "name": "Hotel Bergsonne Allgäu",
      "url": "https://bergsonne-allgaeu.de",
      "email": "servus@bergsonne-allgaeu.de"
    }
  },
  "servers": [
    {
      "url": "https://bergsonne-allgaeu.de/api/booking",
      "description": "Production Booking API"
    }
  ],
  "security": [],
  "components": {
    "securitySchemes": {},
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        }
      }
    }
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "routeByAction",
        "summary": "Route to booking actions via ?action= parameter",
        "description": "Single-endpoint design: use the action query parameter to select the operation. Actions: hotel, availability, price-quote, fact-sheet. See individual operation schemas below under /hotel, /availability, /price-quote, /fact-sheet.",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "hotel",
                "availability",
                "price-quote",
                "fact-sheet"
              ]
            },
            "description": "The action to perform"
          }
        ],
        "responses": {
          "200": {
            "description": "See individual action schemas"
          }
        },
        "x-openai-isConsequential": false
      }
    },
    "/hotel": {
      "get": {
        "operationId": "getHotelDetails",
        "summary": "Get hotel metadata, amenities, and room types",
        "description": "Returns hotel info, address, contact, room types with abbreviation codes (KAPDZ, KDZ, KFZ, SDZ), and check-in/out times. Call via: GET /?action=hotel",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "hotel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Hotel details with room types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "example": "Hotel Bergsonne Allgäu"
                    },
                    "address": {
                      "type": "object",
                      "properties": {
                        "street": {
                          "type": "string"
                        },
                        "city": {
                          "type": "string"
                        },
                        "postalCode": {
                          "type": "string"
                        },
                        "country": {
                          "type": "string"
                        }
                      }
                    },
                    "checkIn": {
                      "type": "string",
                      "example": "15:00"
                    },
                    "checkOut": {
                      "type": "string",
                      "example": "10:30"
                    },
                    "roomTypes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "roomId": {
                            "type": "string",
                            "enum": [
                              "KAPDZ",
                              "KDZ",
                              "KFZ",
                              "SDZ"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "maxOccupancy": {
                            "type": "integer"
                          },
                          "sizeSqm": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "amenities": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "images": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string"
                          },
                          "caption": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-openai-isConsequential": false
      }
    },
    "/availability": {
      "get": {
        "operationId": "searchAvailability",
        "summary": "Search room availability and pricing",
        "description": "Returns available room types with roomId codes for given dates and guest count. Dates accept YYYY-MM-DD, DD.MM.YYYY, MM/DD/YYYY, or natural language. Call via: GET /?action=availability",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "availability"
            }
          },
          {
            "name": "checkIn",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-03-01"
            },
            "description": "Check-in date"
          },
          {
            "name": "checkOut",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-03-03"
            },
            "description": "Check-out date"
          },
          {
            "name": "adults",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 2
            },
            "description": "Number of adults"
          },
          {
            "name": "children",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of children"
          }
        ],
        "responses": {
          "200": {
            "description": "Available room types with pricing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hotel": {
                      "type": "string"
                    },
                    "checkIn": {
                      "type": "string"
                    },
                    "checkOut": {
                      "type": "string"
                    },
                    "guests": {
                      "type": "object",
                      "properties": {
                        "adults": {
                          "type": "integer"
                        },
                        "children": {
                          "type": "integer"
                        }
                      }
                    },
                    "roomTypes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "roomId": {
                            "type": "string",
                            "description": "Abbreviation code to use in getPriceQuote and createBooking"
                          },
                          "name": {
                            "type": "string"
                          },
                          "available": {
                            "type": "boolean"
                          },
                          "rateId": {
                            "type": "string"
                          },
                          "price": {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "number"
                              },
                              "currency": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-openai-isConsequential": false
      }
    },
    "/price-quote": {
      "get": {
        "operationId": "getPriceQuote",
        "summary": "Get nightly price breakdown for a room type",
        "description": "Returns detailed nightly pricing for a specific room type and date range. roomId must be an abbreviation code from the availability response. Call via: GET /?action=price-quote",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "price-quote"
            }
          },
          {
            "name": "roomId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "KAPDZ",
                "KDZ",
                "KFZ",
                "SDZ"
              ]
            },
            "description": "Room type abbreviation code"
          },
          {
            "name": "checkIn",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-03-01"
            },
            "description": "Check-in date"
          },
          {
            "name": "checkOut",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-03-03"
            },
            "description": "Check-out date"
          },
          {
            "name": "adults",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 2
            },
            "description": "Number of adults"
          }
        ],
        "responses": {
          "200": {
            "description": "Nightly price breakdown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "roomId": {
                      "type": "string"
                    },
                    "roomName": {
                      "type": "string"
                    },
                    "checkIn": {
                      "type": "string"
                    },
                    "checkOut": {
                      "type": "string"
                    },
                    "nights": {
                      "type": "integer"
                    },
                    "nightlyBreakdown": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "number"
                          },
                          "currency": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "totalPrice": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-openai-isConsequential": false
      }
    },
    "/fact-sheet": {
      "get": {
        "operationId": "getFactSheet",
        "summary": "Full GIATA property fact sheet",
        "description": "Returns the complete property fact sheet with descriptions, amenities, images, and room classifications. German content only. Call via: GET /?action=fact-sheet",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "fact-sheet"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Property fact sheet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "property": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "giataId": {
                          "type": "integer"
                        }
                      }
                    },
                    "descriptions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "category": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "amenities": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "rooms": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "images": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-openai-isConsequential": false
      }
    },
    "/bookings": {
      "post": {
        "operationId": "createBooking",
        "summary": "Create a hotel reservation",
        "description": "Creates a real reservation at Hotel Bergsonne Allgäu. Requires user confirmation. Add test:true to the body for sandbox mode (no real reservation created). Add idempotencyKey to prevent duplicate bookings on retries. Call via: POST /?action=bookings",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "bookings"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "roomId",
                  "rateId",
                  "checkIn",
                  "checkOut",
                  "adults",
                  "customer"
                ],
                "properties": {
                  "roomId": {
                    "type": "string",
                    "enum": [
                      "KAPDZ",
                      "KDZ",
                      "KFZ",
                      "SDZ"
                    ],
                    "description": "Room type abbreviation code from availability results"
                  },
                  "rateId": {
                    "type": "string",
                    "description": "Rate plan ID (from availability/price-quote)"
                  },
                  "checkIn": {
                    "type": "string",
                    "example": "2026-03-01",
                    "description": "Check-in date (YYYY-MM-DD)"
                  },
                  "checkOut": {
                    "type": "string",
                    "example": "2026-03-03",
                    "description": "Check-out date (YYYY-MM-DD)"
                  },
                  "adults": {
                    "type": "integer",
                    "minimum": 1,
                    "example": 2
                  },
                  "children": {
                    "type": "integer",
                    "minimum": 0,
                    "default": 0
                  },
                  "customer": {
                    "type": "object",
                    "required": [
                      "firstName",
                      "lastName",
                      "email",
                      "phone",
                      "country"
                    ],
                    "properties": {
                      "firstName": {
                        "type": "string",
                        "example": "Max"
                      },
                      "lastName": {
                        "type": "string",
                        "example": "Mustermann"
                      },
                      "email": {
                        "type": "string",
                        "format": "email",
                        "example": "max@example.com"
                      },
                      "phone": {
                        "type": "string",
                        "example": "+49 170 1234567"
                      },
                      "country": {
                        "type": "string",
                        "example": "DE",
                        "description": "ISO country code"
                      },
                      "salutation": {
                        "type": "string",
                        "example": "Herr"
                      },
                      "address": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "zip": {
                        "type": "string"
                      },
                      "remarks": {
                        "type": "string",
                        "description": "Special requests or notes"
                      }
                    }
                  },
                  "test": {
                    "type": "boolean",
                    "default": false,
                    "description": "Set to true for sandbox mode. Returns a TEST bookingId without creating a real reservation."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Unique key to prevent duplicate bookings on retries."
                  }
                }
              },
              "example": {
                "roomId": "KAPDZ",
                "rateId": "1",
                "checkIn": "2026-03-01",
                "checkOut": "2026-03-03",
                "adults": 2,
                "customer": {
                  "firstName": "Max",
                  "lastName": "Mustermann",
                  "email": "max@example.com",
                  "phone": "+49 170 1234567",
                  "country": "DE"
                },
                "test": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Booking created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bookingId": {
                      "type": "string"
                    },
                    "roomId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "confirmed",
                        "pending",
                        "test_created"
                      ]
                    },
                    "checkIn": {
                      "type": "string"
                    },
                    "checkOut": {
                      "type": "string"
                    },
                    "totalPrice": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        }
                      }
                    },
                    "_pricing": {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string"
                        },
                        "taxIncluded": {
                          "type": "boolean"
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-openai-isConsequential": true
      }
    }
  }
}