{
  "openapi": "3.1.0",
  "info": {
    "title": "HSビルワーキングスペース API",
    "description": "奈良・大和西大寺のコワーキングスペース予約API。空き確認・予約URL生成・ライブステータス取得が可能です。",
    "version": "2.8.0",
    "contact": {
      "name": "FULMiRA Japan合同会社",
      "email": "contact@hsworking.com",
      "url": "https://www.hsworking.com/"
    }
  },
  "servers": [
    {
      "url": "https://www.hsworking.com/_functions",
      "description": "Production"
    }
  ],
  "paths": {
    "/a2a_catalog": {
      "get": {
        "operationId": "getCatalog",
        "summary": "全サービス一覧を取得",
        "description": "コワーキング・個室ブース・会議室・音楽スタジオの全プランと料金を返します。",
        "responses": {
          "200": {
            "description": "サービスカタログ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "services": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "service_id": {
                            "type": "string"
                          },
                          "name_ja": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "offers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "offer_id": {
                                  "type": "string"
                                },
                                "name_ja": {
                                  "type": "string"
                                },
                                "price_jpy": {
                                  "type": "number"
                                },
                                "duration_minutes": {
                                  "type": "number"
                                },
                                "book_url": {
                                  "type": "string"
                                },
                                "service_wix_id": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/a2a_availability": {
      "get": {
        "operationId": "checkAvailability",
        "summary": "指定日の空き状況を確認",
        "description": "指定したサービスと日付の空き時間スロットを返します。",
        "parameters": [
          {
            "name": "service_wix_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "a2a_catalogで取得したサービスID"
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "確認したい日付（YYYY-MM-DD、JST）"
          }
        ],
        "responses": {
          "200": {
            "description": "空き時間スロット一覧",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string"
                    },
                    "service_wix_id": {
                      "type": "string"
                    },
                    "slots": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "start": {
                            "type": "string"
                          },
                          "end": {
                            "type": "string"
                          },
                          "bookable": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/a2a_booking_link": {
      "get": {
        "operationId": "getBookingLink",
        "summary": "予約URLを生成",
        "description": "サービスID・日付・開始時刻を指定して予約フォームURLを生成。初回クーポンWELCOME10が自動付与。",
        "parameters": [
          {
            "name": "service_wix_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "サービスID"
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "予約日（YYYY-MM-DD）"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "開始時刻（HH:MM、JST）"
          }
        ],
        "responses": {
          "200": {
            "description": "予約フォームURL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "booking_form_url": {
                      "type": "string"
                    },
                    "service_wix_id": {
                      "type": "string"
                    },
                    "offer_id": {
                      "type": "string"
                    },
                    "coupon": {
                      "type": "string"
                    },
                    "line_message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/a2a_live_status": {
      "get": {
        "operationId": "getLiveStatus",
        "summary": "現在のリアルタイム稼働状況",
        "description": "現在の空席数・混雑度・営業状態をリアルタイムで返します。",
        "responses": {
          "200": {
            "description": "ライブステータス",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "is_open": {
                      "type": "boolean"
                    },
                    "congestion_level": {
                      "type": "string"
                    },
                    "current_occupancy": {
                      "type": "integer"
                    },
                    "max_capacity": {
                      "type": "integer"
                    },
                    "updated_at": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/a2a_agent_card": {
      "get": {
        "operationId": "getAgentCard",
        "summary": "エージェントカード取得",
        "description": "HSビルのAIエージェント情報を返します。",
        "responses": {
          "200": {
            "description": "エージェントカード",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "capabilities": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/a2a_facts": {
      "get": {
        "operationId": "getFacts",
        "summary": "施設のファクト情報",
        "description": "住所・営業時間・アメニティ・アクセスなど施設の基本情報を返します。",
        "responses": {
          "200": {
            "description": "施設ファクト",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "hours": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "amenities": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "access": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}