{
 "openapi": "3.1.0",
 "info": {
  "title": "Verkstofa API",
  "version": "1.9",
  "description": "Opið API Verkstofu. Búið til sjálfkrafa úr grunninum (verkfaeri/api_skjol.py). Reikningar verða alltaf drög."
 },
 "servers": [
  {
   "url": "https://uijopyskwnozqbqsmpho.supabase.co/functions/v1/api/v1",
   "description": "Raun og sandkassi (lykillinn ræður hvaða fyrirtæki svarar)"
  }
 ],
 "components": {
  "securitySchemes": {
   "lykill": {
    "type": "http",
    "scheme": "bearer",
    "description": "vs_<48 hex> – úr Uppsetning → API-lyklar (raun) eða „Sandkassalykill“ (Sýnishorn, gervigögn)"
   }
  },
  "schemas": {
   "Villa": {
    "type": "object",
    "properties": {
     "villa": {
      "type": "string"
     }
    }
   },
   "Vidskiptavinir": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "nullable": true
     },
     "land": {
      "type": "string",
      "nullable": true
     },
     "nafn": {
      "type": "string",
      "nullable": true
     },
     "simi": {
      "type": "string",
      "nullable": true
     },
     "postnr": {
      "type": "string",
      "nullable": true
     },
     "stadur": {
      "type": "string",
      "nullable": true
     },
     "virkur": {
      "type": "boolean"
     },
     "netfang": {
      "type": "string",
      "nullable": true
     },
     "stofnad": {
      "type": "string",
      "format": "date-time"
     },
     "uppfaert": {
      "type": "string",
      "format": "date-time"
     },
     "kennitala": {
      "type": "string",
      "nullable": true
     },
     "ytra_numer": {
      "type": "string",
      "nullable": true
     },
     "heimilisfang": {
      "type": "string",
      "nullable": true
     },
     "netfang_reikninga": {
      "type": "string",
      "nullable": true
     },
     "greidslufrestur_dagar": {
      "type": "integer"
     }
    }
   },
   "Vorur": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "nullable": true
     },
     "virk": {
      "type": "boolean"
     },
     "heiti": {
      "type": "string",
      "nullable": true
     },
     "numer": {
      "type": "string",
      "nullable": true
     },
     "eining": {
      "type": "string",
      "nullable": true
     },
     "i_bodi": {
      "type": "boolean"
     },
     "lysing": {
      "type": "string",
      "nullable": true
     },
     "tegund": {
      "type": "string",
      "nullable": true
     },
     "vsk_pr": {
      "type": "integer"
     },
     "stofnad": {
      "type": "string",
      "format": "date-time"
     },
     "soluverd": {
      "type": "integer"
     },
     "uppfaert": {
      "type": "string",
      "format": "date-time"
     },
     "birgdastyrd": {
      "type": "boolean"
     },
     "strikamerki": {
      "type": "array",
      "items": {
       "type": "string",
       "nullable": true
      }
     }
    }
   },
   "Birgdastada": {
    "type": "object",
    "properties": {
     "heiti": {
      "type": "string",
      "nullable": true
     },
     "lager": {
      "type": "integer"
     },
     "numer": {
      "type": "string",
      "nullable": true
     },
     "stadir": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "lager": {
         "type": "integer"
        },
        "stadur": {
         "type": "string",
         "nullable": true
        },
        "tiltaekt": {
         "type": "integer"
        }
       }
      }
     },
     "vara_id": {
      "type": "string",
      "nullable": true
     },
     "fratekid": {
      "type": "integer"
     },
     "tiltaekt": {
      "type": "integer"
     },
     "vaentanlegt": {
      "type": "integer"
     }
    }
   },
   "Reikningar": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "nullable": true
     },
     "vsk": {
      "type": "integer"
     },
     "dags": {
      "type": "string",
      "format": "date"
     },
     "numer": {
      "type": "integer"
     },
     "stada": {
      "type": "string",
      "nullable": true
     },
     "eindagi": {
      "type": "string",
      "nullable": true
     },
     "stofnad": {
      "type": "string",
      "format": "date-time"
     },
     "upphaed": {
      "type": "integer"
     },
     "verk_id": {
      "type": "string",
      "nullable": true
     },
     "tilvisun": {
      "type": "string",
      "nullable": true
     },
     "uppfaert": {
      "type": "string",
      "format": "date-time"
     },
     "gjalddagi": {
      "type": "string",
      "format": "date"
     },
     "greitt_kl": {
      "type": "string",
      "format": "date-time"
     },
     "kredit_fyrir": {
      "type": "string",
      "nullable": true
     },
     "pontunarnumer": {
      "type": "string",
      "nullable": true
     },
     "upphaed_an_vsk": {
      "type": "integer"
     },
     "vidskiptavinur": {
      "type": "string",
      "nullable": true
     },
     "vidskiptavinur_id": {
      "type": "string",
      "nullable": true
     }
    }
   },
   "Verk": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "nafn": {
      "type": "string",
      "nullable": true
     },
     "stada": {
      "type": "string",
      "nullable": true
     },
     "verknr": {
      "type": "string",
      "nullable": true
     },
     "stofnad": {
      "type": "string",
      "format": "date-time"
     },
     "uppfaert": {
      "type": "string",
      "format": "date-time"
     },
     "vidskiptavinur": {
      "type": "string",
      "nullable": true
     },
     "aaetlud_verklok": {
      "type": "string",
      "nullable": true
     },
     "vidskiptavinur_id": {
      "type": "string",
      "nullable": true
     }
    }
   },
   "Tímar": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "nullable": true
     },
     "ut": {
      "type": "string",
      "format": "date-time"
     },
     "inn": {
      "type": "string",
      "format": "date-time"
     },
     "dags": {
      "type": "string",
      "format": "date"
     },
     "klst": {
      "type": "integer"
     },
     "verk": {
      "type": "string",
      "nullable": true
     },
     "dv_klst": {
      "type": "integer"
     },
     "verk_id": {
      "type": "integer"
     },
     "yv_klst": {
      "type": "integer"
     },
     "aukaverk": {
      "type": "boolean"
     },
     "verklysing": {
      "type": "string",
      "nullable": true
     },
     "starfsmadur": {
      "type": "string",
      "nullable": true
     },
     "starfsmadur_id": {
      "type": "string",
      "nullable": true
     }
    }
   }
  }
 },
 "security": [
  {
   "lykill": []
  }
 ],
 "paths": {
  "/vidskiptavinir": {
   "get": {
    "summary": "Viðskiptavinir",
    "operationId": "saekja_vidskiptavinir",
    "parameters": [
     {
      "name": "sida",
      "in": "query",
      "required": false,
      "description": "Síða (frá 1)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "staerd",
      "in": "query",
      "required": false,
      "description": "Stærð síðu (1–200, sjálfgefið 50)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "leit",
      "in": "query",
      "required": false,
      "description": "Frjáls leit",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "breytt_eftir",
      "in": "query",
      "required": false,
      "description": "Aðeins breytt eftir þessum tíma (ISO 8601)",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Síða",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "gogn": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string",
              "nullable": true
             },
             "land": {
              "type": "string",
              "nullable": true
             },
             "nafn": {
              "type": "string",
              "nullable": true
             },
             "simi": {
              "type": "string",
              "nullable": true
             },
             "postnr": {
              "type": "string",
              "nullable": true
             },
             "stadur": {
              "type": "string",
              "nullable": true
             },
             "virkur": {
              "type": "boolean"
             },
             "netfang": {
              "type": "string",
              "nullable": true
             },
             "stofnad": {
              "type": "string",
              "format": "date-time"
             },
             "uppfaert": {
              "type": "string",
              "format": "date-time"
             },
             "kennitala": {
              "type": "string",
              "nullable": true
             },
             "ytra_numer": {
              "type": "string",
              "nullable": true
             },
             "heimilisfang": {
              "type": "string",
              "nullable": true
             },
             "netfang_reikninga": {
              "type": "string",
              "nullable": true
             },
             "greidslufrestur_dagar": {
              "type": "integer"
             }
            }
           }
          },
          "sida": {
           "type": "integer"
          },
          "staerd": {
           "type": "integer"
          },
          "fjoldi": {
           "type": "integer"
          },
          "naesta_sida": {
           "type": [
            "integer",
            "null"
           ]
          }
         }
        },
        "example": {
         "gogn": [
          {
           "id": "6e39eaae-7b0e-49d0-bc9a-26591290df63",
           "land": "IS",
           "nafn": "Byggingafélagið Hlíð ehf",
           "simi": null,
           "postnr": "201",
           "stadur": "Kópavogur",
           "virkur": true,
           "netfang": "netfang@daemi.is",
           "stofnad": "2026-10-20T17:10:00.629992+00:00",
           "uppfaert": "2026-10-20T17:10:00.629992+00:00",
           "kennitala": "0000000000",
           "ytra_numer": null,
           "heimilisfang": "Hlíðarsmári 40",
           "netfang_reikninga": null,
           "greidslufrestur_dagar": 30
          },
          {
           "id": "5fc5dc15-ae08-4bda-919f-78e30b272836",
           "land": "IS",
           "nafn": "Einar Dæmason",
           "simi": null,
           "postnr": "108",
           "stadur": "Reykjavík",
           "virkur": true,
           "netfang": "netfang@daemi.is",
           "stofnad": "2026-10-20T17:10:00.629992+00:00",
           "uppfaert": "2026-10-20T17:10:00.629992+00:00",
           "kennitala": "0000000000",
           "ytra_numer": null,
           "heimilisfang": "Melgerði 3",
           "netfang_reikninga": null,
           "greidslufrestur_dagar": 14
          }
         ],
         "sida": 1,
         "fjoldi": 8,
         "staerd": 2,
         "naesta_sida": 2
        }
       }
      }
     },
     "401": {
      "description": "Lykill vantar eða er ógildur · Lykillinn er útrunninn – búðu til nýjan sandkassalykil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "403": {
      "description": "Sandkassalykill gildir aðeins á sýnishornsfyrirtæki · API er ekki opið fyrir þetta fyrirtæki · Lykillinn hefur ekki réttindin ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "429": {
      "description": "Of margar rangar tilraunir – reyndu aftur síðar · Hámark ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Nýtt: Viðskiptavinir",
    "operationId": "bua_til_vidskiptavinir",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "nafn": {
          "type": "string"
         },
         "kennitala": {
          "type": "string"
         },
         "netfang": {
          "type": "string"
         },
         "netfang_reikninga": {
          "type": "string"
         },
         "simi": {
          "type": "string"
         },
         "gsm": {
          "type": "string"
         },
         "heimilisfang": {
          "type": "string"
         },
         "heimilisfang2": {
          "type": "string"
         },
         "postnr": {
          "type": "string"
         },
         "stadur": {
          "type": "string"
         },
         "land": {
          "type": "string"
         },
         "tengilidur": {
          "type": "string"
         },
         "greidslufrestur_dagar": {
          "type": "string"
         },
         "ytra_numer": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Búið til"
     },
     "400": {
      "description": "Tímabil má mest vera 366 dagar · Efni þarf að vera JSON-hlutur · tegund er vara eða thjonusta"
     },
     "409": {
      "description": "Viðskiptavinur með þessa kennitölu er þegar til · Vörunúmer er þegar til"
     },
     "422": {
      "description": "Viðskiptavinur finnst ekki · Vörunúmer finnst ekki: "
     }
    }
   }
  },
  "/vidskiptavinir/{id}": {
   "get": {
    "summary": "Viðskiptavinir – einn",
    "operationId": "saekja_einn_vidskiptavinir",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Hlutur",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string",
           "nullable": true
          },
          "land": {
           "type": "string",
           "nullable": true
          },
          "nafn": {
           "type": "string",
           "nullable": true
          },
          "simi": {
           "type": "string",
           "nullable": true
          },
          "postnr": {
           "type": "string",
           "nullable": true
          },
          "stadur": {
           "type": "string",
           "nullable": true
          },
          "virkur": {
           "type": "boolean"
          },
          "netfang": {
           "type": "string",
           "nullable": true
          },
          "stofnad": {
           "type": "string",
           "format": "date-time"
          },
          "uppfaert": {
           "type": "string",
           "format": "date-time"
          },
          "kennitala": {
           "type": "string",
           "nullable": true
          },
          "ytra_numer": {
           "type": "string",
           "nullable": true
          },
          "heimilisfang": {
           "type": "string",
           "nullable": true
          },
          "netfang_reikninga": {
           "type": "string",
           "nullable": true
          },
          "greidslufrestur_dagar": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Finnst ekki"
     }
    }
   }
  },
  "/vorur": {
   "get": {
    "summary": "Vörur",
    "operationId": "saekja_vorur",
    "parameters": [
     {
      "name": "sida",
      "in": "query",
      "required": false,
      "description": "Síða (frá 1)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "staerd",
      "in": "query",
      "required": false,
      "description": "Stærð síðu (1–200, sjálfgefið 50)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "leit",
      "in": "query",
      "required": false,
      "description": "Frjáls leit",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "breytt_eftir",
      "in": "query",
      "required": false,
      "description": "Aðeins breytt eftir þessum tíma (ISO 8601)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "numer",
      "in": "query",
      "required": false,
      "description": "Vörunúmer (nákvæmt)",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Síða",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "gogn": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string",
              "nullable": true
             },
             "virk": {
              "type": "boolean"
             },
             "heiti": {
              "type": "string",
              "nullable": true
             },
             "numer": {
              "type": "string",
              "nullable": true
             },
             "eining": {
              "type": "string",
              "nullable": true
             },
             "i_bodi": {
              "type": "boolean"
             },
             "lysing": {
              "type": "string",
              "nullable": true
             },
             "tegund": {
              "type": "string",
              "nullable": true
             },
             "vsk_pr": {
              "type": "integer"
             },
             "stofnad": {
              "type": "string",
              "format": "date-time"
             },
             "soluverd": {
              "type": "integer"
             },
             "uppfaert": {
              "type": "string",
              "format": "date-time"
             },
             "birgdastyrd": {
              "type": "boolean"
             },
             "strikamerki": {
              "type": "array",
              "items": {
               "type": "string",
               "nullable": true
              }
             }
            }
           }
          },
          "sida": {
           "type": "integer"
          },
          "staerd": {
           "type": "integer"
          },
          "fjoldi": {
           "type": "integer"
          },
          "naesta_sida": {
           "type": [
            "integer",
            "null"
           ]
          }
         }
        },
        "example": {
         "gogn": [
          {
           "id": "5f14974b-f0cb-408a-9d04-5f3a4d3f5437",
           "virk": true,
           "heiti": "Rakavarnardúkur 0,2 mm (rúlla 50 m²)",
           "numer": "EIN-DUKUR",
           "eining": "rl",
           "i_bodi": true,
           "lysing": null,
           "tegund": "vara",
           "vsk_pr": 24,
           "stofnad": "2026-10-20T17:10:00.629992+00:00",
           "soluverd": 14900,
           "uppfaert": "2026-10-20T17:13:07.987883+00:00",
           "birgdastyrd": true,
           "strikamerki": [
            "5690001197975"
           ]
          },
          {
           "id": "1315c683-5800-4720-a171-bef51b59d24e",
           "virk": true,
           "heiti": "Steinull 100 mm (pk 3,6 m²)",
           "numer": "EIN-STEIN",
           "eining": "pk",
           "i_bodi": true,
           "lysing": null,
           "tegund": "vara",
           "vsk_pr": 24,
           "stofnad": "2026-10-20T17:10:00.629992+00:00",
           "soluverd": 5900,
           "uppfaert": "2026-10-20T17:13:07.987883+00:00",
           "birgdastyrd": true,
           "strikamerki": [
            "5690001190056"
           ]
          }
         ],
         "sida": 1,
         "fjoldi": 28,
         "staerd": 2,
         "naesta_sida": 2
        }
       }
      }
     },
     "401": {
      "description": "Lykill vantar eða er ógildur · Lykillinn er útrunninn – búðu til nýjan sandkassalykil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "403": {
      "description": "Sandkassalykill gildir aðeins á sýnishornsfyrirtæki · API er ekki opið fyrir þetta fyrirtæki · Lykillinn hefur ekki réttindin ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "429": {
      "description": "Of margar rangar tilraunir – reyndu aftur síðar · Hámark ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Nýtt: Vörur",
    "operationId": "bua_til_vorur",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "numer": {
          "type": "string"
         },
         "heiti": {
          "type": "string"
         },
         "lysing": {
          "type": "string"
         },
         "eining": {
          "type": "string"
         },
         "soluverd": {
          "type": "string"
         },
         "vsk_pr": {
          "type": "string"
         },
         "tegund": {
          "type": "string"
         },
         "strikamerki": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Búið til"
     },
     "400": {
      "description": "Tímabil má mest vera 366 dagar · Efni þarf að vera JSON-hlutur · tegund er vara eða thjonusta"
     },
     "409": {
      "description": "Viðskiptavinur með þessa kennitölu er þegar til · Vörunúmer er þegar til"
     },
     "422": {
      "description": "Viðskiptavinur finnst ekki · Vörunúmer finnst ekki: "
     }
    }
   }
  },
  "/vorur/{id}": {
   "get": {
    "summary": "Vörur – einn",
    "operationId": "saekja_einn_vorur",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Hlutur",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string",
           "nullable": true
          },
          "virk": {
           "type": "boolean"
          },
          "heiti": {
           "type": "string",
           "nullable": true
          },
          "numer": {
           "type": "string",
           "nullable": true
          },
          "eining": {
           "type": "string",
           "nullable": true
          },
          "i_bodi": {
           "type": "boolean"
          },
          "lysing": {
           "type": "string",
           "nullable": true
          },
          "tegund": {
           "type": "string",
           "nullable": true
          },
          "vsk_pr": {
           "type": "integer"
          },
          "stofnad": {
           "type": "string",
           "format": "date-time"
          },
          "soluverd": {
           "type": "integer"
          },
          "uppfaert": {
           "type": "string",
           "format": "date-time"
          },
          "birgdastyrd": {
           "type": "boolean"
          },
          "strikamerki": {
           "type": "array",
           "items": {
            "type": "string",
            "nullable": true
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Finnst ekki"
     }
    }
   }
  },
  "/birgdastada": {
   "get": {
    "summary": "Birgðastaða",
    "operationId": "saekja_birgdastada",
    "parameters": [
     {
      "name": "sida",
      "in": "query",
      "required": false,
      "description": "Síða (frá 1)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "staerd",
      "in": "query",
      "required": false,
      "description": "Stærð síðu (1–200, sjálfgefið 50)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "numer",
      "in": "query",
      "required": false,
      "description": "Vörunúmer (nákvæmt)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "vara_id",
      "in": "query",
      "required": false,
      "description": "Auðkenni vöru",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Síða",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "gogn": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "heiti": {
              "type": "string",
              "nullable": true
             },
             "lager": {
              "type": "integer"
             },
             "numer": {
              "type": "string",
              "nullable": true
             },
             "stadir": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "lager": {
                 "type": "integer"
                },
                "stadur": {
                 "type": "string",
                 "nullable": true
                },
                "tiltaekt": {
                 "type": "integer"
                }
               }
              }
             },
             "vara_id": {
              "type": "string",
              "nullable": true
             },
             "fratekid": {
              "type": "integer"
             },
             "tiltaekt": {
              "type": "integer"
             },
             "vaentanlegt": {
              "type": "integer"
             }
            }
           }
          },
          "sida": {
           "type": "integer"
          },
          "staerd": {
           "type": "integer"
          },
          "fjoldi": {
           "type": "integer"
          },
          "naesta_sida": {
           "type": [
            "integer",
            "null"
           ]
          }
         }
        },
        "example": {
         "gogn": [
          {
           "heiti": "Rakavarnardúkur 0,2 mm (rúlla 50 m²)",
           "lager": 7,
           "numer": "EIN-DUKUR",
           "stadir": [
            {
             "lager": 7,
             "stadur": "Lager",
             "tiltaekt": 7
            }
           ],
           "vara_id": "5f14974b-f0cb-408a-9d04-5f3a4d3f5437",
           "fratekid": 0,
           "tiltaekt": 7,
           "vaentanlegt": 0
          },
          {
           "heiti": "Steinull 100 mm (pk 3,6 m²)",
           "lager": 85,
           "numer": "EIN-STEIN",
           "stadir": [
            {
             "lager": 85,
             "stadur": "Lager",
             "tiltaekt": 85
            }
           ],
           "vara_id": "1315c683-5800-4720-a171-bef51b59d24e",
           "fratekid": 0,
           "tiltaekt": 85,
           "vaentanlegt": 0
          }
         ],
         "sida": 1,
         "fjoldi": 27,
         "staerd": 2,
         "naesta_sida": 2
        }
       }
      }
     },
     "401": {
      "description": "Lykill vantar eða er ógildur · Lykillinn er útrunninn – búðu til nýjan sandkassalykil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "403": {
      "description": "Sandkassalykill gildir aðeins á sýnishornsfyrirtæki · API er ekki opið fyrir þetta fyrirtæki · Lykillinn hefur ekki réttindin ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "429": {
      "description": "Of margar rangar tilraunir – reyndu aftur síðar · Hámark ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     }
    }
   }
  },
  "/reikningar": {
   "get": {
    "summary": "Reikningar",
    "operationId": "saekja_reikningar",
    "parameters": [
     {
      "name": "sida",
      "in": "query",
      "required": false,
      "description": "Síða (frá 1)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "staerd",
      "in": "query",
      "required": false,
      "description": "Stærð síðu (1–200, sjálfgefið 50)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "breytt_eftir",
      "in": "query",
      "required": false,
      "description": "Aðeins breytt eftir þessum tíma (ISO 8601)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "fra",
      "in": "query",
      "required": false,
      "description": "Frá dags. (ÁÁÁÁ-MM-DD)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "til",
      "in": "query",
      "required": false,
      "description": "Til dags. (ÁÁÁÁ-MM-DD)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "stada",
      "in": "query",
      "required": false,
      "description": "Staða",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "vidskiptavinur_id",
      "in": "query",
      "required": false,
      "description": "Auðkenni viðskiptavinar",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Síða",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "gogn": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string",
              "nullable": true
             },
             "vsk": {
              "type": "integer"
             },
             "dags": {
              "type": "string",
              "format": "date"
             },
             "numer": {
              "type": "integer"
             },
             "stada": {
              "type": "string",
              "nullable": true
             },
             "eindagi": {
              "type": "string",
              "nullable": true
             },
             "stofnad": {
              "type": "string",
              "format": "date-time"
             },
             "upphaed": {
              "type": "integer"
             },
             "verk_id": {
              "type": "string",
              "nullable": true
             },
             "tilvisun": {
              "type": "string",
              "nullable": true
             },
             "uppfaert": {
              "type": "string",
              "format": "date-time"
             },
             "gjalddagi": {
              "type": "string",
              "format": "date"
             },
             "greitt_kl": {
              "type": "string",
              "format": "date-time"
             },
             "kredit_fyrir": {
              "type": "string",
              "nullable": true
             },
             "pontunarnumer": {
              "type": "string",
              "nullable": true
             },
             "upphaed_an_vsk": {
              "type": "integer"
             },
             "vidskiptavinur": {
              "type": "string",
              "nullable": true
             },
             "vidskiptavinur_id": {
              "type": "string",
              "nullable": true
             }
            }
           }
          },
          "sida": {
           "type": "integer"
          },
          "staerd": {
           "type": "integer"
          },
          "fjoldi": {
           "type": "integer"
          },
          "naesta_sida": {
           "type": [
            "integer",
            "null"
           ]
          }
         }
        },
        "example": {
         "gogn": [
          {
           "id": "3ee6d374-9893-4e0e-a9c0-3cb3c6b90806",
           "vsk": 3576,
           "dags": "2026-10-20",
           "numer": 20,
           "stada": "greitt",
           "eindagi": null,
           "stofnad": "2026-10-20T17:13:07.987883+00:00",
           "upphaed": 18476,
           "verk_id": null,
           "tilvisun": "Pöntun 11",
           "uppfaert": "2026-10-20T17:13:07.987883+00:00",
           "gjalddagi": "2026-11-19",
           "greitt_kl": "2026-10-20T17:13:07.987883+00:00",
           "kredit_fyrir": null,
           "pontunarnumer": null,
           "upphaed_an_vsk": 14900,
           "vidskiptavinur": "Staðgreiðsla",
           "vidskiptavinur_id": "236733ad-7102-4349-bfdd-d49d9e2c3ae5"
          },
          {
           "id": "205dceb8-d89a-4746-8aaa-8eab5c03d72a",
           "vsk": 4152,
           "dags": "2026-10-20",
           "numer": 19,
           "stada": "greitt",
           "eindagi": null,
           "stofnad": "2026-10-20T17:13:07.987883+00:00",
           "upphaed": 21452,
           "verk_id": null,
           "tilvisun": "Pöntun 10",
           "uppfaert": "2026-10-20T17:13:07.987883+00:00",
           "gjalddagi": "2026-11-19",
           "greitt_kl": "2026-10-20T17:13:07.987883+00:00",
           "kredit_fyrir": null,
           "pontunarnumer": null,
           "upphaed_an_vsk": 17300,
           "vidskiptavinur": "Staðgreiðsla",
           "vidskiptavinur_id": "236733ad-7102-4349-bfdd-d49d9e2c3ae5"
          }
         ],
         "sida": 1,
         "fjoldi": 20,
         "staerd": 2,
         "naesta_sida": 2
        }
       }
      }
     },
     "401": {
      "description": "Lykill vantar eða er ógildur · Lykillinn er útrunninn – búðu til nýjan sandkassalykil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "403": {
      "description": "Sandkassalykill gildir aðeins á sýnishornsfyrirtæki · API er ekki opið fyrir þetta fyrirtæki · Lykillinn hefur ekki réttindin ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "429": {
      "description": "Of margar rangar tilraunir – reyndu aftur síðar · Hámark ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Nýtt: Reikningar (alltaf drög)",
    "operationId": "bua_til_reikningar",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "vidskiptavinur_id": {
          "type": "string"
         },
         "linur": {
          "type": "array",
          "minItems": 1,
          "maxItems": 500,
          "items": {
           "type": "object",
           "properties": {
            "vara_id": {
             "type": "string"
            },
            "vorunumer": {
             "type": "string"
            },
            "lysing": {
             "type": "string"
            },
            "magn": {
             "type": "string"
            },
            "einingarverd": {
             "type": "string"
            },
            "vsk_pr": {
             "type": "string"
            },
            "afslattur_pr": {
             "type": "string"
            },
            "eining": {
             "type": "string"
            }
           }
          }
         },
         "tilvisun": {
          "type": "string"
         },
         "pontunarnumer": {
          "type": "string"
         },
         "lysing": {
          "type": "string"
         },
         "gjalddagi": {
          "type": "string"
         },
         "verk_id": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Búið til"
     },
     "400": {
      "description": "Tímabil má mest vera 366 dagar · Efni þarf að vera JSON-hlutur · tegund er vara eða thjonusta"
     },
     "409": {
      "description": "Viðskiptavinur með þessa kennitölu er þegar til · Vörunúmer er þegar til"
     },
     "422": {
      "description": "Viðskiptavinur finnst ekki · Vörunúmer finnst ekki: "
     }
    }
   }
  },
  "/reikningar/{id}": {
   "get": {
    "summary": "Reikningar – einn",
    "operationId": "saekja_einn_reikningar",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Hlutur",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string",
           "nullable": true
          },
          "vsk": {
           "type": "integer"
          },
          "dags": {
           "type": "string",
           "format": "date"
          },
          "numer": {
           "type": "integer"
          },
          "stada": {
           "type": "string",
           "nullable": true
          },
          "eindagi": {
           "type": "string",
           "nullable": true
          },
          "stofnad": {
           "type": "string",
           "format": "date-time"
          },
          "upphaed": {
           "type": "integer"
          },
          "verk_id": {
           "type": "string",
           "nullable": true
          },
          "tilvisun": {
           "type": "string",
           "nullable": true
          },
          "uppfaert": {
           "type": "string",
           "format": "date-time"
          },
          "gjalddagi": {
           "type": "string",
           "format": "date"
          },
          "greitt_kl": {
           "type": "string",
           "format": "date-time"
          },
          "kredit_fyrir": {
           "type": "string",
           "nullable": true
          },
          "pontunarnumer": {
           "type": "string",
           "nullable": true
          },
          "upphaed_an_vsk": {
           "type": "integer"
          },
          "vidskiptavinur": {
           "type": "string",
           "nullable": true
          },
          "vidskiptavinur_id": {
           "type": "string",
           "nullable": true
          }
         }
        },
        "example": {
         "id": "88c33ee4-434b-4fca-850a-8761326eac62",
         "vsk": 336096,
         "dags": "2026-10-20",
         "linur": [
          {
           "rod": 1,
           "magn": 112,
           "eining": "klst",
           "lysing": "Dagvinna",
           "vsk_pr": 24,
           "upphaed": 1332800,
           "vara_id": null,
           "vorunumer": null,
           "einingarverd": 11900
          },
          {
           "rod": 2,
           "magn": 4,
           "eining": "klst",
           "lysing": "Yfirvinna",
           "vsk_pr": 24,
           "upphaed": 67600,
           "vara_id": null,
           "vorunumer": null,
           "einingarverd": 16900
          }
         ],
         "numer": 1,
         "stada": "greitt",
         "eindagi": null,
         "stofnad": "2026-10-20T16:47:54.943271+00:00",
         "upphaed": 1736496,
         "verk_id": 1000000134,
         "tilvisun": null,
         "uppfaert": "2026-10-20T16:47:54.943271+00:00",
         "gjalddagi": "2026-11-19",
         "greitt_kl": "2026-10-20T00:00:00+00:00",
         "kredit_fyrir": null,
         "pontunarnumer": null,
         "upphaed_an_vsk": 1400400,
         "vidskiptavinur": "Húsfélagið Lyngás 12",
         "vidskiptavinur_id": null
        }
       }
      }
     },
     "404": {
      "description": "Finnst ekki"
     }
    }
   }
  },
  "/verk": {
   "get": {
    "summary": "Verk",
    "operationId": "saekja_verk",
    "parameters": [
     {
      "name": "sida",
      "in": "query",
      "required": false,
      "description": "Síða (frá 1)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "staerd",
      "in": "query",
      "required": false,
      "description": "Stærð síðu (1–200, sjálfgefið 50)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "leit",
      "in": "query",
      "required": false,
      "description": "Frjáls leit",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "breytt_eftir",
      "in": "query",
      "required": false,
      "description": "Aðeins breytt eftir þessum tíma (ISO 8601)",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Síða",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "gogn": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "nafn": {
              "type": "string",
              "nullable": true
             },
             "stada": {
              "type": "string",
              "nullable": true
             },
             "verknr": {
              "type": "string",
              "nullable": true
             },
             "stofnad": {
              "type": "string",
              "format": "date-time"
             },
             "uppfaert": {
              "type": "string",
              "format": "date-time"
             },
             "vidskiptavinur": {
              "type": "string",
              "nullable": true
             },
             "aaetlud_verklok": {
              "type": "string",
              "nullable": true
             },
             "vidskiptavinur_id": {
              "type": "string",
              "nullable": true
             }
            }
           }
          },
          "sida": {
           "type": "integer"
          },
          "staerd": {
           "type": "integer"
          },
          "fjoldi": {
           "type": "integer"
          },
          "naesta_sida": {
           "type": [
            "integer",
            "null"
           ]
          }
         }
        },
        "example": {
         "gogn": [
          {
           "id": 1000000138,
           "nafn": "Skólinn í Dalnum – klæðning",
           "stada": "Í vinnslu",
           "verknr": "V5",
           "stofnad": "2026-10-20T16:47:54.943271+00:00",
           "uppfaert": "2026-10-21T17:34:24.544966+00:00",
           "vidskiptavinur": "Skólinn í Dalnum",
           "aaetlud_verklok": null,
           "vidskiptavinur_id": "55765b00-6270-4fe4-a35a-47544daa99f3"
          },
          {
           "id": 1000000137,
           "nafn": "Hótel Fjörður – þakskipti",
           "stada": "Í vinnslu",
           "verknr": "V4",
           "stofnad": "2026-10-20T16:47:54.943271+00:00",
           "uppfaert": "2026-10-21T17:34:24.544966+00:00",
           "vidskiptavinur": "Hótel Fjörður ehf",
           "aaetlud_verklok": null,
           "vidskiptavinur_id": "e154923c-518a-4683-92c3-ec83cfb04d95"
          }
         ],
         "sida": 1,
         "fjoldi": 5,
         "staerd": 2,
         "naesta_sida": 2
        }
       }
      }
     },
     "401": {
      "description": "Lykill vantar eða er ógildur · Lykillinn er útrunninn – búðu til nýjan sandkassalykil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "403": {
      "description": "Sandkassalykill gildir aðeins á sýnishornsfyrirtæki · API er ekki opið fyrir þetta fyrirtæki · Lykillinn hefur ekki réttindin ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "429": {
      "description": "Of margar rangar tilraunir – reyndu aftur síðar · Hámark ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     }
    }
   }
  },
  "/verk/{id}": {
   "get": {
    "summary": "Verk – einn",
    "operationId": "saekja_einn_verk",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Hlutur",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          },
          "nafn": {
           "type": "string",
           "nullable": true
          },
          "stada": {
           "type": "string",
           "nullable": true
          },
          "verknr": {
           "type": "string",
           "nullable": true
          },
          "stofnad": {
           "type": "string",
           "format": "date-time"
          },
          "uppfaert": {
           "type": "string",
           "format": "date-time"
          },
          "vidskiptavinur": {
           "type": "string",
           "nullable": true
          },
          "aaetlud_verklok": {
           "type": "string",
           "nullable": true
          },
          "vidskiptavinur_id": {
           "type": "string",
           "nullable": true
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Finnst ekki"
     }
    }
   }
  },
  "/timar": {
   "get": {
    "summary": "Tímar",
    "operationId": "saekja_timar",
    "parameters": [
     {
      "name": "sida",
      "in": "query",
      "required": false,
      "description": "Síða (frá 1)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "staerd",
      "in": "query",
      "required": false,
      "description": "Stærð síðu (1–200, sjálfgefið 50)",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "fra",
      "in": "query",
      "required": false,
      "description": "Frá dags. (ÁÁÁÁ-MM-DD) – sjálfgefið síðustu 31 dagur, mest 366",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "til",
      "in": "query",
      "required": false,
      "description": "Til dags. (ÁÁÁÁ-MM-DD)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "verk_id",
      "in": "query",
      "required": false,
      "description": "Auðkenni verks",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Síða",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "gogn": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string",
              "nullable": true
             },
             "ut": {
              "type": "string",
              "format": "date-time"
             },
             "inn": {
              "type": "string",
              "format": "date-time"
             },
             "dags": {
              "type": "string",
              "format": "date"
             },
             "klst": {
              "type": "integer"
             },
             "verk": {
              "type": "string",
              "nullable": true
             },
             "dv_klst": {
              "type": "integer"
             },
             "verk_id": {
              "type": "integer"
             },
             "yv_klst": {
              "type": "integer"
             },
             "aukaverk": {
              "type": "boolean"
             },
             "verklysing": {
              "type": "string",
              "nullable": true
             },
             "starfsmadur": {
              "type": "string",
              "nullable": true
             },
             "starfsmadur_id": {
              "type": "string",
              "nullable": true
             }
            }
           }
          },
          "sida": {
           "type": "integer"
          },
          "staerd": {
           "type": "integer"
          },
          "fjoldi": {
           "type": "integer"
          },
          "naesta_sida": {
           "type": [
            "integer",
            "null"
           ]
          }
         }
        },
        "example": {
         "gogn": [
          {
           "id": "syn-61-f9e86b",
           "ut": "2026-09-28T16:00:00+00:00",
           "inn": "2026-09-28T08:00:00+00:00",
           "dags": "2026-09-28",
           "klst": 8,
           "verk": "Hótel Fjörður – þakskipti",
           "dv_klst": 8,
           "verk_id": 1000000137,
           "yv_klst": 0,
           "aukaverk": false,
           "verklysing": null,
           "starfsmadur": "Jón Smiður",
           "starfsmadur_id": "m1000121"
          },
          {
           "id": "syn-62-551130",
           "ut": "2026-09-28T18:00:00+00:00",
           "inn": "2026-09-28T08:00:00+00:00",
           "dags": "2026-09-28",
           "klst": 10,
           "verk": "Skólinn í Dalnum – klæðning",
           "dv_klst": 8,
           "verk_id": 1000000138,
           "yv_klst": 2,
           "aukaverk": false,
           "verklysing": null,
           "starfsmadur": "Anna Málari",
           "starfsmadur_id": "m1000122"
          }
         ],
         "sida": 1,
         "fjoldi": 64,
         "staerd": 2,
         "naesta_sida": 2
        }
       }
      }
     },
     "401": {
      "description": "Lykill vantar eða er ógildur · Lykillinn er útrunninn – búðu til nýjan sandkassalykil",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "403": {
      "description": "Sandkassalykill gildir aðeins á sýnishornsfyrirtæki · API er ekki opið fyrir þetta fyrirtæki · Lykillinn hefur ekki réttindin ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     },
     "429": {
      "description": "Of margar rangar tilraunir – reyndu aftur síðar · Hámark ",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Villa"
        }
       }
      }
     }
    }
   }
  }
 }
}