{
 "openapi": "3.1.0",
 "info": {
  "title": "Albergance agent API",
  "version": "2026-11-26",
  "description": "Read-only pricing and requests confirmed by a person. Ordering, accounts and module settings are not open yet.",
  "contact": {
   "email": "hello@albergance.com"
  }
 },
 "servers": [
  {
   "url": "https://albergance.com"
  }
 ],
 "paths": {
  "/api/quote.php": {
   "get": {
    "operationId": "quote",
    "summary": "Exact monthly price of a set of modules",
    "parameters": [
     {
      "name": "rooms",
      "in": "query",
      "required": true,
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "name": "modules",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Comma-separated: signal,desk,welcome,outbound,shift,supply,pilot,compset,yield"
     },
     {
      "name": "employees",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 20
      },
      "description": "Employees of the property; prices Shift (39 EUR up to 20, 69 EUR up to 50, 125 EUR up to 100, then 1.10 EUR per extra employee, annual commitment)"
     },
     {
      "name": "yield_level",
      "in": "query",
      "schema": {
       "enum": [
        "standard",
        "intensive"
       ],
       "default": "standard"
      }
     },
     {
      "name": "billing",
      "in": "query",
      "schema": {
       "enum": [
        "annual",
        "monthly"
       ],
       "default": "annual"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Price breakdown, excluding VAT",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "lines": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "module": {
              "type": "string"
             },
             "monthly_price": {
              "type": "number"
             }
            }
           }
          },
          "monthly_total": {
           "type": "number"
          },
          "billed_upfront_for_12_months": {
           "type": [
            "number",
            "null"
           ]
          },
          "currency": {
           "const": "EUR"
          },
          "notes": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid parameters"
     }
    }
   }
  },
  "/api/request.php": {
   "post": {
    "operationId": "sendRequest",
    "summary": "Send a request on behalf of a hotel; a person confirms it by email",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "https://albergance.com/agents/request.schema.json"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "Received",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "const": true
          },
          "reference": {
           "type": "string"
          },
          "status": {
           "const": "received"
          },
          "next_step": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid request, with the list of errors"
     },
     "429": {
      "description": "Too many requests from this address"
     },
     "503": {
      "description": "Not sent; email hello@albergance.com instead"
     }
    }
   }
  }
 }
}
