{
 "openapi": "3.1.0",
 "info": {
  "title": "Vidhave API",
  "version": "1.0.0",
  "summary": "Öppettider, status, prislista och statistik för Vidhave på Gotland.",
  "description": "Öppna data utan inloggning för de öppna vägarna. Tider i lokal tid (Europe/Stockholm), belopp i SEK. Varje JSON-svar bär sin egen beskrivning i fältet `_readme`: parametrar, fält och tjänstekatalog. Läs den först.\n\nOpen data, no sign-in for the open paths. Local time (Europe/Stockholm), amounts in SEK. Every JSON answer describes itself in `_readme`.",
  "contact": {
   "name": "Vidhave",
   "email": "booking@vidhave.se",
   "url": "https://vidhave.se"
  }
 },
 "servers": [
  {
   "url": "https://api.vidhave.se"
  }
 ],
 "tags": [
  {
   "name": "Öppettider",
   "description": "Opening hours and open/closed status"
  },
  {
   "name": "Priser",
   "description": "Prislistan för grupper, företag och specialarrangemang (offerter) – inte priser för enskilda bokningar; de ges av /v1/bookingLink. / Price list for groups, companies and special events (quotes) – not prices for individual bookings; those come from /v1/bookingLink."
  },
  {
   "name": "Statistik",
   "description": "Booking statistics"
  },
  {
   "name": "Förfrågan",
   "description": "Förslag och offertförfrågningar från landningssidorna för grupper / Proposals and quote requests from the group landing pages"
  },
  {
   "name": "Sidor",
   "description": "Landningssidor ritade på servern / Server-rendered landing pages"
  },
  {
   "name": "Presentkort",
   "description": "Värdebevis: utfärda och betala med presentkort från Vidhave / Gift cards: issue and pay with Vidhave value vouchers"
  },
  {
   "name": "Bokning",
   "description": "Bordsbokning åt en gäst, för assistenter. Gästen bekräftar själv via SMS."
  },
  {
   "name": "Erbjudanden",
   "description": "Vad som går att boka runt ett pass eller en planerad tid"
  }
 ],
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "x-api-key",
    "description": "En nyckel per person, utfärdad av Vidhave. Nyckeln bär de omfång personen behöver."
   },
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer",
    "description": "An API key (exk_…)."
   },
   "apiKeyAuth": {
    "type": "apiKey",
    "in": "header",
    "name": "X-Api-Key"
   }
  },
  "schemas": {
   "draftProblem": {
    "type": "object",
    "required": [
     "kind",
     "text",
     "detail"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "description": "The check's kind of problem, or `removal`."
     },
     "text": {
      "type": "string",
      "description": "The problem in words (Swedish), naming the package or Product."
     },
     "detail": {
      "type": "string",
      "description": "The check's own message."
     }
    }
   },
   "draftLine": {
    "type": "object",
    "required": [
     "kind",
     "key",
     "action",
     "name",
     "entity",
     "published",
     "writtenAt",
     "writtenBy"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "product",
       "place",
       "space",
       "season",
       "package_version"
      ]
     },
     "key": {
      "type": "string"
     },
     "action": {
      "type": "string",
      "enum": [
       "added",
       "changed",
       "removed"
      ]
     },
     "name": {
      "type": "string",
      "description": "The entity's name (as drafted, or as published for a removal)."
     },
     "entity": {
      "type": "object",
      "nullable": true,
      "additionalProperties": true,
      "description": "The whole entity as drafted, in the seed's shape (the domain type); null = removed."
     },
     "published": {
      "type": "object",
      "nullable": true,
      "additionalProperties": true,
      "description": "The entity as published now; null = new."
     },
     "writtenAt": {
      "type": "string",
      "format": "date-time"
     },
     "writtenBy": {
      "type": "string"
     }
    }
   }
  }
 },
 "paths": {
  "/statistik/dygnspris": {
   "get": {
    "tags": [
     "Statistik"
    ],
    "summary": "Genomsnittligt dygnspris per hustyp för en period",
    "description": "Totalpris per natt (boende + produkter), avrundat, mätt på utvalda nätter i perioden. Öppen utan nyckel. Med en nyckel i `x-api-key` som bär omfånget `statistik:belopp` följer också kallhyra, oavrundade belopp och antal med.",
    "security": [
     {},
     {
      "apiKey": []
     }
    ],
    "parameters": [
     {
      "name": "period",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "forsasong",
        "sommar",
        "vinter"
       ]
      }
     },
     {
      "name": "year",
      "in": "query",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "example": 2026
     }
    ],
    "responses": {
     "200": {
      "description": "JSON per hustyp.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   },
   "x-producer": "crm"
  },
  "/statistik/typpriser.md": {
   "get": {
    "tags": [
     "Statistik"
    ],
    "summary": "Typpriser per hustyp och period som markdown-tabell",
    "description": "Samma tabell som våra svarsförslag läser: genomsnittligt dygnspris per hustyp för de beräknade perioderna, bara öppna siffror (avrundade). Text, inte JSON.",
    "responses": {
     "200": {
      "description": "Markdown.",
      "content": {
       "text/markdown": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "404": {
      "description": "Inte beräknat än."
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/forfragan": {
   "post": {
    "tags": [
     "Förfrågan"
    ],
    "summary": "Be om offert: gästen vill bli kontaktad",
    "description": "Från landningssidorna för grupper. Förfrågan sparas och lämnas till Vidhaves bokning, som svarar gästen per mejl. Skicka guidens val som egna fält, inte bara som text. Bygger förfrågan på ett sparat förslag: skicka `forslag_id`. Ingenting bokas.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "namn",
         "epost"
        ],
        "properties": {
         "namn": {
          "type": "string"
         },
         "foretag": {
          "type": "string"
         },
         "telefon": {
          "type": "string"
         },
         "meddelande": {
          "type": "string"
         },
         "forslag_id": {
          "type": "string"
         },
         "typ": {
          "type": "string",
          "description": "mote | upplevelse"
         },
         "upplagg": {
          "type": "string",
          "description": "Paketets nyckel, t.ex. internat-2"
         },
         "sasong": {
          "type": "string",
          "description": "vinter | host | sommar"
         },
         "antal": {
          "type": "integer",
          "minimum": 1
         },
         "natter": {
          "type": "integer",
          "minimum": 0
         },
         "resa": {
          "type": "string",
          "description": "sthlm | gbg | egen"
         },
         "avreseort": {
          "type": "string"
         },
         "akt": {
          "type": "string",
          "description": "Nyckeln för vald aktivitet"
         },
         "tillagg": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Nycklar för valda tillägg"
         },
         "datum_fran": {
          "type": "string",
          "format": "date"
         },
         "datum_till": {
          "type": "string",
          "format": "date"
         },
         "ankomst": {
          "type": "string",
          "description": "Ungefärlig ankomsttid, fri text: 08.30, förmiddag"
         },
         "datum_text": {
          "type": "string",
          "description": "När datumen är öppna: vecka 12, eller mars"
         },
         "epost": {
          "type": "string",
          "format": "email"
         },
         "sida": {
          "type": "string",
          "description": "Sidans sökväg, t.ex. /konferensresa-gotland/"
         },
         "samtycke": {
          "type": "boolean",
          "description": "Behövs inte. Den som ber om ett förslag eller en offert har sagt ja till erbjudanden från Vidhave och lagras så; gästen avböjer i utskicken."
         },
         "utm_source": {
          "type": "string",
          "description": "a–z, 0–9, punkt och bindestreck, högst 30 tecken; annat blir okand"
         },
         "utm_medium": {
          "type": "string"
         },
         "utm_campaign": {
          "type": "string"
         },
         "webbplats": {
          "type": "string",
          "description": "Dolt fält på sidan. Ifyllt = robot: svaret är ok men inget sparas."
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Mottagen.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "id": {
           "type": "string",
           "example": "F-00012"
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Fel i frågan. `falt` listar fälten.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          },
          "requestId": {
           "type": "string"
          },
          "falt": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "För många från samma avsändare på en timme."
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/forslag": {
   "post": {
    "tags": [
     "Förfrågan"
    ],
    "summary": "Spara ett förslag som gästen satt ihop",
    "description": "Valen och priset gästen såg sparas under ett id. `lank` leder tillbaka till sidan i samma läge, Priset har inget slutdatum; det gäller så länge det finns plats (`giltig_till` är null). `mejl` är false tills mejlet med förslaget är byggt. Ingenting bokas och ingen kontaktar gästen på grund av ett sparat förslag.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "epost"
        ],
        "properties": {
         "pris_per_gast": {
          "type": "integer",
          "description": "Det gästen såg, kr exkl. moms"
         },
         "summa": {
          "type": "integer"
         },
         "paket_version": {
          "type": "string"
         },
         "typ": {
          "type": "string",
          "description": "mote | upplevelse"
         },
         "upplagg": {
          "type": "string",
          "description": "Paketets nyckel, t.ex. internat-2"
         },
         "sasong": {
          "type": "string",
          "description": "vinter | host | sommar"
         },
         "antal": {
          "type": "integer",
          "minimum": 1
         },
         "natter": {
          "type": "integer",
          "minimum": 0
         },
         "resa": {
          "type": "string",
          "description": "sthlm | gbg | egen"
         },
         "avreseort": {
          "type": "string"
         },
         "akt": {
          "type": "string",
          "description": "Nyckeln för vald aktivitet"
         },
         "tillagg": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Nycklar för valda tillägg"
         },
         "datum_fran": {
          "type": "string",
          "format": "date"
         },
         "datum_till": {
          "type": "string",
          "format": "date"
         },
         "ankomst": {
          "type": "string",
          "description": "Ungefärlig ankomsttid, fri text: 08.30, förmiddag"
         },
         "datum_text": {
          "type": "string",
          "description": "När datumen är öppna: vecka 12, eller mars"
         },
         "epost": {
          "type": "string",
          "format": "email"
         },
         "sida": {
          "type": "string",
          "description": "Sidans sökväg, t.ex. /konferensresa-gotland/"
         },
         "samtycke": {
          "type": "boolean",
          "description": "Behövs inte. Den som ber om ett förslag eller en offert har sagt ja till erbjudanden från Vidhave och lagras så; gästen avböjer i utskicken."
         },
         "utm_source": {
          "type": "string",
          "description": "a–z, 0–9, punkt och bindestreck, högst 30 tecken; annat blir okand"
         },
         "utm_medium": {
          "type": "string"
         },
         "utm_campaign": {
          "type": "string"
         },
         "webbplats": {
          "type": "string",
          "description": "Dolt fält på sidan. Ifyllt = robot: svaret är ok men inget sparas."
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Sparat.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "id": {
           "type": "string"
          },
          "lank": {
           "type": "string"
          },
          "giltig_till": {
           "type": [
            "string",
            "null"
           ],
           "format": "date-time",
           "description": "null: priset har inget slutdatum och gäller så länge det finns plats."
          },
          "mejl": {
           "type": "boolean"
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Fel i frågan. `falt` listar fälten.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          },
          "requestId": {
           "type": "string"
          },
          "falt": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "För många från samma avsändare på en timme."
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/forslag/{kod}": {
   "get": {
    "tags": [
     "Förfrågan"
    ],
    "summary": "Läs ett sparat förslag",
    "description": "Valen, priset gästen såg och om det fortfarande gäller (`galler`). Aldrig kontaktuppgifter.",
    "parameters": [
     {
      "name": "kod",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Förslaget.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "Inget sådant förslag."
     }
    }
   },
   "x-producer": "crm"
  },
  "/sidor/{slug}": {
   "get": {
    "tags": [
     "Sidor"
    ],
    "summary": "En landningssida som färdig HTML",
    "description": "Sidan ritad på servern för läget i adressen (typ, sasong, antal, natter, resa, akt, tillagg). Hämtas och cachas av vidhave.se, som visar den under sin egen adress. `forslag=<id>` öppnar ett sparat förslag. HTML, inte JSON.",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Sidan.",
      "content": {
       "text/html": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "404": {
      "description": "Ingen sådan sida, eller inte publicerad."
     }
    }
   },
   "x-producer": "crm"
  },
  "/sidor/bilder/{namn}": {
   "get": {
    "tags": [
     "Sidor"
    ],
    "summary": "En bild till en landningssida",
    "parameters": [
     {
      "name": "namn",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Bilden."
     },
     "404": {
      "description": "Ingen sådan bild."
     }
    }
   },
   "x-producer": "crm"
  },
  "/sidor/{slug}/llms.txt": {
   "get": {
    "tags": [
     "Sidor"
    ],
    "summary": "En landningssida som Markdown för assistenter",
    "description": "Samma innehåll som sidan, ritat ur samma filer: paketen med pris per gäst, vad som ingår, byten, tillägg, gruppstorlek per årstid, när priset bara är en anvisning, förbehållet, vanliga frågor och hur man går vidare. Paketet är basen; inga delpriser.",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Sidan som Markdown.",
      "content": {
       "text/markdown": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "404": {
      "description": "Ingen sådan sida, eller inte publicerad."
     }
    }
   },
   "x-producer": "crm"
  },
  "/sidor/sitemap.json": {
   "get": {
    "tags": [
     "Sidor"
    ],
    "summary": "Publicerade landningssidor med senaste ändring",
    "description": "Lista för sajtens sitemap: slug, förälder, adress på vidhave.se, adress till sidans llms.txt, titel och senaste ändring (sidfilen, guiden, fakta och sidans paket).",
    "responses": {
     "200": {
      "description": "Listan.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sidor": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "foralder": {
              "type": [
               "string",
               "null"
              ]
             },
             "url": {
              "type": "string"
             },
             "llms": {
              "type": "string"
             },
             "titel": {
              "type": "string"
             },
             "andrad": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/wallet/bevis": {
   "post": {
    "tags": [
     "Presentkort"
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "summary": "Utfärda ett värdebevis (presentkort)",
    "description": "Omfång `wallet:utfarda`. Ange vilken värdetyp och vad köparen betalade; värdet och villkoren bestämmer Vidhave, och fält som försöker sätta dem avvisas. Svaret 201 är kvittensen, och köpet är levererat först när den har kommit fram. Samma `kopreferens` igen ger samma kvittens (200) och inget nytt bevis; med annan typ eller annat belopp blir det 409. Ingen moms vid försäljning (`moms_vid_forsaljning: false`): kortet kan alltid omvandlas, så momsen uppstår vid inlösen. Med `leverera: epost` skickar Vidhave beviset till mottagaren, annars köparen.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "typ",
         "kopreferens",
         "betalt_ore"
        ],
        "properties": {
         "typ": {
          "type": "string",
          "description": "Värdetypens nyckel, t.ex. `presentkort-1000`."
         },
         "kopreferens": {
          "type": "string",
          "maxLength": 200,
          "description": "Din nyckel för köpet (ordernummer). Samma igen = samma bevis."
         },
         "betalt_ore": {
          "type": "integer",
          "minimum": 0,
          "description": "Vad köparen betalade, i öre. Fast typ: måste vara typens pris. Fritt belopp: inom typens gränser, och blir värdet."
         },
         "betalsatt": {
          "type": "string",
          "maxLength": 40,
          "description": "t.ex. kort, swish, faktura"
         },
         "betalreferens": {
          "type": "string",
          "maxLength": 200,
          "description": "Betalningens id hos dig eller betaltjänsten."
         },
         "kopt_tid": {
          "type": "string",
          "format": "date-time"
         },
         "distans": {
          "type": "boolean",
          "description": "Köpt på distans (webb, telefon): 14 dagars ångerrätt."
         },
         "kopare": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
           "namn": {
            "type": "string"
           },
           "epost": {
            "type": "string"
           },
           "telefon": {
            "type": "string"
           }
          }
         },
         "mottagare": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
           "namn": {
            "type": "string"
           },
           "epost": {
            "type": "string"
           }
          }
         },
         "halsning": {
          "type": "string",
          "maxLength": 180,
          "description": "Givarens hälsning, som trycks på kortet (fältet rymmer 180 tecken)."
         },
         "sprak": {
          "type": "string",
          "enum": [
           "sv",
           "en",
           "de"
          ]
         },
         "leverera": {
          "type": "string",
          "enum": [
           "epost",
           "ingen"
          ],
          "default": "ingen"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Kvittensen: id, kod, värde, giltighet, länk till saldosidan.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "200": {
      "description": "Samma köp igen: samma kvittens.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Fel: `{ error, skal, requestId }`. 401 nyckel saknas eller saknar omfånget, 409 referensen redan använd för något annat, 422 fält som saknas eller är fel, 429 för många okända koder, 503 inte påslaget."
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/wallet/bevis/{bevis_id}/makulera": {
   "post": {
    "tags": [
     "Presentkort"
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "summary": "Dra tillbaka ett bevis du utfärdat",
    "description": "Omfång `wallet:utfarda`. När köpet inte gick igenom eller ångrades, och bara om inget har dragits från beviset (annars 409 `anvant`). Saldot nollas.",
    "parameters": [
     {
      "name": "bevis_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": "Beviset, `id` ur kvittensen."
     }
    ],
    "responses": {
     "200": {
      "description": "Beviset, avslutat.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Fel: `{ error, skal, requestId }`. 401 nyckel saknas eller saknar omfånget, 409 referensen redan använd för något annat, 422 fält som saknas eller är fel, 429 för många okända koder, 503 inte påslaget."
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/wallet/provning": {
   "post": {
    "tags": [
     "Presentkort"
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "summary": "Pröva ett värdebevis mot ett köp, utan att dra något",
    "description": "Omfång `wallet:los_in`. Svarar hur mycket beviset täcker (`godkant_ore`), vad som återstår att betala på annat sätt och täckningen per rad. Ett nej är inget fel: `status: nekad` med `skal` (okand_kod, avslutat, sparrat, ej_giltigt_an, forfallet, galler_inte, inget_att_betala, under_minsta_belopp, otillrackligt_saldo).",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "kod",
         "rader"
        ],
        "properties": {
         "kod": {
          "type": "string",
          "description": "Värdebevisets kod, sex tecken `XXX-XXX`. Bindestreck, blanksteg och små bokstäver går bra."
         },
         "rader": {
          "type": "array",
          "minItems": 1,
          "maxItems": 100,
          "items": {
           "type": "object",
           "required": [
            "belopp_ore",
            "moms_procent",
            "omrade"
           ],
           "properties": {
            "text": {
             "type": "string",
             "maxLength": 200
            },
            "belopp_ore": {
             "type": "integer",
             "minimum": 0,
             "description": "Radens pris med moms, i öre."
            },
            "moms_procent": {
             "type": "integer",
             "enum": [
              0,
              6,
              12,
              25
             ]
            },
            "omrade": {
             "type": "string",
             "enum": [
              "boende",
              "restaurang",
              "bastu",
              "aktivitet",
              "ovrigt"
             ]
            },
            "antal_personer": {
             "type": "integer",
             "minimum": 1
            }
           }
          },
          "description": "Köpets rader. Skicka alltid med dem: momsen räknas per rad vid inlösen."
         },
         "delvis": {
          "type": "boolean",
          "default": true,
          "description": "false: hela köpet eller inget."
         },
         "slutanvandare": {
          "type": "string",
          "maxLength": 100,
          "description": "Vem som skriver bakom din nyckel: gästens kund-id eller IP-adress (`kund:17`, `ip:…`), eller `personal:<id>` för inloggad personal. Okända koder räknas per slutanvändare (10 på 10 minuter) och per grupp bakom nyckeln (200 i timmen): gästerna för sig och personalen för sig, så att gissande gäster inte stänger personalens kassa. Skicka `personal:` bara för inloggad personal."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Svaret (ett nej är också 200)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Vid nej: {status: nekad, skal, godkant_ore: 0, kvar_att_betala_ore, saldo_ore?, giltig_till?}.",
         "properties": {
          "status": {
           "type": "string",
           "enum": [
            "godkand",
            "nekad"
           ]
          },
          "godkant_ore": {
           "type": "integer"
          },
          "kvar_att_betala_ore": {
           "type": "integer"
          },
          "saldo_ore": {
           "type": "integer"
          },
          "tillgangligt_ore": {
           "type": "integer"
          },
          "giltig_till": {
           "type": "string",
           "format": "date"
          },
          "rader": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "text": {
              "type": [
               "string",
               "null"
              ]
             },
             "belopp_ore": {
              "type": "integer"
             },
             "moms_procent": {
              "type": "integer"
             },
             "omrade": {
              "type": "string"
             },
             "tackt_ore": {
              "type": "integer",
              "description": "Vad kortet täcker av raden."
             },
             "skal": {
              "type": [
               "string",
               "null"
              ],
              "description": "Varför raden inte täcks helt, annars null."
             }
            }
           }
          },
          "skal": {
           "type": "string"
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Fel: `{ error, skal, requestId }`. 401 nyckel saknas eller saknar omfånget, 409 referensen redan använd för något annat, 422 fält som saknas eller är fel, 429 för många okända koder, 503 inte påslaget."
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/wallet/kort": {
   "post": {
    "tags": [
     "Presentkort"
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "summary": "Läs kortet bakom en kod (skannad QR eller inskriven)",
    "description": "Omfång `wallet:los_in`. För kassans \"Betala med presentkort\" och personalens skanning: kortets namn, värde, saldo, vad som är tillgängligt (saldo minus reservationer), giltighet, läge (aktivt, slut, forfallet, ej_giltigt_an, sparrat, avslutat), mottagarens namn och givarens hälsning. Drar inget. Okänd kod ger 404 `okand_kod` och räknas mot gissningsspärren som alla koder (för många ger 429).",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "kod"
        ],
        "properties": {
         "kod": {
          "type": "string",
          "maxLength": 200,
          "description": "Koden `XXX-XXX`, eller hela länken ur QR-koden (`https://vidh.se/v/<kod>`)."
         },
         "slutanvandare": {
          "type": "string",
          "maxLength": 100,
          "description": "Vem som skriver bakom din nyckel: gästens kund-id eller IP-adress (`kund:17`, `ip:…`), eller `personal:<id>` för inloggad personal. Okända koder räknas per slutanvändare (10 på 10 minuter) och per grupp bakom nyckeln (200 i timmen): gästerna för sig och personalen för sig, så att gissande gäster inte stänger personalens kassa. Skicka `personal:` bara för inloggad personal."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Kortet",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "enum": [
            "ok"
           ]
          },
          "namn": {
           "type": "string"
          },
          "kod": {
           "type": "string"
          },
          "lank": {
           "type": "string"
          },
          "nominellt_ore": {
           "type": "integer"
          },
          "saldo_ore": {
           "type": "integer"
          },
          "tillgangligt_ore": {
           "type": "integer"
          },
          "giltig_fran": {
           "type": "string",
           "format": "date"
          },
          "giltig_till": {
           "type": "string",
           "format": "date"
          },
          "lage": {
           "type": "string",
           "enum": [
            "aktivt",
            "slut",
            "forfallet",
            "ej_giltigt_an",
            "sparrat",
            "avslutat"
           ]
          },
          "mottagare_namn": {
           "type": [
            "string",
            "null"
           ]
          },
          "halsning": {
           "type": [
            "string",
            "null"
           ]
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Nyckel saknas eller saknar omfånget"
     },
     "404": {
      "description": "Okänd kod (`skal: okand_kod`)"
     },
     "429": {
      "description": "Gissningsspärren"
     },
     "503": {
      "description": "Inlösen är inte påslagen"
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/wallet/inlosen": {
   "get": {
    "tags": [
     "Presentkort"
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "summary": "Läs en inlösen på din referens",
    "description": "Omfång `wallet:los_in`. Samma svar som `GET /v1/wallet/inlosen/{inlosen_id}`, men på den `referens` du själv gav i `POST /v1/wallet/inlosen`. Till för ett anrop vars svar aldrig kom: var det draget, reserverat eller inget alls? Bara din egen nyckels inlösen. 404 `okand_inlosen` betyder att inget är reserverat eller draget på referensen: ett nej sparas aldrig som inlösen. Vänta några minuter efter anropet du reder ut, så att det hunnit landa. Ingen kod skickas, så inget räknas mot gissningsspärren.",
    "parameters": [
     {
      "name": "referens",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "maxLength": 200
      },
      "description": "Referensen från `POST /v1/wallet/inlosen`, till exempel `koll:vagn:<uuid>:1`."
     }
    ],
    "responses": {
     "200": {
      "description": "Inlösen som den är nu",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "En inlösen. Vid nej i stället {status: nekad, skal, godkant_ore: 0, kvar_att_betala_ore, saldo_ore?, giltig_till?}.",
         "properties": {
          "id": {
           "type": "string",
           "format": "uuid",
           "description": "Inlösen-id: används i …/dra, …/angra, …/aterfor och som transactionId."
          },
          "status": {
           "type": "string",
           "enum": [
            "reserverad",
            "dragen",
            "angrad",
            "utgangen",
            "aterford",
            "delvis_aterford",
            "nekad"
           ]
          },
          "referens": {
           "type": "string"
          },
          "godkant_ore": {
           "type": "integer",
           "description": "Det kortet täcker (reserverat eller draget)."
          },
          "draget_ore": {
           "type": "integer"
          },
          "aterfort_ore": {
           "type": "integer"
          },
          "kvar_att_betala_ore": {
           "type": "integer",
           "description": "Det som ska betalas på annat sätt."
          },
          "saldo_efter_ore": {
           "type": "integer"
          },
          "tillgangligt_ore": {
           "type": "integer",
           "description": "Saldo minus andras reservationer."
          },
          "giltig_till": {
           "type": "string",
           "format": "date"
          },
          "gar_ut": {
           "type": [
            "string",
            "null"
           ],
           "format": "date-time",
           "description": "När reservationen släpps; null när den inte är reserverad."
          },
          "rader": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "text": {
              "type": [
               "string",
               "null"
              ]
             },
             "belopp_ore": {
              "type": "integer"
             },
             "moms_procent": {
              "type": "integer"
             },
             "omrade": {
              "type": "string"
             },
             "tackt_ore": {
              "type": "integer",
              "description": "Vad kortet täcker av raden."
             },
             "skal": {
              "type": [
               "string",
               "null"
              ],
              "description": "Varför raden inte täcks helt, annars null."
             }
            }
           }
          },
          "skal": {
           "type": "string",
           "description": "Bara vid status nekad."
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Fel: `{ error, skal, requestId }`. 401 nyckel saknas eller saknar omfånget, 404 `okand_inlosen` ingen inlösen på referensen, 422 `saknar_referens`, 503 inte påslaget."
     }
    }
   },
   "post": {
    "tags": [
     "Presentkort"
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "summary": "Betala med ett värdebevis",
    "description": "Omfång `wallet:los_in`. Som en betaltjänst: beviset prövas mot köpet, och svaret `status: dragen` betyder betalt för `godkant_ore`; resten (`kvar_att_betala_ore`) betalas på annat sätt. `dra: false` reserverar bara värdet i `gar_ut_minuter` (dra eller ångra sedan). Samma `referens` igen ger samma inlösen och drar inget nytt. Ett nej är `status: nekad` med `skal`, som i provningen.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "kod",
         "rader",
         "referens"
        ],
        "properties": {
         "kod": {
          "type": "string",
          "description": "Värdebevisets kod, sex tecken `XXX-XXX`. Bindestreck, blanksteg och små bokstäver går bra."
         },
         "rader": {
          "type": "array",
          "minItems": 1,
          "maxItems": 100,
          "items": {
           "type": "object",
           "required": [
            "belopp_ore",
            "moms_procent",
            "omrade"
           ],
           "properties": {
            "text": {
             "type": "string",
             "maxLength": 200
            },
            "belopp_ore": {
             "type": "integer",
             "minimum": 0,
             "description": "Radens pris med moms, i öre."
            },
            "moms_procent": {
             "type": "integer",
             "enum": [
              0,
              6,
              12,
              25
             ]
            },
            "omrade": {
             "type": "string",
             "enum": [
              "boende",
              "restaurang",
              "bastu",
              "aktivitet",
              "ovrigt"
             ]
            },
            "antal_personer": {
             "type": "integer",
             "minimum": 1
            }
           }
          },
          "description": "Köpets rader. Skicka alltid med dem: momsen räknas per rad vid inlösen."
         },
         "referens": {
          "type": "string",
          "maxLength": 200,
          "description": "Din nyckel för köpet, t.ex. bokningsnumret."
         },
         "dra": {
          "type": "boolean",
          "default": true
         },
         "delvis": {
          "type": "boolean",
          "default": true
         },
         "gar_ut_minuter": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10080,
          "default": 15
         },
         "slutanvandare": {
          "type": "string",
          "maxLength": 100,
          "description": "Vem som skriver bakom din nyckel: gästens kund-id eller IP-adress (`kund:17`, `ip:…`), eller `personal:<id>` för inloggad personal. Okända koder räknas per slutanvändare (10 på 10 minuter) och per grupp bakom nyckeln (200 i timmen): gästerna för sig och personalen för sig, så att gissande gäster inte stänger personalens kassa. Skicka `personal:` bara för inloggad personal."
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Ny inlösen (reserverad eller dragen)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "En inlösen. Vid nej i stället {status: nekad, skal, godkant_ore: 0, kvar_att_betala_ore, saldo_ore?, giltig_till?}.",
         "properties": {
          "id": {
           "type": "string",
           "format": "uuid",
           "description": "Inlösen-id: används i …/dra, …/angra, …/aterfor och som transactionId."
          },
          "status": {
           "type": "string",
           "enum": [
            "reserverad",
            "dragen",
            "angrad",
            "utgangen",
            "aterford",
            "delvis_aterford",
            "nekad"
           ]
          },
          "referens": {
           "type": "string"
          },
          "godkant_ore": {
           "type": "integer",
           "description": "Det kortet täcker (reserverat eller draget)."
          },
          "draget_ore": {
           "type": "integer"
          },
          "aterfort_ore": {
           "type": "integer"
          },
          "kvar_att_betala_ore": {
           "type": "integer",
           "description": "Det som ska betalas på annat sätt."
          },
          "saldo_efter_ore": {
           "type": "integer"
          },
          "tillgangligt_ore": {
           "type": "integer",
           "description": "Saldo minus andras reservationer."
          },
          "giltig_till": {
           "type": "string",
           "format": "date"
          },
          "gar_ut": {
           "type": [
            "string",
            "null"
           ],
           "format": "date-time",
           "description": "När reservationen släpps; null när den inte är reserverad."
          },
          "rader": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "text": {
              "type": [
               "string",
               "null"
              ]
             },
             "belopp_ore": {
              "type": "integer"
             },
             "moms_procent": {
              "type": "integer"
             },
             "omrade": {
              "type": "string"
             },
             "tackt_ore": {
              "type": "integer",
              "description": "Vad kortet täcker av raden."
             },
             "skal": {
              "type": [
               "string",
               "null"
              ],
              "description": "Varför raden inte täcks helt, annars null."
             }
            }
           }
          },
          "skal": {
           "type": "string",
           "description": "Bara vid status nekad."
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "200": {
      "description": "Samma referens igen, eller nej",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "En inlösen. Vid nej i stället {status: nekad, skal, godkant_ore: 0, kvar_att_betala_ore, saldo_ore?, giltig_till?}.",
         "properties": {
          "id": {
           "type": "string",
           "format": "uuid",
           "description": "Inlösen-id: används i …/dra, …/angra, …/aterfor och som transactionId."
          },
          "status": {
           "type": "string",
           "enum": [
            "reserverad",
            "dragen",
            "angrad",
            "utgangen",
            "aterford",
            "delvis_aterford",
            "nekad"
           ]
          },
          "referens": {
           "type": "string"
          },
          "godkant_ore": {
           "type": "integer",
           "description": "Det kortet täcker (reserverat eller draget)."
          },
          "draget_ore": {
           "type": "integer"
          },
          "aterfort_ore": {
           "type": "integer"
          },
          "kvar_att_betala_ore": {
           "type": "integer",
           "description": "Det som ska betalas på annat sätt."
          },
          "saldo_efter_ore": {
           "type": "integer"
          },
          "tillgangligt_ore": {
           "type": "integer",
           "description": "Saldo minus andras reservationer."
          },
          "giltig_till": {
           "type": "string",
           "format": "date"
          },
          "gar_ut": {
           "type": [
            "string",
            "null"
           ],
           "format": "date-time",
           "description": "När reservationen släpps; null när den inte är reserverad."
          },
          "rader": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "text": {
              "type": [
               "string",
               "null"
              ]
             },
             "belopp_ore": {
              "type": "integer"
             },
             "moms_procent": {
              "type": "integer"
             },
             "omrade": {
              "type": "string"
             },
             "tackt_ore": {
              "type": "integer",
              "description": "Vad kortet täcker av raden."
             },
             "skal": {
              "type": [
               "string",
               "null"
              ],
              "description": "Varför raden inte täcks helt, annars null."
             }
            }
           }
          },
          "skal": {
           "type": "string",
           "description": "Bara vid status nekad."
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Fel: `{ error, skal, requestId }`. 401 nyckel saknas eller saknar omfånget, 409 referensen redan använd för något annat, 422 fält som saknas eller är fel, 429 för många okända koder, 503 inte påslaget."
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/wallet/inlosen/{inlosen_id}": {
   "get": {
    "tags": [
     "Presentkort"
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "summary": "Läs en inlösen",
    "description": "Omfång `wallet:los_in`. Bara dina egna.",
    "parameters": [
     {
      "name": "inlosen_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": "Inlösens `id`."
     }
    ],
    "responses": {
     "200": {
      "description": "Inlösen som den är nu",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "En inlösen. Vid nej i stället {status: nekad, skal, godkant_ore: 0, kvar_att_betala_ore, saldo_ore?, giltig_till?}.",
         "properties": {
          "id": {
           "type": "string",
           "format": "uuid",
           "description": "Inlösen-id: används i …/dra, …/angra, …/aterfor och som transactionId."
          },
          "status": {
           "type": "string",
           "enum": [
            "reserverad",
            "dragen",
            "angrad",
            "utgangen",
            "aterford",
            "delvis_aterford",
            "nekad"
           ]
          },
          "referens": {
           "type": "string"
          },
          "godkant_ore": {
           "type": "integer",
           "description": "Det kortet täcker (reserverat eller draget)."
          },
          "draget_ore": {
           "type": "integer"
          },
          "aterfort_ore": {
           "type": "integer"
          },
          "kvar_att_betala_ore": {
           "type": "integer",
           "description": "Det som ska betalas på annat sätt."
          },
          "saldo_efter_ore": {
           "type": "integer"
          },
          "tillgangligt_ore": {
           "type": "integer",
           "description": "Saldo minus andras reservationer."
          },
          "giltig_till": {
           "type": "string",
           "format": "date"
          },
          "gar_ut": {
           "type": [
            "string",
            "null"
           ],
           "format": "date-time",
           "description": "När reservationen släpps; null när den inte är reserverad."
          },
          "rader": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "text": {
              "type": [
               "string",
               "null"
              ]
             },
             "belopp_ore": {
              "type": "integer"
             },
             "moms_procent": {
              "type": "integer"
             },
             "omrade": {
              "type": "string"
             },
             "tackt_ore": {
              "type": "integer",
              "description": "Vad kortet täcker av raden."
             },
             "skal": {
              "type": [
               "string",
               "null"
              ],
              "description": "Varför raden inte täcks helt, annars null."
             }
            }
           }
          },
          "skal": {
           "type": "string",
           "description": "Bara vid status nekad."
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Fel: `{ error, skal, requestId }`. 401 nyckel saknas eller saknar omfånget, 409 referensen redan använd för något annat, 422 fält som saknas eller är fel, 429 för många okända koder, 503 inte påslaget."
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/wallet/inlosen/{inlosen_id}/dra": {
   "post": {
    "tags": [
     "Presentkort"
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "summary": "Dra en reservation",
    "description": "Omfång `wallet:los_in`. Valfritt lägre `belopp_ore`; resten släpps. Igen på en dragen svarar med nuläget. 409 `utgangen` eller `angrad`.",
    "parameters": [
     {
      "name": "inlosen_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": "Inlösens `id`."
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "belopp_ore": {
          "type": "integer",
          "minimum": 1
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Inlösen som den är nu",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "En inlösen. Vid nej i stället {status: nekad, skal, godkant_ore: 0, kvar_att_betala_ore, saldo_ore?, giltig_till?}.",
         "properties": {
          "id": {
           "type": "string",
           "format": "uuid",
           "description": "Inlösen-id: används i …/dra, …/angra, …/aterfor och som transactionId."
          },
          "status": {
           "type": "string",
           "enum": [
            "reserverad",
            "dragen",
            "angrad",
            "utgangen",
            "aterford",
            "delvis_aterford",
            "nekad"
           ]
          },
          "referens": {
           "type": "string"
          },
          "godkant_ore": {
           "type": "integer",
           "description": "Det kortet täcker (reserverat eller draget)."
          },
          "draget_ore": {
           "type": "integer"
          },
          "aterfort_ore": {
           "type": "integer"
          },
          "kvar_att_betala_ore": {
           "type": "integer",
           "description": "Det som ska betalas på annat sätt."
          },
          "saldo_efter_ore": {
           "type": "integer"
          },
          "tillgangligt_ore": {
           "type": "integer",
           "description": "Saldo minus andras reservationer."
          },
          "giltig_till": {
           "type": "string",
           "format": "date"
          },
          "gar_ut": {
           "type": [
            "string",
            "null"
           ],
           "format": "date-time",
           "description": "När reservationen släpps; null när den inte är reserverad."
          },
          "rader": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "text": {
              "type": [
               "string",
               "null"
              ]
             },
             "belopp_ore": {
              "type": "integer"
             },
             "moms_procent": {
              "type": "integer"
             },
             "omrade": {
              "type": "string"
             },
             "tackt_ore": {
              "type": "integer",
              "description": "Vad kortet täcker av raden."
             },
             "skal": {
              "type": [
               "string",
               "null"
              ],
              "description": "Varför raden inte täcks helt, annars null."
             }
            }
           }
          },
          "skal": {
           "type": "string",
           "description": "Bara vid status nekad."
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Fel: `{ error, skal, requestId }`. 401 nyckel saknas eller saknar omfånget, 409 referensen redan använd för något annat, 422 fält som saknas eller är fel, 429 för många okända koder, 503 inte påslaget."
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/wallet/inlosen/{inlosen_id}/angra": {
   "post": {
    "tags": [
     "Presentkort"
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "summary": "Släpp en reservation",
    "description": "Omfång `wallet:los_in`. Igen på en släppt svarar med nuläget. En dragen inlösen återförs i stället.",
    "parameters": [
     {
      "name": "inlosen_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": "Inlösens `id`."
     }
    ],
    "responses": {
     "200": {
      "description": "Inlösen som den är nu",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "En inlösen. Vid nej i stället {status: nekad, skal, godkant_ore: 0, kvar_att_betala_ore, saldo_ore?, giltig_till?}.",
         "properties": {
          "id": {
           "type": "string",
           "format": "uuid",
           "description": "Inlösen-id: används i …/dra, …/angra, …/aterfor och som transactionId."
          },
          "status": {
           "type": "string",
           "enum": [
            "reserverad",
            "dragen",
            "angrad",
            "utgangen",
            "aterford",
            "delvis_aterford",
            "nekad"
           ]
          },
          "referens": {
           "type": "string"
          },
          "godkant_ore": {
           "type": "integer",
           "description": "Det kortet täcker (reserverat eller draget)."
          },
          "draget_ore": {
           "type": "integer"
          },
          "aterfort_ore": {
           "type": "integer"
          },
          "kvar_att_betala_ore": {
           "type": "integer",
           "description": "Det som ska betalas på annat sätt."
          },
          "saldo_efter_ore": {
           "type": "integer"
          },
          "tillgangligt_ore": {
           "type": "integer",
           "description": "Saldo minus andras reservationer."
          },
          "giltig_till": {
           "type": "string",
           "format": "date"
          },
          "gar_ut": {
           "type": [
            "string",
            "null"
           ],
           "format": "date-time",
           "description": "När reservationen släpps; null när den inte är reserverad."
          },
          "rader": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "text": {
              "type": [
               "string",
               "null"
              ]
             },
             "belopp_ore": {
              "type": "integer"
             },
             "moms_procent": {
              "type": "integer"
             },
             "omrade": {
              "type": "string"
             },
             "tackt_ore": {
              "type": "integer",
              "description": "Vad kortet täcker av raden."
             },
             "skal": {
              "type": [
               "string",
               "null"
              ],
              "description": "Varför raden inte täcks helt, annars null."
             }
            }
           }
          },
          "skal": {
           "type": "string",
           "description": "Bara vid status nekad."
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Fel: `{ error, skal, requestId }`. 401 nyckel saknas eller saknar omfånget, 409 referensen redan använd för något annat, 422 fält som saknas eller är fel, 429 för många okända koder, 503 inte påslaget."
     }
    }
   },
   "x-producer": "crm"
  },
  "/v1/wallet/inlosen/{inlosen_id}/aterfor": {
   "post": {
    "tags": [
     "Presentkort"
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "summary": "Lägg tillbaka draget värde (avbokning)",
    "description": "Omfång `wallet:los_in`. Hela eller en del (`belopp_ore`), aldrig mer än det dragna. Samma `referens` igen ändrar inget. 409 `bevis_forfallet` om beviset har gått ut: Vidhave löser det för hand.",
    "parameters": [
     {
      "name": "inlosen_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      },
      "description": "Inlösens `id`."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "referens"
        ],
        "properties": {
         "belopp_ore": {
          "type": "integer",
          "minimum": 1
         },
         "referens": {
          "type": "string",
          "maxLength": 200,
          "description": "Din nyckel för återföringen."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Inlösen som den är nu",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "En inlösen. Vid nej i stället {status: nekad, skal, godkant_ore: 0, kvar_att_betala_ore, saldo_ore?, giltig_till?}.",
         "properties": {
          "id": {
           "type": "string",
           "format": "uuid",
           "description": "Inlösen-id: används i …/dra, …/angra, …/aterfor och som transactionId."
          },
          "status": {
           "type": "string",
           "enum": [
            "reserverad",
            "dragen",
            "angrad",
            "utgangen",
            "aterford",
            "delvis_aterford",
            "nekad"
           ]
          },
          "referens": {
           "type": "string"
          },
          "godkant_ore": {
           "type": "integer",
           "description": "Det kortet täcker (reserverat eller draget)."
          },
          "draget_ore": {
           "type": "integer"
          },
          "aterfort_ore": {
           "type": "integer"
          },
          "kvar_att_betala_ore": {
           "type": "integer",
           "description": "Det som ska betalas på annat sätt."
          },
          "saldo_efter_ore": {
           "type": "integer"
          },
          "tillgangligt_ore": {
           "type": "integer",
           "description": "Saldo minus andras reservationer."
          },
          "giltig_till": {
           "type": "string",
           "format": "date"
          },
          "gar_ut": {
           "type": [
            "string",
            "null"
           ],
           "format": "date-time",
           "description": "När reservationen släpps; null när den inte är reserverad."
          },
          "rader": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "text": {
              "type": [
               "string",
               "null"
              ]
             },
             "belopp_ore": {
              "type": "integer"
             },
             "moms_procent": {
              "type": "integer"
             },
             "omrade": {
              "type": "string"
             },
             "tackt_ore": {
              "type": "integer",
              "description": "Vad kortet täcker av raden."
             },
             "skal": {
              "type": [
               "string",
               "null"
              ],
              "description": "Varför raden inte täcks helt, annars null."
             }
            }
           }
          },
          "skal": {
           "type": "string",
           "description": "Bara vid status nekad."
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Fel: `{ error, skal, requestId }`. 401 nyckel saknas eller saknar omfånget, 409 referensen redan använd för något annat, 422 fält som saknas eller är fel, 429 för många okända koder, 503 inte påslaget."
     }
    }
   },
   "x-producer": "crm"
  },
  "/publicSchedule": {
   "get": {
    "tags": [
     "Öppettider"
    ],
    "summary": "Öppettider, priser och bokningslänkar per tjänst",
    "description": "En typisk vecka (standard) eller de faktiska kommande dagarna. Tjänsterna (bastu, badtunna, restaurangen …) listas i `_readme.catalog`.",
    "parameters": [
     {
      "name": "services",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "bastu,badtunna",
      "description": "Kommaseparerade slugs eller id ur `_readme.catalog`. Svaret följer samma ordning."
     },
     {
      "name": "mode",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "week",
        "days"
       ],
       "default": "week"
      },
      "description": "`week` = typisk vecka, `days` = faktiska kommande dagar."
     },
     {
      "name": "days",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1
      },
      "description": "Antal dagar vid `mode=days`."
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "Första dag vid `mode=days` (i dag till ett år fram)."
     },
     {
      "name": "prices",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "1"
       ]
      },
      "description": "Lägg till prisintervall per tjänst."
     },
     {
      "name": "utm_source",
      "in": "query",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9.-]{1,30}$"
      },
      "description": "Valfri: ditt eget namn med små bokstäver. En `bookUrl` med tre eller fler variabler slutar med `utm_source={namn}&utm_medium={medium}` (utan: `llms`/`llm`); kortare länkar lämnas rena."
     },
     {
      "name": "utm_medium",
      "in": "query",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9.-]{1,30}$"
      },
      "description": "Kanalen länken går ut i, förval `llm` (AI-assistent). Den som inte är en assistent anger sin egen (t.ex. `mejl`, `sms`) så att bokningen inte räknas som en assistents."
     }
    ],
    "responses": {
     "200": {
      "description": "JSON med `_readme`, `services` och tider.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   },
   "x-producer": "koll"
  },
  "/adjacentOffers": {
   "get": {
    "tags": [
     "Erbjudanden"
    ],
    "summary": "Vad som går att boka före, under och efter ett pass eller en planerad tid",
    "description": "Samma motor som Vidhaves egen bokningsvy. Med `serviceId` är ankaret ett pass (t.ex. gästens bastubokning); utan är det en plan — 'jag tänker komma 18:00' — med `duration` minuter. Varje erbjudande bär `bookUrl` (öppnar bokningen på rätt dag och tid), `withAnchorUrl` när frågan gäller ett pass (EN länk som öppnar passet med erbjudandet förvalt som tillägg — till den som ännu inte bokat passet) och `infoUrl` när platsen har en sida. Länkmönstret och kontrollen av ett eget förslag: `/v1/bookingLink`. Högst ett erbjudande per tjänst och kolumn. `overlap` bara när båda går att göra samtidigt (samma plats, t.ex. bastu + badtunna; aldrig ett bord, och tomt när passet är ett bord) — utom för en plan, där `overlap` är det som finns vid tiden. Restaurangen mäts mot passets verkliga start och slut, och `subTimes` bär bara de kvartstider som passar; `bookUrl` pekar på den bästa. Det som ingår i passets tjänst erbjuds inte (afterwork: ingen bastu). Formen är stabil; VILKA erbjudanden som kommer med kan ändras när reglerna byggs ut.",
    "parameters": [
     {
      "name": "date",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "example": "2026-11-12"
     },
     {
      "name": "time",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^\\d{2}:\\d{2}$"
      },
      "example": "18:00",
      "description": "Passets eller planens start, HH:MM (Europe/Stockholm)."
     },
     {
      "name": "serviceId",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "Passets tjänst (Amelias id; vendor_services.id när bookingType=waiteraid). Utelämnad = en plan."
     },
     {
      "name": "bookingType",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "amelia",
        "waiteraid"
       ],
       "default": "amelia"
      }
     },
     {
      "name": "duration",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 600,
       "default": 60
      },
      "description": "Planens längd i minuter (bara utan serviceId)."
     },
     {
      "name": "persons",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1
      },
      "description": "Sällskapets storlek — följer med i varje bookUrl."
     },
     {
      "name": "utm_source",
      "in": "query",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9.-]{1,30}$"
      },
      "description": "Valfri: ditt eget namn med små bokstäver. En `bookUrl`/`withAnchorUrl` med tre eller fler variabler slutar med `utm_source={namn}&utm_medium={medium}` (utan: `llms`/`llm`); kortare länkar lämnas rena."
     },
     {
      "name": "utm_medium",
      "in": "query",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9.-]{1,30}$"
      },
      "description": "Kanalen länken går ut i, förval `llm` (AI-assistent). Den som inte är en assistent anger sin egen (t.ex. `mejl`, `sms`) så att bokningen inte räknas som en assistents."
     }
    ],
    "responses": {
     "200": {
      "description": "`anchor`, `before`, `overlap`, `after` (listor med serviceId, slug, svcName, time, bookingType, bookUrl, withAnchorUrl?, infoUrl?, subTimes? för restaurangen — kvartstiderna som passar runt passet) och `_readme` med länkmönstret och reglerna.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "date eller time saknas eller har fel form."
     },
     "503": {
      "description": "Tiderna kunde inte läsas — aldrig tomma listor i stället för ett fel."
     }
    }
   },
   "x-producer": "koll"
  },
  "/v1/bookingLink": {
   "get": {
    "tags": [
     "Erbjudanden"
    ],
    "summary": "Kontrollera ett förslag, låt oss föreslå tiderna, eller få dela-länken för en gjord bokning",
    "description": "Den som föreslår en gäst något (mejlroboten, en AI-assistent, ActiveCRM) frågar här INNAN länken skickas. Fyra lägen. (1) Utan parametrar: `_readme` med länkmönstret för `/boka` — den centrala beskrivningen. (2) `date` + `items` (eller `service` + `time`) + `persons`: varje tjänst kontrolleras mot dagens tider med samma regler som bokningssidan — `ok` är true bara när allt öppnas som föreslaget och sällskapet ryms; annars säger `items[].status`, `note`, `alternatives` och `advice` vad som bör ändras. `link` bär det som verkligen öppnas. Första tjänsten öppnas som bokningen; resten förväljs bara när tiden passar runt den (samma motor som `/adjacentOffers`). (3) `date` + `propose` (+ `around`, `persons`): vi väljer tiderna. Svaret bär upp till tre färdiga förslag, det bästa först, vart och ett kontrollerat som i läge 2 och med sin egen länk. Tjänsterna (en eller två) står i den ordning de ska göras. Mellan två pass ligger helst en kvart och aldrig mer än 45 minuter; finns en tid först 46–74 minuter senare (från 75 inget förslag) ges förslaget ändå, med `wait: true` och en `comment` att säga till gästen. Ett restaurangbesök räknas så långt som bordet hålls i Waiteraid (Orangeriet 1 h 45 min). Samma andra pass ges bara i ett förslag. Finns inget förslag inom en timme från `around` ges de närmaste ändå, och `advice` säger det i klartext med den närmaste tiden — läs `advice` även när `ok` är true. (4) `bookings=id,id`: dela-länken för en gjord bokning — bara det som bokas per person (aldrig bordet, badtunnan eller en privat tid), utan antal. Ingenting bokas eller hålls i något läge; svaret gäller nu. Märkning: skicka `utm_source` (ditt namn) och, om du inte är en AI-assistent, `utm_medium` — länkarna i svaret bär dem, så att vi kan räkna var bokningar börjar. Utan dem märks länkarna `utm_source=llms&utm_medium=llm`.",
    "parameters": [
     {
      "name": "date",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "example": "2026-12-19",
      "description": "Dagen (Europe/Stockholm). `dayview` godtas också, som i länken."
     },
     {
      "name": "items",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "example": "bastu@18:00,orangeriet@19:15",
      "description": "Tjänst@HH:MM, kommaseparerade, högst 6. Tjänsten är dess slug (se `/publicSchedule` → `_readme.catalog`). Den första blir bokningen, resten tillägg."
     },
     {
      "name": "service",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "En enda tjänst — tillsammans med `time`, i stället för `items`."
     },
     {
      "name": "time",
      "in": "query",
      "schema": {
       "type": "string",
       "pattern": "^\\d{2}:\\d{2}$"
      },
      "description": "Tiden för `service`."
     },
     {
      "name": "persons",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 50
      },
      "description": "Sällskapets storlek. Med den kontrolleras att platserna räcker; utan den bara att tiden finns."
     },
     {
      "name": "propose",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "example": "bastu,orangeriet",
      "description": "En eller två tjänster (slug), kommaseparerade, i den ordning de ska göras — vi väljer tiderna. Går inte ihop med `items` eller `time`."
     },
     {
      "name": "around",
      "in": "query",
      "schema": {
       "type": "string",
       "pattern": "^\\d{2}:\\d{2}$"
      },
      "example": "18:00",
      "description": "Bara med `propose`: önskad starttid för den första tjänsten. Utan den föreslås dagens tidigaste tider där allt går att få. Är första tjänsten ett bord och önskemålet en heltimme föreslås kvarten före först (13:00 → 12:45)."
     },
     {
      "name": "bookings",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "example": "5001,5002",
      "description": "Boknings-id, kommaseparerade — ger dela-länken i stället för en kontroll. Id:na ska höra till en och samma kund och bokningen får inte ha varit."
     },
     {
      "name": "utm_source",
      "in": "query",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9.-]{1,30}$"
      },
      "example": "chatgpt",
      "description": "Vem som frågar: ditt eget namn med små bokstäver (chatgpt, claude, activecrm …). Varje länk i svaret med tre eller fler variabler slutar med `utm_source={namn}&utm_medium={medium}`. Utan: `utm_source=llms&utm_medium=llm`. Gäller kontroll och förslag; dela-länken (`bookings`) bär alltid Kolls egen (`koll.vidhave.se`, `dela`). Skicka länken orörd — klipp aldrig bort märkningen."
     },
     {
      "name": "utm_medium",
      "in": "query",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9.-]{1,30}$"
      },
      "example": "llm",
      "description": "Kanalen länken går ut i, förval `llm` (AI-assistent). Den som inte är en assistent anger sin egen (t.ex. `mejl`, `sms`) så att bokningen inte räknas som en assistents."
     }
    ],
    "responses": {
     "200": {
      "description": "Kontroll: `ok`, `date`, `persons`, `link`, `items[]` (service, slug, name, image?, bookingType, time, status, opens, note, spotsLeft?, priceSek?, pricePer?, alternatives?, link?), `advice`, `holds` (alltid false) och `_readme`. `status`: ledig | fullt | ingen_tid | for_fa_platser | ej_bokbar | okand_tjanst | stods_inte. `opens`: kort | forvald | inte_forvald | nej. Förslag (`propose`): `ok` (minst ett förslag), `date`, `persons`, `around`, `proposals[]` (items[] med slug, name, image? — tjänstens bild `{ url, alt, translations? }`, utelämnad när tjänsten saknar bild —, bookingType, time, endTime?, priceSek?, pricePer?, spotsLeft?; `gapMinutes`, `wait`, `comment`, `aroundOffsetMinutes?`, `link`), `advice` (när inget förslag finns, eller när inget av dem ligger inom en timme från `around`: \"närmast är kl …\"), `free` när inget förslag finns, `split` när sällskapet är för stort för en bokning men ryms i flera på samma tid (badtunnan: `perBooking`, `bookings`, `persons`, `times`, `links` med en länk per bokning; finns också på en `items[]`-rad i kontrollen), `holds` (alltid false). Dela: `link` (eller null med `reason`), `date`, `items`.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "Frågan går inte att läsa: datum saknas eller har passerat, items har fel form, persons utanför 1–50, `propose` med fler än två tjänster, en okänd tjänst eller ihop med `items`. Svaret bär `_readme`."
     },
     "404": {
      "description": "Bara dela-läget: bokningen finns inte, har varit, eller id:na hör till olika kunder."
     },
     "503": {
      "description": "Tiderna kunde inte läsas — aldrig 'fullt' i stället för ett fel."
     }
    }
   },
   "x-producer": "koll"
  },
  "/v1/status": {
   "get": {
    "tags": [
     "Öppettider"
    ],
    "summary": "Har vi öppet just nu?",
    "description": "En rad per tjänst: `is_open`, `closes_at`, `next_opens_at`, `book_url`. `is_open: null` betyder att tiderna inte kunde läsas, inte stängt.",
    "parameters": [
     {
      "name": "service",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Slug eller id, kommaseparerat. Utan = alla tjänster."
     },
     {
      "name": "at",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date-time"
      },
      "description": "Räkna för en annan tidpunkt (prov)."
     }
    ],
    "responses": {
     "200": {
      "description": "JSON med `services` och `_readme`.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   },
   "x-producer": "koll"
  },
  "/prislista": {
   "get": {
    "tags": [
     "Priser"
    ],
    "summary": "Prislistan för grupper, företag och specialarrangemang",
    "description": "Prislistan för grupper, företag och specialarrangemang, den som offerter utgår från. Den innehåller inte priser för vanliga enskilda bokningar. Pris för en enskild bokning (bastu, badtunna, afterwork, bord) ger `/v1/bookingLink`, som svarar med priset tillsammans med tiden och länken. Priserna är de som gäller i dag; en ändring syns här samma stund. Reglerna för hur priskomponenterna räknas ihop står i `_readme.regler`.",
    "parameters": [
     {
      "name": "segment",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "privat",
        "foretag"
       ]
      },
      "description": "`foretag` = exklusive moms, `privat` = det pris kunden ser inklusive moms."
     },
     {
      "name": "eventDate",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "Priserna som gäller ett visst datum."
     }
    ],
    "responses": {
     "200": {
      "description": "JSON med `articles`.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   },
   "x-producer": "koll"
  },
  "/report/prislista": {
   "get": {
    "tags": [
     "Priser"
    ],
    "summary": "Prislistan för grupper, företag och specialarrangemang, med historik, arkiv och interna fält",
    "description": "Samma lista som `/prislista`: prislistan för grupper, företag och specialarrangemang, den som offerter utgår från. Den innehåller inte priser för vanliga enskilda bokningar; dem ger `/v1/bookingLink`, som svarar med priset tillsammans med tiden och länken.",
    "security": [
     {
      "apiKey": []
     }
    ],
    "parameters": [
     {
      "name": "segment",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "privat",
        "foretag"
       ]
      }
     },
     {
      "name": "eventDate",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON."
     },
     "401": {
      "description": "Nyckel saknas eller saknar omfånget `prislista`."
     }
    }
   },
   "x-producer": "koll"
  },
  "/statistik": {
   "get": {
    "tags": [
     "Statistik"
    ],
    "summary": "Anonym bokningsstatistik utan belopp",
    "description": "En rad per husbokning med hustyp (Grand villa, Bungalow, Tiny), nätter, gäster, land och status. Inga hus, gäster eller ägare.",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON med `bookings`.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   },
   "x-producer": "koll"
  },
  "/report/statistik": {
   "get": {
    "tags": [
     "Statistik"
    ],
    "summary": "Statistik med belopp, produkter och källa",
    "security": [
     {
      "apiKey": []
     }
    ],
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON."
     },
     "401": {
      "description": "Nyckel saknas eller saknar omfånget `statistik`."
     }
    }
   },
   "x-producer": "koll"
  },
  "/report/statistik/partner": {
   "get": {
    "tags": [
     "Statistik"
    ],
    "summary": "Statistik med kallhyra, utan produkter och källa",
    "security": [
     {
      "apiKey": []
     }
    ],
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON."
     },
     "401": {
      "description": "Nyckel saknas eller saknar omfånget `statistik:partner`."
     }
    }
   },
   "x-producer": "koll"
  },
  "/report/statistik/assistenter": {
   "get": {
    "tags": [
     "Statistik"
    ],
    "summary": "Bokningar och öppnade bokningslänkar per källa (utm_source) — hur många bokningar som börjar hos en AI-assistent",
    "description": "Per `utm_source` för ett `utm_medium` (förval `llm`): `opens` (öppnade länkar i /boka), `bookings`, `cancelled`, `persons` och `opensWithBooking` (öppningar som ledde till en bokning; delat med `opens` = andelen som blir bokningar), och `unknownSource` (bokningar utan källa — okänd, aldrig 'egen'). Inga personuppgifter. Samma nyckel som `/report/statistik`.",
    "security": [
     {
      "apiKey": []
     }
    ],
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "medium",
      "in": "query",
      "schema": {
       "type": "string",
       "default": "llm"
      },
      "description": "utm_medium att räkna. `web` ger vidhave.se:s egna länkar, `dela` Kolls dela-länkar."
     }
    ],
    "responses": {
     "200": {
      "description": "JSON med `_readme` och `sources[]`."
     },
     "401": {
      "description": "Nyckel saknas eller saknar omfånget `statistik`."
     }
    }
   },
   "x-producer": "koll"
  },
  "/v1/reservations": {
   "get": {
    "tags": [
     "Bokning"
    ],
    "summary": "Hur man bokar bord åt en gäst (bruksanvisning för assistenter)",
    "description": "Öppen. Svarar med `_readme`: steg, fält, svarskoder. Ingen nyckel.",
    "responses": {
     "200": {
      "description": "`{ _readme }`"
     }
    }
   },
   "post": {
    "tags": [
     "Bokning"
    ],
    "summary": "Lägg en bordsförfrågan åt en gäst — gästen bekräftar via SMS",
    "description": "Öppen, ingen nyckel behövs (en nyckel med omfånget `boka:bord` är frivillig och ger en innehavare egna, högre tak). Lägger en förfrågan och skickar ett SMS till gästen med en länk; bordet bokas först när gästen öppnar länken och trycker på knappen. Ingen betalning. Fält: place eller service, date, time, persons, name, phone, email, comment?, lang?, utm_source? (ditt namn — vi räknar bokningar som börjar hos en assistent). Tak: 5 per telefonnummer och timme, 10 per avsändare och timme. Se GET för detaljer.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "date",
         "time",
         "persons",
         "name",
         "phone",
         "email"
        ],
        "properties": {
         "place": {
          "type": "string",
          "example": "orangeriet"
         },
         "service": {
          "type": "string"
         },
         "date": {
          "type": "string",
          "format": "date"
         },
         "time": {
          "type": "string",
          "example": "18:30"
         },
         "persons": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50
         },
         "name": {
          "type": "string"
         },
         "phone": {
          "type": "string",
          "example": "+46701234567"
         },
         "email": {
          "type": "string",
          "format": "email"
         },
         "comment": {
          "type": "string"
         },
         "lang": {
          "type": "string",
          "enum": [
           "sv",
           "en",
           "de"
          ]
         },
         "utm_source": {
          "type": "string",
          "pattern": "^[a-z0-9.-]{1,30}$",
          "example": "chatgpt",
          "description": "Ditt eget namn med små bokstäver. Sparas på bordsbokningen (utm_medium = llm) så att vi kan räkna bokningar som börjar hos en assistent. Utan fältet: llms. Inga personuppgifter."
         }
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "`{ ok, id, status: 'vantar', expiresAt, statusUrl, next }`"
     },
     "400": {
      "description": "`{ error, field }`"
     },
     "401": {
      "description": "bara om x-api-key skickats och är okänd"
     },
     "409": {
      "description": "`{ code: 'no_time'|'closed', availableTimes[] }`"
     },
     "429": {
      "description": "för många förfrågningar"
     },
     "503": {
      "description": "SMS kan inte skickas — `bookUrl`, `phone`"
     }
    }
   },
   "x-producer": "koll"
  },
  "/v1/reservations/{id}": {
   "get": {
    "tags": [
     "Bokning"
    ],
    "summary": "Förfrågans status",
    "description": "Öppen för förfrågningar lagda utan nyckel (id:t räcker; inga personuppgifter i svaret); lagd med nyckel kräver samma nyckel. `status`: vantar / bekraftad / misslyckad / utgangen; `outcome`: booked / requested / call_us.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "`{ ok, id, status, outcome, service, date, time, persons, createdAt, expiresAt, confirmedAt }`"
     },
     "404": {
      "description": "finns inte, eller annan nyckel"
     }
    }
   },
   "x-producer": "koll"
  },
  "/v1/whoami": {
   "get": {
    "summary": "Who is asking: the Business, the key holder or staff member, and the scopes",
    "description": "Answers for both kinds of credential and needs no scope. `person` is set for a staff sign-in and null for a key.",
    "security": [
     {
      "bearerAuth": []
     },
     {
      "apiKeyAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "Default Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "kind",
          "businessId",
          "business",
          "holder",
          "scopes",
          "person"
         ],
         "properties": {
          "kind": {
           "type": "string",
           "enum": [
            "key",
            "staff"
           ]
          },
          "businessId": {
           "type": "string",
           "format": "uuid"
          },
          "business": {
           "type": "object",
           "required": [
            "id",
            "name"
           ],
           "properties": {
            "id": {
             "type": "string"
            },
            "name": {
             "type": "string"
            }
           }
          },
          "holder": {
           "type": "string",
           "description": "The key's holder, or the staff member's name."
          },
          "scopes": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "person": {
           "type": "object",
           "nullable": true,
           "required": [
            "id",
            "name",
            "role",
            "objectId"
           ],
           "properties": {
            "id": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "role": {
             "type": "string",
             "enum": [
              "owner"
             ]
            },
            "objectId": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "A key and a staff token in one request.",
      "content": {
       "application/json": {
        "schema": {
         "description": "A key and a staff token in one request.",
         "type": "object",
         "required": [
          "error"
         ],
         "properties": {
          "error": {
           "type": "string"
          },
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "No credential, or one that does not verify.",
      "content": {
       "application/json": {
        "schema": {
         "description": "No credential, or one that does not verify.",
         "type": "object",
         "required": [
          "error"
         ],
         "properties": {
          "error": {
           "type": "string"
          },
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "A valid staff token for a person who is not a staff member (`not_staff`).",
      "content": {
       "application/json": {
        "schema": {
         "description": "A valid staff token for a person who is not a staff member (`not_staff`).",
         "type": "object",
         "required": [
          "error"
         ],
         "properties": {
          "error": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "objectId": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "x-producer": "experiencer"
  },
  "/v1/offerings": {
   "get": {
    "summary": "The Offerings (packages) of the Business",
    "tags": [
     "offerings"
    ],
    "description": "Server-to-server only: never call this from a browser (the key would be exposed). The package list in the shape the landing page reads today: per package its price per travel alternative, party-size limits, conditions as sentences generated from the rules, included part keys, swaps with differences, and add-ons with prices. Prices are in öre, excluding VAT. Part prices, cost and margin are never part of the answer (ADR-0010). A package whose `status` is `unconfirmed` must not be shown openly. `seasons` lists the Business's seasons (governing and spans, ADR-0015) with their dates computed for this year and the next.",
    "security": [
     {
      "bearerAuth": []
     },
     {
      "apiKeyAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "Default Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "offerings",
          "seasons"
         ],
         "properties": {
          "seasons": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "key": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "kind": {
              "type": "string",
              "enum": [
               "governing",
               "span"
              ],
              "description": "governing: exactly one applies on any date; span: informative, may overlap."
             },
             "description": {
              "type": "string",
              "nullable": true
             },
             "ranges": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "from": {
                 "type": "string"
                },
                "to": {
                 "type": "string"
                }
               }
              },
              "description": "The rule in words."
             },
             "dates": {
              "type": "array",
              "description": "Per year (this year and the next): the occurrences that start in that year, YYYY-MM-DD, both days included.",
              "items": {
               "type": "object",
               "properties": {
                "year": {
                 "type": "integer"
                },
                "ranges": {
                 "type": "array",
                 "items": {
                  "type": "object",
                  "properties": {
                   "from": {
                    "type": "string"
                   },
                   "to": {
                    "type": "string"
                   }
                  }
                 }
                }
               }
              }
             }
            }
           }
          },
          "offerings": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "key": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "version": {
              "type": "integer"
             },
             "status": {
              "type": "string",
              "enum": [
               "unconfirmed",
               "valid"
              ],
              "description": "`unconfirmed` (*obekräftat*): not to be shown openly."
             },
             "unit": {
              "type": "string",
              "enum": [
               "per_guest",
               "per_group"
              ]
             },
             "currency": {
              "type": "string"
             },
             "vat": {
              "type": "object",
              "properties": {
               "basis": {
                "type": "string",
                "enum": [
                 "excluded"
                ]
               },
               "rate": {
                "type": "integer"
               }
              }
             },
             "price": {
              "type": "integer",
              "description": "Amount in öre (1/100 kr), excluding VAT."
             },
             "travel": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "option": {
                 "type": "string",
                 "nullable": true
                },
                "name": {
                 "type": "string"
                },
                "amount": {
                 "type": "integer",
                 "description": "Amount in öre (1/100 kr), excluding VAT.",
                 "nullable": true
                },
                "conditions": {
                 "type": "array",
                 "items": {
                  "type": "object",
                  "properties": {
                   "text": {
                    "type": "string"
                   },
                   "data": {
                    "type": "object",
                    "additionalProperties": true
                   }
                  },
                  "additionalProperties": true
                 }
                },
                "rules": {
                 "type": "array",
                 "items": {
                  "type": "object",
                  "properties": {
                   "key": {
                    "type": "string"
                   },
                   "outcome": {
                    "type": "string",
                    "enum": [
                     "on_request",
                     "indicative",
                     "note"
                    ]
                   },
                   "text": {
                    "type": "string",
                    "description": "The rule as a sentence, written from the data."
                   },
                   "reason": {
                    "type": "string",
                    "description": "What the person is told when the rule is not met."
                   },
                   "part": {
                    "type": "string",
                    "nullable": true
                   }
                  }
                 }
                }
               }
              }
             },
             "min": {
              "type": "integer",
              "nullable": true
             },
             "max": {
              "type": "integer",
              "nullable": true
             },
             "priceBasis": {
              "type": "object",
              "nullable": true,
              "properties": {
               "partySize": {
                "type": "integer"
               },
               "min": {
                "type": "integer"
               },
               "max": {
                "type": "integer"
               },
               "text": {
                "type": "string",
                "nullable": true
               }
              }
             },
             "conditions": {
              "type": "array",
              "items": {
               "type": "string"
              }
             },
             "rules": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "key": {
                 "type": "string"
                },
                "outcome": {
                 "type": "string",
                 "enum": [
                  "on_request",
                  "indicative",
                  "note"
                 ]
                },
                "text": {
                 "type": "string",
                 "description": "The rule as a sentence, written from the data."
                },
                "reason": {
                 "type": "string",
                 "description": "What the person is told when the rule is not met."
                },
                "part": {
                 "type": "string",
                 "nullable": true
                }
               }
              }
             },
             "included": {
              "type": "array",
              "items": {
               "type": "string"
              }
             },
             "swaps": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "key": {
                 "type": "string"
                },
                "name": {
                 "type": "string"
                },
                "part": {
                 "type": "string",
                 "description": "The part brought in."
                },
                "replaces": {
                 "type": "string",
                 "nullable": true,
                 "description": "The part replaced (swaps)."
                },
                "group": {
                 "type": "string",
                 "nullable": true
                },
                "required": {
                 "type": "boolean",
                 "description": "In effect without being chosen when its conditions hold."
                },
                "conditions": {
                 "type": "array",
                 "items": {
                  "type": "object",
                  "properties": {
                   "text": {
                    "type": "string"
                   },
                   "data": {
                    "type": "object",
                    "additionalProperties": true
                   }
                  },
                  "additionalProperties": true
                 }
                },
                "rules": {
                 "type": "array",
                 "items": {
                  "type": "object",
                  "properties": {
                   "key": {
                    "type": "string"
                   },
                   "outcome": {
                    "type": "string",
                    "enum": [
                     "on_request",
                     "indicative",
                     "note"
                    ]
                   },
                   "text": {
                    "type": "string",
                    "description": "The rule as a sentence, written from the data."
                   },
                   "reason": {
                    "type": "string",
                    "description": "What the person is told when the rule is not met."
                   },
                   "part": {
                    "type": "string",
                    "nullable": true
                   }
                  }
                 }
                },
                "rows": {
                 "type": "array",
                 "description": "A swap's hand-written difference or an add-on's hand-written price. Which row applies depends on the row's conditions. Only hand-written rows are listed (order 0018): a computed price, or one set from zero or as a surcharge on the alternative's own price, is charged by `evaluate`.",
                 "items": {
                  "type": "object",
                  "properties": {
                   "perGuest": {
                    "type": "integer",
                    "description": "Amount in öre (1/100 kr), excluding VAT.",
                    "nullable": true
                   },
                   "perGroup": {
                    "type": "integer",
                    "description": "Amount in öre (1/100 kr), excluding VAT.",
                    "nullable": true
                   },
                   "vatRate": {
                    "type": "integer",
                    "description": "Basis points; 2500 = 25 %."
                   },
                   "status": {
                    "type": "string",
                    "enum": [
                     "unconfirmed",
                     "valid"
                    ]
                   },
                   "conditions": {
                    "type": "array",
                    "items": {
                     "type": "object",
                     "properties": {
                      "text": {
                       "type": "string"
                      },
                      "data": {
                       "type": "object",
                       "additionalProperties": true
                      }
                     },
                     "additionalProperties": true
                    }
                   }
                  }
                 }
                },
                "notOfferedReason": {
                 "type": "string",
                 "nullable": true
                },
                "priceSource": {
                 "type": "string",
                 "enum": [
                  "computed",
                  "hand_written",
                  "from_zero",
                  "surcharge"
                 ],
                 "description": "Order 0018 (additive): how the price is made. `computed` from the parts (no rows; `evaluate` gives the amount), `hand_written` (the rows), `from_zero` or `surcharge` (set on or added to the alternative's own price; `evaluate` gives the amount)."
                }
               }
              }
             },
             "addOns": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "key": {
                 "type": "string"
                },
                "name": {
                 "type": "string"
                },
                "part": {
                 "type": "string",
                 "description": "The part brought in."
                },
                "replaces": {
                 "type": "string",
                 "nullable": true,
                 "description": "The part replaced (swaps)."
                },
                "group": {
                 "type": "string",
                 "nullable": true
                },
                "required": {
                 "type": "boolean",
                 "description": "In effect without being chosen when its conditions hold."
                },
                "conditions": {
                 "type": "array",
                 "items": {
                  "type": "object",
                  "properties": {
                   "text": {
                    "type": "string"
                   },
                   "data": {
                    "type": "object",
                    "additionalProperties": true
                   }
                  },
                  "additionalProperties": true
                 }
                },
                "rules": {
                 "type": "array",
                 "items": {
                  "type": "object",
                  "properties": {
                   "key": {
                    "type": "string"
                   },
                   "outcome": {
                    "type": "string",
                    "enum": [
                     "on_request",
                     "indicative",
                     "note"
                    ]
                   },
                   "text": {
                    "type": "string",
                    "description": "The rule as a sentence, written from the data."
                   },
                   "reason": {
                    "type": "string",
                    "description": "What the person is told when the rule is not met."
                   },
                   "part": {
                    "type": "string",
                    "nullable": true
                   }
                  }
                 }
                },
                "rows": {
                 "type": "array",
                 "description": "A swap's hand-written difference or an add-on's hand-written price. Which row applies depends on the row's conditions. Only hand-written rows are listed (order 0018): a computed price, or one set from zero or as a surcharge on the alternative's own price, is charged by `evaluate`.",
                 "items": {
                  "type": "object",
                  "properties": {
                   "perGuest": {
                    "type": "integer",
                    "description": "Amount in öre (1/100 kr), excluding VAT.",
                    "nullable": true
                   },
                   "perGroup": {
                    "type": "integer",
                    "description": "Amount in öre (1/100 kr), excluding VAT.",
                    "nullable": true
                   },
                   "vatRate": {
                    "type": "integer",
                    "description": "Basis points; 2500 = 25 %."
                   },
                   "status": {
                    "type": "string",
                    "enum": [
                     "unconfirmed",
                     "valid"
                    ]
                   },
                   "conditions": {
                    "type": "array",
                    "items": {
                     "type": "object",
                     "properties": {
                      "text": {
                       "type": "string"
                      },
                      "data": {
                       "type": "object",
                       "additionalProperties": true
                      }
                     },
                     "additionalProperties": true
                    }
                   }
                  }
                 }
                },
                "notOfferedReason": {
                 "type": "string",
                 "nullable": true
                },
                "priceSource": {
                 "type": "string",
                 "enum": [
                  "computed",
                  "hand_written",
                  "from_zero",
                  "surcharge"
                 ],
                 "description": "Order 0018 (additive): how the price is made. `computed` from the parts (no rows; `evaluate` gives the amount), `hand_written` (the rows), `from_zero` or `surcharge` (set on or added to the alternative's own price; `evaluate` gives the amount)."
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Default Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the scope offerings:read.",
      "content": {
       "application/json": {
        "schema": {
         "description": "The key lacks the scope offerings:read.",
         "type": "object",
         "required": [
          "error",
          "message"
         ],
         "properties": {
          "error": {
           "type": "string"
          },
          "field": {
           "type": "string",
           "nullable": true,
           "description": "The request field the message is about."
          },
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "x-producer": "experiencer"
  },
  "/v1/offerings/{key}/evaluate": {
   "post": {
    "summary": "Evaluate an Offering for a date or season, a party size and chosen options",
    "tags": [
     "offerings"
    ],
    "description": "Runs the engine's functions and stores nothing. Give exactly one of `date` and `season`; a date is today or later (today in the Business's time zone, `quoteDate` in the answer — the caller does not send it). With a date the answer includes the resolved agenda; with only a season it does not, and rules that need a date come back in `unchecked`. `complete` is false whenever `unchecked` is not empty: a fixed price may only be promised when it is true. Options that are required (the larger room above 12 guests) are added by the engine: they are in `requiredOptions`, in the agenda and priced. Each agenda line carries `split` (order 0017): `{ key, kind, branch }` for a line in a split of the group (`kind` `optional_activity` or `divided_group`; `branch` 0 for the line the split hangs under, 1…n per track; the innermost split), else null. A split counts only when at least two of its branches have lines in this agenda (order 0021): with only add-ons that are not chosen on the other tracks, `split` is null. `mode` says how a price may be shown (`package` fixed, `indicative` guidance, `on_request` no price: `price` is null); `price.status` says whether it may be shown openly (`unconfirmed` must not, ADR-0010). Server-to-server only.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "partySize"
        ],
        "additionalProperties": false,
        "properties": {
         "date": {
          "type": "string",
          "description": "Start date, YYYY-MM-DD."
         },
         "season": {
          "type": "string",
          "description": "A season key, for an enquiry without a date."
         },
         "partySize": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
         },
         "options": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Option keys the buyer chose. No travel option = own travel."
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "schema": {
       "type": "string"
      },
      "in": "path",
      "name": "key",
      "required": true
     }
    ],
    "security": [
     {
      "bearerAuth": []
     },
     {
      "apiKeyAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "Default Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "offering",
          "version",
          "input",
          "quoteDate",
          "mode",
          "complete",
          "reasons",
          "notes",
          "unchecked",
          "options",
          "requiredOptions",
          "price",
          "priceProblems",
          "agenda"
         ],
         "properties": {
          "offering": {
           "type": "string"
          },
          "version": {
           "type": "integer"
          },
          "input": {
           "type": "object",
           "additionalProperties": true
          },
          "quoteDate": {
           "type": "string",
           "description": "Today in the Business's time zone: the day the evaluation was made."
          },
          "mode": {
           "type": "string",
           "enum": [
            "package",
            "indicative",
            "on_request"
           ]
          },
          "complete": {
           "type": "boolean",
           "description": "False when anything is in `unchecked`. A fixed price may only be promised when this is true."
          },
          "reasons": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": true
           }
          },
          "notes": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": true
           }
          },
          "unchecked": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": true
           }
          },
          "options": {
           "type": "array",
           "description": "Every option of the package: `key`, `offered`, `required`, `reasons`; and (order 0018, additive) `priceSource` (`computed` from the parts, `hand_written`, `from_zero`, `surcharge`) and `minimum` (the alternative's minimum charged quantity in words, or null: `quantity`, `charged`, `added`, `text` such as *ca 2 500 kr inkl. 5 gäster, därefter 500 kr/gäst*, `addedText` such as *+1 för att nå minsta bokning*). A computed price that cannot be made (a part without a price) makes the choice `indicative`, with a reason of source `option_price_unknown`.",
           "items": {
            "type": "object",
            "additionalProperties": true
           }
          },
          "requiredOptions": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "price": {
           "type": "object",
           "nullable": true,
           "additionalProperties": true,
           "properties": {
            "status": {
             "type": "string",
             "enum": [
              "unconfirmed",
              "valid"
             ]
            },
            "totalExVat": {
             "type": "integer",
             "description": "Amount in öre (1/100 kr), excluding VAT."
            },
            "totalIncVat": {
             "type": "integer",
             "description": "Amount in öre (1/100 kr), excluding VAT."
            },
            "perGuestExVat": {
             "type": "integer",
             "description": "Amount in öre (1/100 kr), excluding VAT."
            }
           }
          },
          "priceProblems": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": true
           }
          },
          "agenda": {
           "type": "object",
           "nullable": true,
           "additionalProperties": true
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "A mistake in the request; `field` names it.",
      "content": {
       "application/json": {
        "schema": {
         "description": "A mistake in the request; `field` names it.",
         "type": "object",
         "required": [
          "error",
          "message"
         ],
         "properties": {
          "error": {
           "type": "string"
          },
          "field": {
           "type": "string",
           "nullable": true,
           "description": "The request field the message is about."
          },
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Default Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the scope offerings:read.",
      "content": {
       "application/json": {
        "schema": {
         "description": "The key lacks the scope offerings:read.",
         "type": "object",
         "required": [
          "error",
          "message"
         ],
         "properties": {
          "error": {
           "type": "string"
          },
          "field": {
           "type": "string",
           "nullable": true,
           "description": "The request field the message is about."
          },
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such offering.",
      "content": {
       "application/json": {
        "schema": {
         "description": "No such offering.",
         "type": "object",
         "required": [
          "error",
          "message"
         ],
         "properties": {
          "error": {
           "type": "string"
          },
          "field": {
           "type": "string",
           "nullable": true,
           "description": "The request field the message is about."
          },
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Something went wrong on our side. The message is logged under the request id, never sent.",
      "content": {
       "application/json": {
        "schema": {
         "description": "Something went wrong on our side. The message is logged under the request id, never sent.",
         "type": "object",
         "required": [
          "error",
          "requestId"
         ],
         "properties": {
          "error": {
           "type": "string",
           "enum": [
            "internal"
           ]
          },
          "requestId": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "x-producer": "experiencer"
  }
 }
}
