{
  "openapi": "3.1.0",
  "info": {
    "title": "Osynlig tandställning Göteborg — begär offert",
    "version": "1.0.0",
    "description": "Skickar en offertförfrågan för information och prisuppgift för osynlig tandställning i Göteborg. Användaren måste ha samtyckt (consent=true)."
  },
  "servers": [
    {
      "url": "https://osynligtandstallninggoteborg.se"
    }
  ],
  "paths": {
    "/api/offert": {
      "post": {
        "operationId": "begarOffert",
        "summary": "Begär offert",
        "parameters": [
          {
            "name": "X-Dry-Run",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Validera utan att skicka."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Offert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Torrkörning giltig"
          },
          "202": {
            "description": "Förfrågan mottagen"
          },
          "400": {
            "description": "epost saknas eller är ogiltig (ogiltig JSON ger också 400)"
          },
          "422": {
            "description": "Valideringsfel"
          },
          "429": {
            "description": "För många förfrågningar"
          }
        }
      },
      "get": {
        "operationId": "beskrivning",
        "summary": "Kort beskrivning av API:t",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Offert": {
        "type": "object",
        "required": [
          "namn",
          "epost",
          "ort",
          "beskrivning",
          "consent"
        ],
        "properties": {
          "namn": {
            "type": "string",
            "maxLength": 120
          },
          "telefon": {
            "type": "string",
            "maxLength": 40,
            "description": "Valfritt, i tillägg till epost."
          },
          "epost": {
            "type": "string",
            "format": "email",
            "description": "Obligatorisk. Giltig e-postadress. Endast telefon accepteras inte.",
            "maxLength": 160
          },
          "ort": {
            "type": "string",
            "maxLength": 120
          },
          "tjanst": {
            "type": "string",
            "description": "Invisalign | Osynlig tandställning | Pris | Vuxen | Konsultation | Annat"
          },
          "beskrivning": {
            "type": "string",
            "maxLength": 2000
          },
          "consent": {
            "type": "boolean",
            "const": true,
            "description": "Användaren har samtyckt till att vi behandlar uppgifterna."
          },
          "agente_nome": {
            "type": "string",
            "maxLength": 80,
            "description": "Namn på agenten som skickar."
          }
        }
      }
    }
  }
}