{
  "openapi": "3.1.0",
  "info": {
    "title": "SaveÚčto API",
    "version": "1.0.0",
    "description": "REST API SaveÚčta. Návod, limity a príklady: https://saveucto.sk/api/dokumentacia",
    "contact": {
      "name": "SaveÚčto",
      "url": "https://saveucto.sk/api/dokumentacia"
    }
  },
  "servers": [
    {
      "url": "https://saveucto.sk/api/v1",
      "description": "Produkcia"
    },
    {
      "url": "https://sandbox.saveucto.sk/api/v1",
      "description": "Sandbox"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "tags": [
    {
      "name": "Odberatelia"
    },
    {
      "name": "Produkty"
    },
    {
      "name": "Faktúry"
    },
    {
      "name": "Úhrady"
    },
    {
      "name": "Prijaté faktúry"
    },
    {
      "name": "Pokladňa"
    },
    {
      "name": "Sklad"
    },
    {
      "name": "Firma a číselníky"
    },
    {
      "name": "Sandbox"
    },
    {
      "name": "Webhooky"
    }
  ],
  "paths": {
    "/odberatelia": {
      "get": {
        "tags": [
          "Odberatelia"
        ],
        "summary": "Zoznam",
        "description": "Oprávnenie: `odberatelia:read`.",
        "responses": {
          "200": {
            "description": "Strana záznamov podľa ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      }
                    },
                    "next_od_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Hodnota `od_id` pre ďalšiu stranu, `null` = posledná strana"
                    }
                  },
                  "required": [
                    "data",
                    "next_od_id"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": 15,
                      "name": "Alfa Stavby s.r.o.",
                      "ico": "50000001",
                      "dic": "2120000001",
                      "ic_dph": "SK2120000001",
                      "email": "uctaren@alfastavby.sk",
                      "phone": "+421 905 123 456",
                      "street": "Hlavná 1",
                      "street2": null,
                      "zip": "010 01",
                      "city": "Žilina",
                      "country": "Slovensko",
                      "eori": null,
                      "iban": "SK3112000000198742637541",
                      "is_customer": true,
                      "is_supplier": false,
                      "is_foreign": false,
                      "created_at": "2026-10-01T09:15:00+02:00",
                      "updated_at": "2026-10-03T14:02:11+02:00",
                      "external_ids": [
                        {
                          "source": "eshop",
                          "ext_id": "42"
                        }
                      ]
                    }
                  ],
                  "next_od_id": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/od_id"
          },
          {
            "$ref": "#/components/parameters/zmenene_od"
          },
          {
            "name": "ico",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Len odberateľ s týmto IČO"
          }
        ]
      },
      "post": {
        "tags": [
          "Odberatelia"
        ],
        "summary": "Vytvoriť odberateľa",
        "description": "Oprávnenie: `odberatelia:write`.",
        "responses": {
          "201": {
            "description": "Vytvorené",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "examples": [
                        [
                          "internal_note"
                        ]
                      ],
                      "description": "Polia, ktoré API nepozná a ignorovalo"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 15,
                    "name": "Alfa Stavby s.r.o.",
                    "ico": "50000001",
                    "dic": "2120000001",
                    "ic_dph": "SK2120000001",
                    "email": "uctaren@alfastavby.sk",
                    "phone": "+421 905 123 456",
                    "street": "Hlavná 1",
                    "street2": null,
                    "zip": "010 01",
                    "city": "Žilina",
                    "country": "Slovensko",
                    "eori": null,
                    "iban": "SK3112000000198742637541",
                    "is_customer": true,
                    "is_supplier": false,
                    "is_foreign": false,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-03T14:02:11+02:00",
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "42"
                      }
                    ]
                  },
                  "warnings": [
                    "internal_note"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "409": {
            "description": "Odberateľ s rovnakým IČO už existuje",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "duplicate"
                      ]
                    },
                    "existing_id": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "error": "text",
                  "code": "duplicate",
                  "existing_id": 1
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerInput"
              },
              "example": {
                "name": "Alfa Stavby s.r.o.",
                "ico": "50000001",
                "dic": "2120000001",
                "ic_dph": "SK2120000001",
                "email": "uctaren@alfastavby.sk",
                "street": "Hlavná 1",
                "zip": "010 01",
                "city": "Žilina",
                "ext_source": "eshop",
                "ext_id": "42"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ]
      }
    },
    "/odberatelia/{id}": {
      "get": {
        "tags": [
          "Odberatelia"
        ],
        "summary": "Detail",
        "description": "Oprávnenie: `odberatelia:read`.",
        "responses": {
          "200": {
            "description": "Záznam",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 15,
                    "name": "Alfa Stavby s.r.o.",
                    "ico": "50000001",
                    "dic": "2120000001",
                    "ic_dph": "SK2120000001",
                    "email": "uctaren@alfastavby.sk",
                    "phone": "+421 905 123 456",
                    "street": "Hlavná 1",
                    "street2": null,
                    "zip": "010 01",
                    "city": "Žilina",
                    "country": "Slovensko",
                    "eori": null,
                    "iban": "SK3112000000198742637541",
                    "is_customer": true,
                    "is_supplier": false,
                    "is_foreign": false,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-03T14:02:11+02:00",
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "42"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ]
      },
      "put": {
        "tags": [
          "Odberatelia"
        ],
        "summary": "Upraviť",
        "description": "Oprávnenie: `odberatelia:write`.",
        "responses": {
          "200": {
            "description": "Upravené",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "examples": [
                        [
                          "internal_note"
                        ]
                      ],
                      "description": "Polia, ktoré API nepozná a ignorovalo"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 15,
                    "name": "Alfa Stavby s.r.o.",
                    "ico": "50000001",
                    "dic": "2120000001",
                    "ic_dph": "SK2120000001",
                    "email": "uctaren@alfastavby.sk",
                    "phone": "+421 905 123 456",
                    "street": "Hlavná 1",
                    "street2": null,
                    "zip": "010 01",
                    "city": "Žilina",
                    "country": "Slovensko",
                    "eori": null,
                    "iban": "SK3112000000198742637541",
                    "is_customer": true,
                    "is_supplier": false,
                    "is_foreign": false,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-03T14:02:11+02:00",
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "42"
                      }
                    ]
                  },
                  "warnings": [
                    "internal_note"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerUpdate"
              },
              "example": {
                "email": "faktury@alfastavby.sk",
                "phone": "+421 905 654 321"
              }
            }
          }
        }
      }
    },
    "/odberatelia/externe/{source}/{extId}": {
      "get": {
        "tags": [
          "Odberatelia"
        ],
        "summary": "Nájsť podľa ID z vášho systému",
        "description": "Väzbu založíte poslaním `ext_source` a `ext_id` pri vytvorení alebo úprave.\n\nOprávnenie: `odberatelia:read`.",
        "responses": {
          "200": {
            "description": "Záznam",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 15,
                    "name": "Alfa Stavby s.r.o.",
                    "ico": "50000001",
                    "dic": "2120000001",
                    "ic_dph": "SK2120000001",
                    "email": "uctaren@alfastavby.sk",
                    "phone": "+421 905 123 456",
                    "street": "Hlavná 1",
                    "street2": null,
                    "zip": "010 01",
                    "city": "Žilina",
                    "country": "Slovensko",
                    "eori": null,
                    "iban": "SK3112000000198742637541",
                    "is_customer": true,
                    "is_supplier": false,
                    "is_foreign": false,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-03T14:02:11+02:00",
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "42"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "extId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/produkty": {
      "get": {
        "tags": [
          "Produkty"
        ],
        "summary": "Zoznam",
        "description": "Oprávnenie: `produkty:read`.",
        "responses": {
          "200": {
            "description": "Strana záznamov podľa ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    },
                    "next_od_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Hodnota `od_id` pre ďalšiu stranu, `null` = posledná strana"
                    }
                  },
                  "required": [
                    "data",
                    "next_od_id"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": 7,
                      "name": "Montáž",
                      "sku": "MONTAZ",
                      "unit": "hod",
                      "unit_price_cents": 3500,
                      "vat_rate": 23,
                      "description": "Montáž na mieste",
                      "is_active": true,
                      "is_recurring": false,
                      "price_year2_cents": null,
                      "price_year3_cents": null,
                      "created_at": "2026-10-01T09:15:00+02:00",
                      "updated_at": "2026-10-01T09:15:00+02:00",
                      "external_ids": []
                    }
                  ],
                  "next_od_id": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/od_id"
          },
          {
            "$ref": "#/components/parameters/zmenene_od"
          },
          {
            "name": "sku",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "aktivne",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Produkty"
        ],
        "summary": "Vytvoriť produkt",
        "description": "Oprávnenie: `produkty:write`.",
        "responses": {
          "201": {
            "description": "Vytvorené",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "examples": [
                        [
                          "internal_note"
                        ]
                      ],
                      "description": "Polia, ktoré API nepozná a ignorovalo"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 7,
                    "name": "Montáž",
                    "sku": "MONTAZ",
                    "unit": "hod",
                    "unit_price_cents": 3500,
                    "vat_rate": 23,
                    "description": "Montáž na mieste",
                    "is_active": true,
                    "is_recurring": false,
                    "price_year2_cents": null,
                    "price_year3_cents": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "external_ids": []
                  },
                  "warnings": [
                    "internal_note"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductInput"
              },
              "example": {
                "name": "Montáž",
                "sku": "MONTAZ",
                "unit": "hod",
                "unit_price_cents": 3500,
                "vat_rate": 23,
                "ext_source": "eshop",
                "ext_id": "P-7"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ]
      }
    },
    "/produkty/{id}": {
      "get": {
        "tags": [
          "Produkty"
        ],
        "summary": "Detail",
        "description": "Oprávnenie: `produkty:read`.",
        "responses": {
          "200": {
            "description": "Záznam",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 7,
                    "name": "Montáž",
                    "sku": "MONTAZ",
                    "unit": "hod",
                    "unit_price_cents": 3500,
                    "vat_rate": 23,
                    "description": "Montáž na mieste",
                    "is_active": true,
                    "is_recurring": false,
                    "price_year2_cents": null,
                    "price_year3_cents": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "external_ids": []
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ]
      },
      "put": {
        "tags": [
          "Produkty"
        ],
        "summary": "Upraviť",
        "description": "Oprávnenie: `produkty:write`.",
        "responses": {
          "200": {
            "description": "Upravené",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "examples": [
                        [
                          "internal_note"
                        ]
                      ],
                      "description": "Polia, ktoré API nepozná a ignorovalo"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 7,
                    "name": "Montáž",
                    "sku": "MONTAZ",
                    "unit": "hod",
                    "unit_price_cents": 3500,
                    "vat_rate": 23,
                    "description": "Montáž na mieste",
                    "is_active": true,
                    "is_recurring": false,
                    "price_year2_cents": null,
                    "price_year3_cents": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "external_ids": []
                  },
                  "warnings": [
                    "internal_note"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUpdate"
              },
              "example": {
                "unit_price_cents": 3900
              }
            }
          }
        }
      }
    },
    "/produkty/externe/{source}/{extId}": {
      "get": {
        "tags": [
          "Produkty"
        ],
        "summary": "Nájsť podľa ID z vášho systému",
        "description": "Väzbu založíte poslaním `ext_source` a `ext_id` pri vytvorení alebo úprave.\n\nOprávnenie: `produkty:read`.",
        "responses": {
          "200": {
            "description": "Záznam",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 7,
                    "name": "Montáž",
                    "sku": "MONTAZ",
                    "unit": "hod",
                    "unit_price_cents": 3500,
                    "vat_rate": 23,
                    "description": "Montáž na mieste",
                    "is_active": true,
                    "is_recurring": false,
                    "price_year2_cents": null,
                    "price_year3_cents": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "external_ids": []
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "extId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/firma": {
      "get": {
        "tags": [
          "Firma a číselníky"
        ],
        "summary": "Údaje vlastnej firmy",
        "description": "Oprávnenie: `firma:read`.",
        "responses": {
          "200": {
            "description": "Firma kľúča",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Company"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 3,
                    "name": "Moja firma s.r.o.",
                    "ico": "12345678",
                    "dic": "2023456789",
                    "ic_dph": "SK2023456789",
                    "street": "Mostová 5",
                    "city": "Bratislava",
                    "zip": "811 02",
                    "country": "Slovensko",
                    "email": "fakturacia@mojafirma.sk",
                    "phone": null,
                    "iban": "SK8975000000000012345671",
                    "language": "sk",
                    "is_vat_payer": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/ciselniky/sadzby-dph": {
      "get": {
        "tags": [
          "Firma a číselníky"
        ],
        "summary": "Sadzby DPH",
        "description": "Oprávnenie: `firma:read`.",
        "responses": {
          "200": {
            "description": "Sadzby DPH",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      },
                      "examples": [
                        [
                          23,
                          19,
                          5,
                          0
                        ]
                      ]
                    },
                    "default": {
                      "type": "number",
                      "examples": [
                        23
                      ]
                    }
                  }
                },
                "example": {
                  "data": [
                    23,
                    19,
                    5,
                    0
                  ],
                  "default": 23
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/ciselniky/meny": {
      "get": {
        "tags": [
          "Firma a číselníky"
        ],
        "summary": "Meny",
        "description": "Oprávnenie: `firma:read`.",
        "responses": {
          "200": {
            "description": "Meny",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "ISO 4217"
                      },
                      "examples": [
                        [
                          "EUR",
                          "CZK",
                          "USD"
                        ]
                      ]
                    }
                  }
                },
                "example": {
                  "data": [
                    "EUR",
                    "CZK",
                    "USD"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/ciselniky/ciselne-rady": {
      "get": {
        "tags": [
          "Firma a číselníky"
        ],
        "summary": "Číselné rady dokladov",
        "description": "Oprávnenie: `firma:read`.",
        "responses": {
          "200": {
            "description": "Číselné rady dokladov",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NumberSeries"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "doc_type": "invoice",
                      "scope_id": null,
                      "year": 2026,
                      "prefix": "2026",
                      "next_number": 43,
                      "padding": 3,
                      "next": "2026043"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/ciselniky/bankove-ucty": {
      "get": {
        "tags": [
          "Firma a číselníky"
        ],
        "summary": "Bankové účty firmy",
        "description": "Oprávnenie: `firma:read`.",
        "responses": {
          "200": {
            "description": "Bankové účty firmy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BankAccount"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 2,
                      "name": "Tatra banka",
                      "iban": "SK8975000000000012345671",
                      "bic": "TATRSKBX",
                      "currency": "EUR",
                      "is_default": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/faktury": {
      "get": {
        "tags": [
          "Faktúry"
        ],
        "summary": "Zoznam",
        "description": "Oprávnenie: `faktury:read`.",
        "responses": {
          "200": {
            "description": "Strana dokladov podľa ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Invoice"
                      }
                    },
                    "next_od_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Hodnota `od_id` pre ďalšiu stranu, `null` = posledná strana"
                    }
                  },
                  "required": [
                    "data",
                    "next_od_id"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": 512,
                      "number": "2026042",
                      "status": "sent",
                      "doc_type": "invoice",
                      "issue_date": "2026-10-01",
                      "delivery_date": "2026-10-01",
                      "due_date": "2026-10-15",
                      "valid_until": null,
                      "payment_method": "Prevodom",
                      "variable_symbol": "2026042",
                      "constant_symbol": null,
                      "specific_symbol": null,
                      "currency": "EUR",
                      "exchange_rate": 1,
                      "language": "sk",
                      "vat_regime": "tuzemsko",
                      "vat_note": null,
                      "eu_supply_type": null,
                      "posting_account_code": null,
                      "branch_id": null,
                      "pdf_template": null,
                      "pdf_accent": null,
                      "customer_name": "Alfa Stavby s.r.o.",
                      "customer_street": "Hlavná 1",
                      "customer_street2": null,
                      "customer_city": "Žilina",
                      "customer_zip": "010 01",
                      "customer_country": "Slovensko",
                      "customer_ico": "50000001",
                      "customer_dic": "2120000001",
                      "customer_ic_dph": "SK2120000001",
                      "customer_email": "uctaren@alfastavby.sk",
                      "note": "Objednávka OBJ-1042",
                      "original_invoice_id": null,
                      "subtotal_cents": 15580,
                      "vat_total_cents": 3583,
                      "total_cents": 19163,
                      "paid_cents": 0,
                      "efaktura_status": null,
                      "paid_at": null,
                      "sent_at": "2026-10-01T09:15:00+02:00",
                      "cancelled_at": null,
                      "created_at": "2026-10-01T09:15:00+02:00",
                      "updated_at": "2026-10-01T09:15:00+02:00",
                      "items": [
                        {
                          "id": 1201,
                          "description": "Montáž",
                          "quantity": 4,
                          "unit": "hod",
                          "unit_price_cents": 3500,
                          "vat_rate": 23,
                          "vat_cents": 3220,
                          "discount_percent": 0,
                          "product_id": 7,
                          "service_valid_until": null,
                          "line_total_cents": 14000
                        },
                        {
                          "id": 1202,
                          "description": "Kábel 3 m",
                          "quantity": 2,
                          "unit": "ks",
                          "unit_price_cents": 790,
                          "vat_rate": 23,
                          "vat_cents": 363,
                          "discount_percent": 0,
                          "product_id": null,
                          "service_valid_until": null,
                          "line_total_cents": 1580
                        }
                      ],
                      "external_ids": [
                        {
                          "source": "eshop",
                          "ext_id": "OBJ-1042"
                        }
                      ]
                    }
                  ],
                  "next_od_id": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/od_id"
          },
          {
            "$ref": "#/components/parameters/zmenene_od"
          },
          {
            "name": "typ",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "invoice",
                "proforma",
                "credit_note",
                "debit_note",
                "quote",
                "order",
                "delivery_note"
              ],
              "description": "Typ dokladu, predvolene `invoice`"
            }
          },
          {
            "name": "stav",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "sent",
                "partially_paid",
                "paid",
                "cancelled"
              ],
              "description": "`sent` vystavená, `partially_paid`, `paid`, `cancelled` stornovaná"
            }
          },
          {
            "name": "vystavene_od",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "vystavene_do",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Faktúry"
        ],
        "summary": "Vystaviť doklad",
        "description": "Číslo pridelí číselný rad. Stav, sumy a číslo nastaví SaveÚčto, poslané hodnoty sa ignorujú a vrátia vo `warnings`. Zamknutý účtovný rok vráti 409 `locked`.\n\nOprávnenie: `faktury:write`.",
        "responses": {
          "201": {
            "description": "Vystavený doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "examples": [
                        [
                          "internal_note"
                        ]
                      ],
                      "description": "Polia, ktoré API nepozná a ignorovalo"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 512,
                    "number": "2026042",
                    "status": "sent",
                    "doc_type": "invoice",
                    "issue_date": "2026-10-01",
                    "delivery_date": "2026-10-01",
                    "due_date": "2026-10-15",
                    "valid_until": null,
                    "payment_method": "Prevodom",
                    "variable_symbol": "2026042",
                    "constant_symbol": null,
                    "specific_symbol": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "language": "sk",
                    "vat_regime": "tuzemsko",
                    "vat_note": null,
                    "eu_supply_type": null,
                    "posting_account_code": null,
                    "branch_id": null,
                    "pdf_template": null,
                    "pdf_accent": null,
                    "customer_name": "Alfa Stavby s.r.o.",
                    "customer_street": "Hlavná 1",
                    "customer_street2": null,
                    "customer_city": "Žilina",
                    "customer_zip": "010 01",
                    "customer_country": "Slovensko",
                    "customer_ico": "50000001",
                    "customer_dic": "2120000001",
                    "customer_ic_dph": "SK2120000001",
                    "customer_email": "uctaren@alfastavby.sk",
                    "note": "Objednávka OBJ-1042",
                    "original_invoice_id": null,
                    "subtotal_cents": 15580,
                    "vat_total_cents": 3583,
                    "total_cents": 19163,
                    "paid_cents": 0,
                    "efaktura_status": null,
                    "paid_at": null,
                    "sent_at": "2026-10-01T09:15:00+02:00",
                    "cancelled_at": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 1201,
                        "description": "Montáž",
                        "quantity": 4,
                        "unit": "hod",
                        "unit_price_cents": 3500,
                        "vat_rate": 23,
                        "vat_cents": 3220,
                        "discount_percent": 0,
                        "product_id": 7,
                        "service_valid_until": null,
                        "line_total_cents": 14000
                      },
                      {
                        "id": 1202,
                        "description": "Kábel 3 m",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 790,
                        "vat_rate": 23,
                        "vat_cents": 363,
                        "discount_percent": 0,
                        "product_id": null,
                        "service_valid_until": null,
                        "line_total_cents": 1580
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "OBJ-1042"
                      }
                    ]
                  },
                  "warnings": [
                    "internal_note"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceInput"
              },
              "example": {
                "doc_type": "invoice",
                "issue_date": "2026-10-01",
                "delivery_date": "2026-10-01",
                "due_date": "2026-10-15",
                "payment_method": "Prevodom",
                "customer_name": "Alfa Stavby s.r.o.",
                "customer_ico": "50000001",
                "customer_dic": "2120000001",
                "customer_ic_dph": "SK2120000001",
                "customer_street": "Hlavná 1",
                "customer_city": "Žilina",
                "customer_zip": "010 01",
                "customer_email": "uctaren@alfastavby.sk",
                "note": "Objednávka OBJ-1042",
                "items": [
                  {
                    "description": "Montáž",
                    "quantity": 4,
                    "unit": "hod",
                    "unit_price_cents": 3500,
                    "vat_rate": 23,
                    "product_id": 7
                  },
                  {
                    "description": "Kábel 3 m",
                    "quantity": 2,
                    "unit": "ks",
                    "unit_price_cents": 790,
                    "vat_rate": 23
                  }
                ],
                "ext_source": "eshop",
                "ext_id": "OBJ-1042"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ]
      }
    },
    "/faktury/{id}": {
      "get": {
        "tags": [
          "Faktúry"
        ],
        "summary": "Detail",
        "description": "Oprávnenie: `faktury:read`.",
        "responses": {
          "200": {
            "description": "Doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 512,
                    "number": "2026042",
                    "status": "sent",
                    "doc_type": "invoice",
                    "issue_date": "2026-10-01",
                    "delivery_date": "2026-10-01",
                    "due_date": "2026-10-15",
                    "valid_until": null,
                    "payment_method": "Prevodom",
                    "variable_symbol": "2026042",
                    "constant_symbol": null,
                    "specific_symbol": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "language": "sk",
                    "vat_regime": "tuzemsko",
                    "vat_note": null,
                    "eu_supply_type": null,
                    "posting_account_code": null,
                    "branch_id": null,
                    "pdf_template": null,
                    "pdf_accent": null,
                    "customer_name": "Alfa Stavby s.r.o.",
                    "customer_street": "Hlavná 1",
                    "customer_street2": null,
                    "customer_city": "Žilina",
                    "customer_zip": "010 01",
                    "customer_country": "Slovensko",
                    "customer_ico": "50000001",
                    "customer_dic": "2120000001",
                    "customer_ic_dph": "SK2120000001",
                    "customer_email": "uctaren@alfastavby.sk",
                    "note": "Objednávka OBJ-1042",
                    "original_invoice_id": null,
                    "subtotal_cents": 15580,
                    "vat_total_cents": 3583,
                    "total_cents": 19163,
                    "paid_cents": 0,
                    "efaktura_status": null,
                    "paid_at": null,
                    "sent_at": "2026-10-01T09:15:00+02:00",
                    "cancelled_at": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 1201,
                        "description": "Montáž",
                        "quantity": 4,
                        "unit": "hod",
                        "unit_price_cents": 3500,
                        "vat_rate": 23,
                        "vat_cents": 3220,
                        "discount_percent": 0,
                        "product_id": 7,
                        "service_valid_until": null,
                        "line_total_cents": 14000
                      },
                      {
                        "id": 1202,
                        "description": "Kábel 3 m",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 790,
                        "vat_rate": 23,
                        "vat_cents": 363,
                        "discount_percent": 0,
                        "product_id": null,
                        "service_valid_until": null,
                        "line_total_cents": 1580
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "OBJ-1042"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ]
      },
      "put": {
        "tags": [
          "Faktúry"
        ],
        "summary": "Upraviť doklad",
        "description": "Rovnaké pravidlá ako úprava v SaveÚčte: stornovaný doklad, uzavreté obdobie DPH a zamknutý rok vrátia 409 `locked`.\n\nOprávnenie: `faktury:write`.",
        "responses": {
          "200": {
            "description": "Upravený doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "examples": [
                        [
                          "internal_note"
                        ]
                      ],
                      "description": "Polia, ktoré API nepozná a ignorovalo"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 512,
                    "number": "2026042",
                    "status": "sent",
                    "doc_type": "invoice",
                    "issue_date": "2026-10-01",
                    "delivery_date": "2026-10-01",
                    "due_date": "2026-10-15",
                    "valid_until": null,
                    "payment_method": "Prevodom",
                    "variable_symbol": "2026042",
                    "constant_symbol": null,
                    "specific_symbol": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "language": "sk",
                    "vat_regime": "tuzemsko",
                    "vat_note": null,
                    "eu_supply_type": null,
                    "posting_account_code": null,
                    "branch_id": null,
                    "pdf_template": null,
                    "pdf_accent": null,
                    "customer_name": "Alfa Stavby s.r.o.",
                    "customer_street": "Hlavná 1",
                    "customer_street2": null,
                    "customer_city": "Žilina",
                    "customer_zip": "010 01",
                    "customer_country": "Slovensko",
                    "customer_ico": "50000001",
                    "customer_dic": "2120000001",
                    "customer_ic_dph": "SK2120000001",
                    "customer_email": "uctaren@alfastavby.sk",
                    "note": "Objednávka OBJ-1042",
                    "original_invoice_id": null,
                    "subtotal_cents": 15580,
                    "vat_total_cents": 3583,
                    "total_cents": 19163,
                    "paid_cents": 0,
                    "efaktura_status": null,
                    "paid_at": null,
                    "sent_at": "2026-10-01T09:15:00+02:00",
                    "cancelled_at": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 1201,
                        "description": "Montáž",
                        "quantity": 4,
                        "unit": "hod",
                        "unit_price_cents": 3500,
                        "vat_rate": 23,
                        "vat_cents": 3220,
                        "discount_percent": 0,
                        "product_id": 7,
                        "service_valid_until": null,
                        "line_total_cents": 14000
                      },
                      {
                        "id": 1202,
                        "description": "Kábel 3 m",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 790,
                        "vat_rate": 23,
                        "vat_cents": 363,
                        "discount_percent": 0,
                        "product_id": null,
                        "service_valid_until": null,
                        "line_total_cents": 1580
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "OBJ-1042"
                      }
                    ]
                  },
                  "warnings": [
                    "internal_note"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceUpdate"
              },
              "example": {
                "issue_date": "2026-10-01",
                "delivery_date": "2026-10-01",
                "due_date": "2026-10-15",
                "payment_method": "Prevodom",
                "customer_name": "Alfa Stavby s.r.o.",
                "customer_ico": "50000001",
                "customer_dic": "2120000001",
                "customer_ic_dph": "SK2120000001",
                "customer_street": "Hlavná 1",
                "customer_city": "Žilina",
                "customer_zip": "010 01",
                "customer_email": "uctaren@alfastavby.sk",
                "note": "Objednávka OBJ-1042",
                "items": [
                  {
                    "description": "Montáž",
                    "quantity": 4,
                    "unit": "hod",
                    "unit_price_cents": 3500,
                    "vat_rate": 23,
                    "product_id": 7
                  },
                  {
                    "description": "Kábel 3 m",
                    "quantity": 2,
                    "unit": "ks",
                    "unit_price_cents": 790,
                    "vat_rate": 23
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/faktury/externe/{source}/{extId}": {
      "get": {
        "tags": [
          "Faktúry"
        ],
        "summary": "Nájsť podľa ID z vášho systému",
        "description": "Oprávnenie: `faktury:read`.",
        "responses": {
          "200": {
            "description": "Doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 512,
                    "number": "2026042",
                    "status": "sent",
                    "doc_type": "invoice",
                    "issue_date": "2026-10-01",
                    "delivery_date": "2026-10-01",
                    "due_date": "2026-10-15",
                    "valid_until": null,
                    "payment_method": "Prevodom",
                    "variable_symbol": "2026042",
                    "constant_symbol": null,
                    "specific_symbol": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "language": "sk",
                    "vat_regime": "tuzemsko",
                    "vat_note": null,
                    "eu_supply_type": null,
                    "posting_account_code": null,
                    "branch_id": null,
                    "pdf_template": null,
                    "pdf_accent": null,
                    "customer_name": "Alfa Stavby s.r.o.",
                    "customer_street": "Hlavná 1",
                    "customer_street2": null,
                    "customer_city": "Žilina",
                    "customer_zip": "010 01",
                    "customer_country": "Slovensko",
                    "customer_ico": "50000001",
                    "customer_dic": "2120000001",
                    "customer_ic_dph": "SK2120000001",
                    "customer_email": "uctaren@alfastavby.sk",
                    "note": "Objednávka OBJ-1042",
                    "original_invoice_id": null,
                    "subtotal_cents": 15580,
                    "vat_total_cents": 3583,
                    "total_cents": 19163,
                    "paid_cents": 0,
                    "efaktura_status": null,
                    "paid_at": null,
                    "sent_at": "2026-10-01T09:15:00+02:00",
                    "cancelled_at": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 1201,
                        "description": "Montáž",
                        "quantity": 4,
                        "unit": "hod",
                        "unit_price_cents": 3500,
                        "vat_rate": 23,
                        "vat_cents": 3220,
                        "discount_percent": 0,
                        "product_id": 7,
                        "service_valid_until": null,
                        "line_total_cents": 14000
                      },
                      {
                        "id": 1202,
                        "description": "Kábel 3 m",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 790,
                        "vat_rate": 23,
                        "vat_cents": 363,
                        "discount_percent": 0,
                        "product_id": null,
                        "service_valid_until": null,
                        "line_total_cents": 1580
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "OBJ-1042"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "extId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/faktury/{id}/pdf": {
      "get": {
        "tags": [
          "Faktúry"
        ],
        "summary": "Stiahnuť PDF",
        "description": "Oprávnenie: `faktury:read`.",
        "responses": {
          "200": {
            "description": "PDF dokladu",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ]
      }
    },
    "/faktury/{id}/odoslat": {
      "post": {
        "tags": [
          "Faktúry"
        ],
        "summary": "Odoslať odberateľovi",
        "description": "E-mail ide z mailového účtu firmy s PDF v prílohe. Cez digitálneho poštára sa doklad pošle, ak má firma poštára aktívneho a odberateľ slovenské DIČ, inak 409 `not_sendable`.\n\nOprávnenie: `faktury:write`.",
        "responses": {
          "200": {
            "description": "Odoslané e-mailom",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 512,
                    "number": "2026042",
                    "status": "sent",
                    "doc_type": "invoice",
                    "issue_date": "2026-10-01",
                    "delivery_date": "2026-10-01",
                    "due_date": "2026-10-15",
                    "valid_until": null,
                    "payment_method": "Prevodom",
                    "variable_symbol": "2026042",
                    "constant_symbol": null,
                    "specific_symbol": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "language": "sk",
                    "vat_regime": "tuzemsko",
                    "vat_note": null,
                    "eu_supply_type": null,
                    "posting_account_code": null,
                    "branch_id": null,
                    "pdf_template": null,
                    "pdf_accent": null,
                    "customer_name": "Alfa Stavby s.r.o.",
                    "customer_street": "Hlavná 1",
                    "customer_street2": null,
                    "customer_city": "Žilina",
                    "customer_zip": "010 01",
                    "customer_country": "Slovensko",
                    "customer_ico": "50000001",
                    "customer_dic": "2120000001",
                    "customer_ic_dph": "SK2120000001",
                    "customer_email": "uctaren@alfastavby.sk",
                    "note": "Objednávka OBJ-1042",
                    "original_invoice_id": null,
                    "subtotal_cents": 15580,
                    "vat_total_cents": 3583,
                    "total_cents": 19163,
                    "paid_cents": 0,
                    "efaktura_status": null,
                    "paid_at": null,
                    "sent_at": "2026-10-01T09:15:00+02:00",
                    "cancelled_at": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 1201,
                        "description": "Montáž",
                        "quantity": 4,
                        "unit": "hod",
                        "unit_price_cents": 3500,
                        "vat_rate": 23,
                        "vat_cents": 3220,
                        "discount_percent": 0,
                        "product_id": 7,
                        "service_valid_until": null,
                        "line_total_cents": 14000
                      },
                      {
                        "id": 1202,
                        "description": "Kábel 3 m",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 790,
                        "vat_rate": 23,
                        "vat_cents": 363,
                        "discount_percent": 0,
                        "product_id": null,
                        "service_valid_until": null,
                        "line_total_cents": 1580
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "OBJ-1042"
                      }
                    ]
                  }
                }
              }
            }
          },
          "202": {
            "description": "Zaradené do fronty digitálneho poštára",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 512,
                    "number": "2026042",
                    "status": "sent",
                    "doc_type": "invoice",
                    "issue_date": "2026-10-01",
                    "delivery_date": "2026-10-01",
                    "due_date": "2026-10-15",
                    "valid_until": null,
                    "payment_method": "Prevodom",
                    "variable_symbol": "2026042",
                    "constant_symbol": null,
                    "specific_symbol": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "language": "sk",
                    "vat_regime": "tuzemsko",
                    "vat_note": null,
                    "eu_supply_type": null,
                    "posting_account_code": null,
                    "branch_id": null,
                    "pdf_template": null,
                    "pdf_accent": null,
                    "customer_name": "Alfa Stavby s.r.o.",
                    "customer_street": "Hlavná 1",
                    "customer_street2": null,
                    "customer_city": "Žilina",
                    "customer_zip": "010 01",
                    "customer_country": "Slovensko",
                    "customer_ico": "50000001",
                    "customer_dic": "2120000001",
                    "customer_ic_dph": "SK2120000001",
                    "customer_email": "uctaren@alfastavby.sk",
                    "note": "Objednávka OBJ-1042",
                    "original_invoice_id": null,
                    "subtotal_cents": 15580,
                    "vat_total_cents": 3583,
                    "total_cents": 19163,
                    "paid_cents": 0,
                    "efaktura_status": null,
                    "paid_at": null,
                    "sent_at": "2026-10-01T09:15:00+02:00",
                    "cancelled_at": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 1201,
                        "description": "Montáž",
                        "quantity": 4,
                        "unit": "hod",
                        "unit_price_cents": 3500,
                        "vat_rate": 23,
                        "vat_cents": 3220,
                        "discount_percent": 0,
                        "product_id": 7,
                        "service_valid_until": null,
                        "line_total_cents": 14000
                      },
                      {
                        "id": 1202,
                        "description": "Kábel 3 m",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 790,
                        "vat_rate": 23,
                        "vat_cents": 363,
                        "discount_percent": 0,
                        "product_id": null,
                        "service_valid_until": null,
                        "line_total_cents": 1580
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "OBJ-1042"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "502": {
            "description": "E-mail sa nepodarilo odoslať (`send_failed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "text",
                  "code": "text",
                  "request_id": "text"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendInput"
              },
              "example": {
                "channel": "email",
                "email": "uctaren@alfastavby.sk",
                "cc": null,
                "subject": null,
                "body": null
              }
            }
          }
        }
      }
    },
    "/faktury/{id}/stornovat": {
      "post": {
        "tags": [
          "Faktúry"
        ],
        "summary": "Stornovať",
        "description": "Len vystavený nezaplatený doklad, inak 409 `not_cancellable`. Doklad sa nemaže.\n\nOprávnenie: `faktury:write`.",
        "responses": {
          "200": {
            "description": "Stornovaný doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 512,
                    "number": "2026042",
                    "status": "sent",
                    "doc_type": "invoice",
                    "issue_date": "2026-10-01",
                    "delivery_date": "2026-10-01",
                    "due_date": "2026-10-15",
                    "valid_until": null,
                    "payment_method": "Prevodom",
                    "variable_symbol": "2026042",
                    "constant_symbol": null,
                    "specific_symbol": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "language": "sk",
                    "vat_regime": "tuzemsko",
                    "vat_note": null,
                    "eu_supply_type": null,
                    "posting_account_code": null,
                    "branch_id": null,
                    "pdf_template": null,
                    "pdf_accent": null,
                    "customer_name": "Alfa Stavby s.r.o.",
                    "customer_street": "Hlavná 1",
                    "customer_street2": null,
                    "customer_city": "Žilina",
                    "customer_zip": "010 01",
                    "customer_country": "Slovensko",
                    "customer_ico": "50000001",
                    "customer_dic": "2120000001",
                    "customer_ic_dph": "SK2120000001",
                    "customer_email": "uctaren@alfastavby.sk",
                    "note": "Objednávka OBJ-1042",
                    "original_invoice_id": null,
                    "subtotal_cents": 15580,
                    "vat_total_cents": 3583,
                    "total_cents": 19163,
                    "paid_cents": 0,
                    "efaktura_status": null,
                    "paid_at": null,
                    "sent_at": "2026-10-01T09:15:00+02:00",
                    "cancelled_at": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 1201,
                        "description": "Montáž",
                        "quantity": 4,
                        "unit": "hod",
                        "unit_price_cents": 3500,
                        "vat_rate": 23,
                        "vat_cents": 3220,
                        "discount_percent": 0,
                        "product_id": 7,
                        "service_valid_until": null,
                        "line_total_cents": 14000
                      },
                      {
                        "id": 1202,
                        "description": "Kábel 3 m",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 790,
                        "vat_rate": 23,
                        "vat_cents": 363,
                        "discount_percent": 0,
                        "product_id": null,
                        "service_valid_until": null,
                        "line_total_cents": 1580
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "eshop",
                        "ext_id": "OBJ-1042"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ]
      }
    },
    "/faktury/{invoice}/uhrady": {
      "get": {
        "tags": [
          "Úhrady"
        ],
        "summary": "Úhrady dokladu",
        "description": "Oprávnenie: `faktury:read`.",
        "responses": {
          "200": {
            "description": "Úhrady",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Payment"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 311,
                      "amount_cents": 19163,
                      "paid_on": "2026-10-03",
                      "method": "Prevodom",
                      "bank_account_id": 2,
                      "settled_eur_cents": null,
                      "note": null,
                      "source": "manual",
                      "created_at": "2026-10-03T14:02:11+02:00"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "invoice",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ]
      },
      "post": {
        "tags": [
          "Úhrady"
        ],
        "summary": "Pridať úhradu",
        "description": "Stav dokladu sa prepočíta zo súčtu úhrad. Stornovaný a nedaňový doklad, hotovosť a zamknutý rok vrátia 409.\n\nOprávnenie: `faktury:write`.",
        "responses": {
          "201": {
            "description": "Pridaná úhrada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Payment"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 311,
                    "amount_cents": 19163,
                    "paid_on": "2026-10-03",
                    "method": "Prevodom",
                    "bank_account_id": 2,
                    "settled_eur_cents": null,
                    "note": null,
                    "source": "manual",
                    "created_at": "2026-10-03T14:02:11+02:00"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "parameters": [
          {
            "name": "invoice",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentInput"
              },
              "example": {
                "amount_cents": 19163,
                "paid_on": "2026-10-03",
                "method": "Prevodom",
                "bank_account_id": 2
              }
            }
          }
        }
      }
    },
    "/faktury/{invoice}/uhrady/{payment}": {
      "delete": {
        "tags": [
          "Úhrady"
        ],
        "summary": "Zmazať úhradu",
        "description": "Oprávnenie: `faktury:write`.",
        "responses": {
          "204": {
            "description": "Zmazané"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "parameters": [
          {
            "name": "invoice",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "payment",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/prijate-faktury": {
      "get": {
        "tags": [
          "Prijaté faktúry"
        ],
        "summary": "Zoznam",
        "description": "Oprávnenie: `prijate_faktury:read`.",
        "responses": {
          "200": {
            "description": "Strana dokladov",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PurchaseInvoice"
                      }
                    },
                    "next_od_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Hodnota `od_id` pre ďalšiu stranu, `null` = posledná strana"
                    }
                  },
                  "required": [
                    "data",
                    "next_od_id"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": 88,
                      "number": null,
                      "status": "unpaid",
                      "doc_kind": "invoice",
                      "receipt_source": null,
                      "correction_type": null,
                      "original_purchase_invoice_id": null,
                      "supplier_name": "Kancelária Plus s.r.o.",
                      "supplier_street": null,
                      "supplier_street2": null,
                      "supplier_city": null,
                      "supplier_zip": null,
                      "supplier_country": null,
                      "supplier_eori": null,
                      "supplier_ico": "44556677",
                      "supplier_dic": "2022334455",
                      "supplier_ic_dph": "SK2022334455",
                      "supplier_iban": "SK6807200002891987426353",
                      "supplier_number": "FA-2026-0877",
                      "variable_symbol": "20260877",
                      "constant_symbol": null,
                      "issue_date": "2026-10-10",
                      "delivery_date": "2026-10-10",
                      "due_date": "2026-10-24",
                      "received_on": "2026-10-11",
                      "vat_period_override": null,
                      "currency": "EUR",
                      "exchange_rate": 1,
                      "note": null,
                      "vat_regime": null,
                      "vat_deduction": null,
                      "vat_deduction_percent": null,
                      "vehicle_id": null,
                      "fuel_liters": null,
                      "odometer_km": null,
                      "posting_account_code": null,
                      "subtotal_cents": 5000,
                      "vat_total_cents": 1150,
                      "total_cents": 6150,
                      "paid_cents": 0,
                      "has_attachment": true,
                      "created_at": "2026-10-01T09:15:00+02:00",
                      "updated_at": "2026-10-01T09:15:00+02:00",
                      "items": [
                        {
                          "id": 410,
                          "description": "Toner HP 26A",
                          "quantity": 2,
                          "unit": "ks",
                          "unit_price_cents": 2500,
                          "vat_rate": 23,
                          "vat_cents": 1150,
                          "discount_percent": 0,
                          "product_id": null,
                          "vat_deduction": "full",
                          "posting_account_code": "501",
                          "line_total_cents": 5000
                        }
                      ],
                      "external_ids": [
                        {
                          "source": "dms",
                          "ext_id": "D-551"
                        }
                      ]
                    }
                  ],
                  "next_od_id": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/od_id"
          },
          {
            "$ref": "#/components/parameters/zmenene_od"
          },
          {
            "name": "druh",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "invoice",
                "receipt",
                "proforma"
              ]
            }
          },
          {
            "name": "stav",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vystavene_od",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "vystavene_do",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Prijaté faktúry"
        ],
        "summary": "Zaevidovať",
        "description": "Rovnaké pravidlá ako formulár v SaveÚčte vrátane limitu bločku. Úhradu API pri evidencii nezapisuje. Prílohu nahrajte zvlášť.\n\nOprávnenie: `prijate_faktury:write`.",
        "responses": {
          "201": {
            "description": "Zaevidovaný doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PurchaseInvoice"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "examples": [
                        [
                          "internal_note"
                        ]
                      ],
                      "description": "Polia, ktoré API nepozná a ignorovalo"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 88,
                    "number": null,
                    "status": "unpaid",
                    "doc_kind": "invoice",
                    "receipt_source": null,
                    "correction_type": null,
                    "original_purchase_invoice_id": null,
                    "supplier_name": "Kancelária Plus s.r.o.",
                    "supplier_street": null,
                    "supplier_street2": null,
                    "supplier_city": null,
                    "supplier_zip": null,
                    "supplier_country": null,
                    "supplier_eori": null,
                    "supplier_ico": "44556677",
                    "supplier_dic": "2022334455",
                    "supplier_ic_dph": "SK2022334455",
                    "supplier_iban": "SK6807200002891987426353",
                    "supplier_number": "FA-2026-0877",
                    "variable_symbol": "20260877",
                    "constant_symbol": null,
                    "issue_date": "2026-10-10",
                    "delivery_date": "2026-10-10",
                    "due_date": "2026-10-24",
                    "received_on": "2026-10-11",
                    "vat_period_override": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "note": null,
                    "vat_regime": null,
                    "vat_deduction": null,
                    "vat_deduction_percent": null,
                    "vehicle_id": null,
                    "fuel_liters": null,
                    "odometer_km": null,
                    "posting_account_code": null,
                    "subtotal_cents": 5000,
                    "vat_total_cents": 1150,
                    "total_cents": 6150,
                    "paid_cents": 0,
                    "has_attachment": true,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 410,
                        "description": "Toner HP 26A",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 2500,
                        "vat_rate": 23,
                        "vat_cents": 1150,
                        "discount_percent": 0,
                        "product_id": null,
                        "vat_deduction": "full",
                        "posting_account_code": "501",
                        "line_total_cents": 5000
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "dms",
                        "ext_id": "D-551"
                      }
                    ]
                  },
                  "warnings": [
                    "internal_note"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseInvoiceInput"
              },
              "example": {
                "doc_kind": "invoice",
                "supplier_name": "Kancelária Plus s.r.o.",
                "supplier_ico": "44556677",
                "supplier_dic": "2022334455",
                "supplier_ic_dph": "SK2022334455",
                "supplier_iban": "SK6807200002891987426353",
                "supplier_number": "FA-2026-0877",
                "variable_symbol": "20260877",
                "issue_date": "2026-10-10",
                "delivery_date": "2026-10-10",
                "due_date": "2026-10-24",
                "received_on": "2026-10-11",
                "items": [
                  {
                    "description": "Toner HP 26A",
                    "quantity": 2,
                    "unit_price_cents": 2500,
                    "vat_rate": 23
                  }
                ],
                "ext_source": "dms",
                "ext_id": "D-551"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ]
      }
    },
    "/prijate-faktury/{id}": {
      "get": {
        "tags": [
          "Prijaté faktúry"
        ],
        "summary": "Detail",
        "description": "Oprávnenie: `prijate_faktury:read`.",
        "responses": {
          "200": {
            "description": "Doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PurchaseInvoice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 88,
                    "number": null,
                    "status": "unpaid",
                    "doc_kind": "invoice",
                    "receipt_source": null,
                    "correction_type": null,
                    "original_purchase_invoice_id": null,
                    "supplier_name": "Kancelária Plus s.r.o.",
                    "supplier_street": null,
                    "supplier_street2": null,
                    "supplier_city": null,
                    "supplier_zip": null,
                    "supplier_country": null,
                    "supplier_eori": null,
                    "supplier_ico": "44556677",
                    "supplier_dic": "2022334455",
                    "supplier_ic_dph": "SK2022334455",
                    "supplier_iban": "SK6807200002891987426353",
                    "supplier_number": "FA-2026-0877",
                    "variable_symbol": "20260877",
                    "constant_symbol": null,
                    "issue_date": "2026-10-10",
                    "delivery_date": "2026-10-10",
                    "due_date": "2026-10-24",
                    "received_on": "2026-10-11",
                    "vat_period_override": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "note": null,
                    "vat_regime": null,
                    "vat_deduction": null,
                    "vat_deduction_percent": null,
                    "vehicle_id": null,
                    "fuel_liters": null,
                    "odometer_km": null,
                    "posting_account_code": null,
                    "subtotal_cents": 5000,
                    "vat_total_cents": 1150,
                    "total_cents": 6150,
                    "paid_cents": 0,
                    "has_attachment": true,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 410,
                        "description": "Toner HP 26A",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 2500,
                        "vat_rate": 23,
                        "vat_cents": 1150,
                        "discount_percent": 0,
                        "product_id": null,
                        "vat_deduction": "full",
                        "posting_account_code": "501",
                        "line_total_cents": 5000
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "dms",
                        "ext_id": "D-551"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ]
      }
    },
    "/prijate-faktury/externe/{source}/{extId}": {
      "get": {
        "tags": [
          "Prijaté faktúry"
        ],
        "summary": "Nájsť podľa ID z vášho systému",
        "description": "Oprávnenie: `prijate_faktury:read`.",
        "responses": {
          "200": {
            "description": "Doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PurchaseInvoice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 88,
                    "number": null,
                    "status": "unpaid",
                    "doc_kind": "invoice",
                    "receipt_source": null,
                    "correction_type": null,
                    "original_purchase_invoice_id": null,
                    "supplier_name": "Kancelária Plus s.r.o.",
                    "supplier_street": null,
                    "supplier_street2": null,
                    "supplier_city": null,
                    "supplier_zip": null,
                    "supplier_country": null,
                    "supplier_eori": null,
                    "supplier_ico": "44556677",
                    "supplier_dic": "2022334455",
                    "supplier_ic_dph": "SK2022334455",
                    "supplier_iban": "SK6807200002891987426353",
                    "supplier_number": "FA-2026-0877",
                    "variable_symbol": "20260877",
                    "constant_symbol": null,
                    "issue_date": "2026-10-10",
                    "delivery_date": "2026-10-10",
                    "due_date": "2026-10-24",
                    "received_on": "2026-10-11",
                    "vat_period_override": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "note": null,
                    "vat_regime": null,
                    "vat_deduction": null,
                    "vat_deduction_percent": null,
                    "vehicle_id": null,
                    "fuel_liters": null,
                    "odometer_km": null,
                    "posting_account_code": null,
                    "subtotal_cents": 5000,
                    "vat_total_cents": 1150,
                    "total_cents": 6150,
                    "paid_cents": 0,
                    "has_attachment": true,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 410,
                        "description": "Toner HP 26A",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 2500,
                        "vat_rate": 23,
                        "vat_cents": 1150,
                        "discount_percent": 0,
                        "product_id": null,
                        "vat_deduction": "full",
                        "posting_account_code": "501",
                        "line_total_cents": 5000
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "dms",
                        "ext_id": "D-551"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "extId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/prijate-faktury/{id}/priloha": {
      "post": {
        "tags": [
          "Prijaté faktúry"
        ],
        "summary": "Nahrať prílohu (PDF, obrázok, ISDOC)",
        "description": "`multipart/form-data` s poľom `file`, najviac 10 MB. Predošlá príloha sa nahradí.\n\nOprávnenie: `prijate_faktury:write`.",
        "responses": {
          "200": {
            "description": "Doklad s prílohou",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PurchaseInvoice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 88,
                    "number": null,
                    "status": "unpaid",
                    "doc_kind": "invoice",
                    "receipt_source": null,
                    "correction_type": null,
                    "original_purchase_invoice_id": null,
                    "supplier_name": "Kancelária Plus s.r.o.",
                    "supplier_street": null,
                    "supplier_street2": null,
                    "supplier_city": null,
                    "supplier_zip": null,
                    "supplier_country": null,
                    "supplier_eori": null,
                    "supplier_ico": "44556677",
                    "supplier_dic": "2022334455",
                    "supplier_ic_dph": "SK2022334455",
                    "supplier_iban": "SK6807200002891987426353",
                    "supplier_number": "FA-2026-0877",
                    "variable_symbol": "20260877",
                    "constant_symbol": null,
                    "issue_date": "2026-10-10",
                    "delivery_date": "2026-10-10",
                    "due_date": "2026-10-24",
                    "received_on": "2026-10-11",
                    "vat_period_override": null,
                    "currency": "EUR",
                    "exchange_rate": 1,
                    "note": null,
                    "vat_regime": null,
                    "vat_deduction": null,
                    "vat_deduction_percent": null,
                    "vehicle_id": null,
                    "fuel_liters": null,
                    "odometer_km": null,
                    "posting_account_code": null,
                    "subtotal_cents": 5000,
                    "vat_total_cents": 1150,
                    "total_cents": 6150,
                    "paid_cents": 0,
                    "has_attachment": true,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "items": [
                      {
                        "id": 410,
                        "description": "Toner HP 26A",
                        "quantity": 2,
                        "unit": "ks",
                        "unit_price_cents": 2500,
                        "vat_rate": 23,
                        "vat_cents": 1150,
                        "discount_percent": 0,
                        "product_id": null,
                        "vat_deduction": "full",
                        "posting_account_code": "501",
                        "line_total_cents": 5000
                      }
                    ],
                    "external_ids": [
                      {
                        "source": "dms",
                        "ext_id": "D-551"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "413": {
            "description": "Súbor nad 10 MB (`payload_too_large`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "text",
                  "code": "text",
                  "request_id": "text"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        }
      }
    },
    "/pokladnicne-doklady": {
      "get": {
        "tags": [
          "Pokladňa"
        ],
        "summary": "Zoznam",
        "description": "Oprávnenie: `pokladna:read`.",
        "responses": {
          "200": {
            "description": "Strana dokladov",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CashDocument"
                      }
                    },
                    "next_od_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Hodnota `od_id` pre ďalšiu stranu, `null` = posledná strana"
                    }
                  },
                  "required": [
                    "data",
                    "next_od_id"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": 57,
                      "number": "PPD2026015",
                      "kind": "income",
                      "operation": "trzba",
                      "issued_on": "2026-10-10",
                      "partner_name": null,
                      "partner_ico": null,
                      "description": "Tržba za služby",
                      "amount_cents": 12300,
                      "vat_rate": 23,
                      "posting_account_code": "602",
                      "note": null,
                      "cash_register_id": 1,
                      "vat_cents": 2300,
                      "payable_type": null,
                      "payable_id": null,
                      "created_at": "2026-10-01T09:15:00+02:00",
                      "updated_at": "2026-10-01T09:15:00+02:00",
                      "external_ids": []
                    }
                  ],
                  "next_od_id": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/od_id"
          },
          {
            "$ref": "#/components/parameters/zmenene_od"
          },
          {
            "name": "pokladna_id",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "typ",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "income",
                "expense"
              ]
            }
          },
          {
            "name": "vystavene_od",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "vystavene_do",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Pokladňa"
        ],
        "summary": "Vystaviť pokladničný doklad",
        "description": "Číslo pridelí rad pokladnice. Výdavok nad zostatok vráti 409 `negative_balance`. Platba nad zákonný limit hotovosti vráti vo `warnings` `cash_limit_exceeded`. Firma bez modulu Pokladňa dostane 403 `module_not_available`.\n\nOprávnenie: `pokladna:write`.",
        "responses": {
          "201": {
            "description": "Vystavený doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CashDocument"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "examples": [
                        [
                          "internal_note"
                        ]
                      ],
                      "description": "Polia, ktoré API nepozná a ignorovalo"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 57,
                    "number": "PPD2026015",
                    "kind": "income",
                    "operation": "trzba",
                    "issued_on": "2026-10-10",
                    "partner_name": null,
                    "partner_ico": null,
                    "description": "Tržba za služby",
                    "amount_cents": 12300,
                    "vat_rate": 23,
                    "posting_account_code": "602",
                    "note": null,
                    "cash_register_id": 1,
                    "vat_cents": 2300,
                    "payable_type": null,
                    "payable_id": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "external_ids": []
                  },
                  "warnings": [
                    "internal_note"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CashDocumentInput"
              },
              "example": {
                "kind": "income",
                "operation": "trzba",
                "issued_on": "2026-10-10",
                "description": "Tržba za služby",
                "amount_cents": 12300,
                "vat_rate": 23,
                "posting_account_code": "602",
                "cash_register_id": 1
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ]
      }
    },
    "/pokladnicne-doklady/{id}": {
      "get": {
        "tags": [
          "Pokladňa"
        ],
        "summary": "Detail",
        "description": "Oprávnenie: `pokladna:read`.",
        "responses": {
          "200": {
            "description": "Doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CashDocument"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 57,
                    "number": "PPD2026015",
                    "kind": "income",
                    "operation": "trzba",
                    "issued_on": "2026-10-10",
                    "partner_name": null,
                    "partner_ico": null,
                    "description": "Tržba za služby",
                    "amount_cents": 12300,
                    "vat_rate": 23,
                    "posting_account_code": "602",
                    "note": null,
                    "cash_register_id": 1,
                    "vat_cents": 2300,
                    "payable_type": null,
                    "payable_id": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "external_ids": []
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ]
      }
    },
    "/pokladnicne-doklady/externe/{source}/{extId}": {
      "get": {
        "tags": [
          "Pokladňa"
        ],
        "summary": "Nájsť podľa ID z vášho systému",
        "description": "Oprávnenie: `pokladna:read`.",
        "responses": {
          "200": {
            "description": "Doklad",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CashDocument"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 57,
                    "number": "PPD2026015",
                    "kind": "income",
                    "operation": "trzba",
                    "issued_on": "2026-10-10",
                    "partner_name": null,
                    "partner_ico": null,
                    "description": "Tržba za služby",
                    "amount_cents": 12300,
                    "vat_rate": 23,
                    "posting_account_code": "602",
                    "note": null,
                    "cash_register_id": 1,
                    "vat_cents": 2300,
                    "payable_type": null,
                    "payable_id": null,
                    "created_at": "2026-10-01T09:15:00+02:00",
                    "updated_at": "2026-10-01T09:15:00+02:00",
                    "external_ids": []
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "extId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/sklad/pohyby": {
      "get": {
        "tags": [
          "Sklad"
        ],
        "summary": "Skladové pohyby",
        "description": "Oprávnenie: `sklad:read`.",
        "responses": {
          "200": {
            "description": "Strana pohybov",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StockMovement"
                      }
                    },
                    "next_od_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Hodnota `od_id` pre ďalšiu stranu, `null` = posledná strana"
                    }
                  },
                  "required": [
                    "data",
                    "next_od_id"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": 901,
                      "product_id": 7,
                      "stock_location_id": 1,
                      "type": "out",
                      "quantity": 2,
                      "unit_price_cents": 300,
                      "movement_date": "2026-10-01",
                      "invoice_id": 512,
                      "purchase_invoice_id": null,
                      "reason": null,
                      "note": null,
                      "created_at": "2026-10-01T09:15:00+02:00",
                      "updated_at": "2026-10-01T09:15:00+02:00",
                      "external_ids": []
                    }
                  ],
                  "next_od_id": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/od_id"
          },
          {
            "$ref": "#/components/parameters/zmenene_od"
          },
          {
            "name": "produkt_id",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sklad_id",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "typ",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "in",
                "out"
              ]
            }
          },
          {
            "name": "od",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "do",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ]
      }
    },
    "/sklad/zasoby": {
      "get": {
        "tags": [
          "Sklad"
        ],
        "summary": "Stav zásob",
        "description": "Oprávnenie: `sklad:read`.",
        "responses": {
          "200": {
            "description": "Skladové položky",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StockLevel"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "product_id": 7,
                      "name": "Kábel 3 m",
                      "sku": "KABEL3",
                      "unit": "ks",
                      "quantity": 48,
                      "average_price_cents": 310,
                      "value_cents": 14880
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "parameters": [
          {
            "name": "sklad_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Len jeden sklad, inak súhrn"
          }
        ]
      }
    },
    "/sandbox/simuluj-uhradu": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Simulovať úhradu faktúry",
        "description": "Len v sandboxe (https://sandbox.saveucto.sk), v produkcii vráti 404. Zapíše úhradu ako z banky a vyvolá udalosť `faktura.uhradena`.\n\nOprávnenie: `faktury:write`.",
        "responses": {
          "201": {
            "description": "Úhrada zapísaná",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "payment_id": {
                          "type": "integer",
                          "examples": [
                            311
                          ]
                        },
                        "amount_cents": {
                          "type": "integer",
                          "examples": [
                            2656
                          ]
                        },
                        "invoice_status": {
                          "type": "string",
                          "examples": [
                            "paid"
                          ]
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "payment_id": 311,
                    "amount_cents": 2656,
                    "invoice_status": "paid"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimulatedPaymentInput"
              },
              "example": {
                "invoice_id": 512
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/idempotency"
          }
        ]
      }
    }
  },
  "webhooks": {
    "faktura.vystavena": {
      "post": {
        "tags": [
          "Webhooky"
        ],
        "summary": "Faktúra vystavená",
        "description": "Podpis: `X-SaveUcto-Signature: sha256=HMAC-SHA256(tajomstvo, \"{X-SaveUcto-Timestamp}.{telo}\")`.",
        "parameters": [
          {
            "name": "X-SaveUcto-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "4f0c8a52-7b1e-4f7e-9a51-1d2c3b4a5f60",
                "event": "faktura.uhradena",
                "created_at": "2026-10-03T14:02:11+02:00",
                "data": {
                  "id": 512
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prijaté (akýkoľvek kód 2xx)"
          }
        }
      }
    },
    "faktura.uhradena": {
      "post": {
        "tags": [
          "Webhooky"
        ],
        "summary": "Faktúra uhradená",
        "description": "Podpis: `X-SaveUcto-Signature: sha256=HMAC-SHA256(tajomstvo, \"{X-SaveUcto-Timestamp}.{telo}\")`.",
        "parameters": [
          {
            "name": "X-SaveUcto-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "4f0c8a52-7b1e-4f7e-9a51-1d2c3b4a5f60",
                "event": "faktura.uhradena",
                "created_at": "2026-10-03T14:02:11+02:00",
                "data": {
                  "id": 512
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prijaté (akýkoľvek kód 2xx)"
          }
        }
      }
    },
    "faktura.stornovana": {
      "post": {
        "tags": [
          "Webhooky"
        ],
        "summary": "Faktúra stornovaná",
        "description": "Podpis: `X-SaveUcto-Signature: sha256=HMAC-SHA256(tajomstvo, \"{X-SaveUcto-Timestamp}.{telo}\")`.",
        "parameters": [
          {
            "name": "X-SaveUcto-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "4f0c8a52-7b1e-4f7e-9a51-1d2c3b4a5f60",
                "event": "faktura.uhradena",
                "created_at": "2026-10-03T14:02:11+02:00",
                "data": {
                  "id": 512
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prijaté (akýkoľvek kód 2xx)"
          }
        }
      }
    },
    "prijata_faktura.prijata": {
      "post": {
        "tags": [
          "Webhooky"
        ],
        "summary": "Prijatá faktúra zaevidovaná",
        "description": "Podpis: `X-SaveUcto-Signature: sha256=HMAC-SHA256(tajomstvo, \"{X-SaveUcto-Timestamp}.{telo}\")`.",
        "parameters": [
          {
            "name": "X-SaveUcto-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "4f0c8a52-7b1e-4f7e-9a51-1d2c3b4a5f60",
                "event": "faktura.uhradena",
                "created_at": "2026-10-03T14:02:11+02:00",
                "data": {
                  "id": 512
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prijaté (akýkoľvek kód 2xx)"
          }
        }
      }
    },
    "odberatel.zmeneny": {
      "post": {
        "tags": [
          "Webhooky"
        ],
        "summary": "Odberateľ založený alebo zmenený",
        "description": "Podpis: `X-SaveUcto-Signature: sha256=HMAC-SHA256(tajomstvo, \"{X-SaveUcto-Timestamp}.{telo}\")`.",
        "parameters": [
          {
            "name": "X-SaveUcto-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SaveUcto-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "4f0c8a52-7b1e-4f7e-9a51-1d2c3b4a5f60",
                "event": "faktura.uhradena",
                "created_at": "2026-10-03T14:02:11+02:00",
                "data": {
                  "id": 512
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prijaté (akýkoľvek kód 2xx)"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Kľúč z Nastavenia → API. Prijíma sa aj `Authorization: Bearer <kľúč>`."
      }
    },
    "parameters": {
      "id": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        }
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        }
      },
      "od_id": {
        "name": "od_id",
        "in": "query",
        "description": "Vráti záznamy s ID väčším ako toto (ďalšia strana = `next_od_id`)",
        "schema": {
          "type": "integer"
        }
      },
      "idempotency": {
        "name": "Idempotency-Key",
        "in": "header",
        "description": "Ľubovoľný jedinečný reťazec (napr. ID objednávky). Opakovaná požiadavka s tým istým kľúčom do 24 h vráti pôvodnú odpoveď a nič nové nezaloží. Iné telo s tým istým kľúčom = 422 `idempotency_mismatch`.",
        "schema": {
          "type": "string",
          "maxLength": 255
        }
      },
      "zmenene_od": {
        "name": "zmenene_od",
        "in": "query",
        "description": "Len záznamy zmenené od tohto času (ISO 8601) – na synchronizáciu",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Chýbajúci, neplatný, zrušený alebo expirovaný kľúč, kľúč z iného prostredia, IP mimo povolených",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Neplatný, zrušený alebo expirovaný API kľúč.",
              "code": "invalid_key"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Kľúč nemá oprávnenie (`missing_scope`), firma nemá API v balíku (`plan_required`) alebo modul (`module_not_available`)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Kľúč nemá oprávnenie faktury:write.",
              "code": "missing_scope"
            }
          }
        }
      },
      "NotFound": {
        "description": "Záznam neexistuje alebo nepatrí vašej firme",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Záznam neexistuje.",
              "code": "not_found"
            }
          }
        }
      },
      "ValidationFailed": {
        "description": "Neplatné dáta (`validation_failed`) alebo iné telo s použitým Idempotency-Key (`idempotency_mismatch`)",
        "content": {
          "application/json": {
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ValidationError"
                },
                {
                  "$ref": "#/components/schemas/Error"
                }
              ]
            },
            "example": {
              "error": "Neplatné dáta.",
              "code": "validation_failed",
              "fields": {
                "customer_name": [
                  "Názov odberateľa je povinný."
                ]
              }
            }
          }
        }
      },
      "BadRequest": {
        "description": "Kľúč v adrese namiesto hlavičky (`key_in_url`) alebo neplatný Idempotency-Key (`invalid_idempotency_key`)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "API kľúč posielajte v hlavičke X-Api-Key, nie v adrese.",
              "code": "key_in_url"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "Telo požiadavky nad 1 MB (`payload_too_large`)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Telo požiadavky je väčšie ako 1 MB.",
              "code": "payload_too_large"
            }
          }
        }
      },
      "Conflict": {
        "description": "Operáciu stav dokladu nedovoľuje, napr. `locked` (zamknuté obdobie), `not_cancellable`, `not_sendable`, `not_allowed`, `idempotency_in_progress`",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Účtovný rok je zamknutý — doklad nemožno vytvoriť.",
              "code": "locked"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Prekročený limit za minútu (`rate_limited`) alebo denný limit (`daily_quota`)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Prekročený limit 60 požiadaviek za minútu.",
              "code": "rate_limited"
            }
          }
        },
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "Počet sekúnd do ďalšieho pokusu"
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Text pre človeka"
          },
          "code": {
            "type": "string",
            "description": "Strojový kód chyby"
          },
          "request_id": {
            "type": "string",
            "description": "Pri chybe servera, uveďte ho pri hlásení"
          }
        },
        "required": [
          "error",
          "code"
        ]
      },
      "ValidationError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "validation_failed"
            ]
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Chyby podľa polí"
          }
        },
        "required": [
          "error",
          "code",
          "fields"
        ]
      },
      "ExternalId": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "ext_id": {
            "type": "string"
          }
        }
      },
      "Customer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "external_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalId"
            }
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "description": "Názov firmy alebo meno"
          },
          "ico": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "IČO, medzery sa odstránia"
          },
          "dic": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "ic_dph": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 255
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "street2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Predvolene `Slovensko`"
          },
          "eori": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "iban": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 34,
            "description": "Medzery sa odstránia, písmená sa zväčšia"
          },
          "is_customer": {
            "type": "boolean",
            "description": "Odberateľ (pri vytvorení predvolene `true`)"
          },
          "is_supplier": {
            "type": "boolean",
            "description": "Dodávateľ"
          },
          "is_foreign": {
            "type": "boolean",
            "description": "Zahraničný partner"
          }
        }
      },
      "CustomerInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "description": "Názov firmy alebo meno"
          },
          "ico": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "IČO, medzery sa odstránia"
          },
          "dic": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "ic_dph": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 255
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "street2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Predvolene `Slovensko`"
          },
          "eori": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "iban": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 34,
            "description": "Medzery sa odstránia, písmená sa zväčšia"
          },
          "is_customer": {
            "type": "boolean",
            "description": "Odberateľ (pri vytvorení predvolene `true`)"
          },
          "is_supplier": {
            "type": "boolean",
            "description": "Dodávateľ"
          },
          "is_foreign": {
            "type": "boolean",
            "description": "Zahraničný partner"
          },
          "ext_source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Názov vášho systému, napr. `eshop`. Spolu s `ext_id`."
          },
          "ext_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "ID záznamu vo vašom systéme."
          }
        },
        "required": [
          "name"
        ]
      },
      "CustomerUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "description": "Názov firmy alebo meno"
          },
          "ico": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "IČO, medzery sa odstránia"
          },
          "dic": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "ic_dph": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 255
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "street2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Predvolene `Slovensko`"
          },
          "eori": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "iban": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 34,
            "description": "Medzery sa odstránia, písmená sa zväčšia"
          },
          "is_customer": {
            "type": "boolean",
            "description": "Odberateľ (pri vytvorení predvolene `true`)"
          },
          "is_supplier": {
            "type": "boolean",
            "description": "Dodávateľ"
          },
          "is_foreign": {
            "type": "boolean",
            "description": "Zahraničný partner"
          },
          "ext_source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Názov vášho systému, napr. `eshop`. Spolu s `ext_id`."
          },
          "ext_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "ID záznamu vo vašom systéme."
          }
        },
        "description": "Posielajú sa len menené polia."
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "external_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalId"
            }
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Kód produktu"
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Merná jednotka, predvolene `ks`"
          },
          "unit_price_cents": {
            "type": "integer",
            "description": "Jednotková cena bez DPH v centoch"
          },
          "vat_rate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Sadzba DPH v %, predvolene 23"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "is_active": {
            "type": "boolean",
            "description": "Aktívna položka (predvolene `true`)"
          },
          "is_recurring": {
            "type": "boolean",
            "description": "Opakujúca sa služba"
          },
          "price_year2_cents": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Cena v 2. roku opakovanej služby"
          },
          "price_year3_cents": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Cena od 3. roku opakovanej služby"
          }
        }
      },
      "ProductInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Kód produktu"
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Merná jednotka, predvolene `ks`"
          },
          "unit_price_cents": {
            "type": "integer",
            "description": "Jednotková cena bez DPH v centoch"
          },
          "vat_rate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Sadzba DPH v %, predvolene 23"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "is_active": {
            "type": "boolean",
            "description": "Aktívna položka (predvolene `true`)"
          },
          "is_recurring": {
            "type": "boolean",
            "description": "Opakujúca sa služba"
          },
          "price_year2_cents": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Cena v 2. roku opakovanej služby"
          },
          "price_year3_cents": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Cena od 3. roku opakovanej služby"
          },
          "ext_source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Názov vášho systému, napr. `eshop`. Spolu s `ext_id`."
          },
          "ext_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "ID záznamu vo vašom systéme."
          }
        },
        "required": [
          "name",
          "unit_price_cents"
        ]
      },
      "ProductUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Kód produktu"
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Merná jednotka, predvolene `ks`"
          },
          "unit_price_cents": {
            "type": "integer",
            "description": "Jednotková cena bez DPH v centoch"
          },
          "vat_rate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Sadzba DPH v %, predvolene 23"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "is_active": {
            "type": "boolean",
            "description": "Aktívna položka (predvolene `true`)"
          },
          "is_recurring": {
            "type": "boolean",
            "description": "Opakujúca sa služba"
          },
          "price_year2_cents": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Cena v 2. roku opakovanej služby"
          },
          "price_year3_cents": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Cena od 3. roku opakovanej služby"
          },
          "ext_source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Názov vášho systému, napr. `eshop`. Spolu s `ext_id`."
          },
          "ext_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "ID záznamu vo vašom systéme."
          }
        },
        "description": "Posielajú sa len menené polia."
      },
      "Company": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ico": {
            "type": [
              "string",
              "null"
            ]
          },
          "dic": {
            "type": [
              "string",
              "null"
            ]
          },
          "ic_dph": {
            "type": [
              "string",
              "null"
            ]
          },
          "street": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "zip": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "iban": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_vat_payer": {
            "type": "boolean"
          }
        }
      },
      "NumberSeries": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "doc_type": {
            "type": "string",
            "description": "Typ dokladu, napr. `invoice`"
          },
          "scope_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Prevádzka alebo činnosť"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ]
          },
          "prefix": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_number": {
            "type": "integer"
          },
          "padding": {
            "type": "integer"
          },
          "next": {
            "type": "string",
            "description": "Najbližšie číslo dokladu"
          }
        }
      },
      "BankAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "iban": {
            "type": "string"
          },
          "bic": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "is_default": {
            "type": "boolean"
          }
        }
      },
      "InvoiceItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "description": {
            "type": "string",
            "maxLength": 255
          },
          "quantity": {
            "type": "number",
            "minimum": 0
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Predvolene `ks`"
          },
          "unit_price_cents": {
            "type": "number",
            "description": "Jednotková cena bez DPH v centoch, smie mať jedno desatinné miesto (1,589 € = 158.9)"
          },
          "vat_rate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Sadzba DPH v %, predvolene 23. Pri režime bez slovenskej DPH sa nastaví 0."
          },
          "vat_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Presná suma DPH riadku v centoch, ak sa nemá dopočítať zo sadzby"
          },
          "discount_percent": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "product_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Produkt z cenníka (výdaj zo skladu, ak má firma modul Sklad)"
          },
          "service_valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Platnosť predplatenej služby"
          },
          "line_total_cents": {
            "type": "integer",
            "description": "Riadok bez DPH po zľave"
          }
        }
      },
      "Invoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "number": {
            "type": "string",
            "description": "Číslo z číselného radu"
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "partially_paid",
              "paid",
              "cancelled"
            ],
            "description": "`sent` vystavená, `partially_paid`, `paid`, `cancelled` stornovaná"
          },
          "doc_type": {
            "type": "string",
            "enum": [
              "invoice",
              "proforma",
              "credit_note",
              "debit_note",
              "quote",
              "order",
              "delivery_note"
            ],
            "description": "Typ dokladu, predvolene `invoice`"
          },
          "issue_date": {
            "type": "string",
            "format": "date",
            "description": "Dátum vystavenia"
          },
          "delivery_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Dátum dodania, platca DPH ho musí uviesť na daňovom doklade (§74)"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Splatnosť, povinná okrem cenovej ponuky"
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Platnosť cenovej ponuky"
          },
          "payment_method": {
            "type": "string",
            "maxLength": 50,
            "description": "Spôsob úhrady, napr. `Prevodom`"
          },
          "variable_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Predvolene číslice z čísla dokladu"
          },
          "constant_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "specific_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217, predvolene `EUR`"
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Kurz k EUR, predvolene kurz ECB"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "sk",
              "en",
              null
            ]
          },
          "vat_regime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Režim DPH, napr. `prenesenie_dp`"
          },
          "vat_note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "eu_supply_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "tovar",
              "sluzba",
              null
            ]
          },
          "posting_account_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "description": "Výnosový účet (trieda 6)"
          },
          "branch_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Prevádzka s vlastným číselným radom (len pri vytvorení)"
          },
          "pdf_template": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vzhľad PDF, len cenová ponuka"
          },
          "pdf_accent": {
            "type": [
              "string",
              "null"
            ],
            "description": "Farba #rrggbb, len cenová ponuka"
          },
          "customer_name": {
            "type": "string",
            "maxLength": 255
          },
          "customer_street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "customer_street2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "customer_city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "customer_zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "customer_ico": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_dic": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_ic_dph": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 255,
            "description": "Kam ide faktúra pri odoslaní"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Text na doklade"
          },
          "original_invoice_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pôvodný doklad (dobropis, vyúčtovanie, prevod)"
          },
          "subtotal_cents": {
            "type": "integer"
          },
          "vat_total_cents": {
            "type": "integer"
          },
          "total_cents": {
            "type": "integer"
          },
          "paid_cents": {
            "type": "integer",
            "description": "Súčet úhrad"
          },
          "efaktura_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stav odoslania cez digitálneho poštára"
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceItem"
            }
          },
          "external_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalId"
            }
          }
        }
      },
      "InvoiceInput": {
        "type": "object",
        "properties": {
          "doc_type": {
            "type": "string",
            "enum": [
              "invoice",
              "proforma",
              "credit_note",
              "debit_note",
              "quote",
              "order",
              "delivery_note"
            ],
            "description": "Typ dokladu, predvolene `invoice`"
          },
          "issue_date": {
            "type": "string",
            "format": "date",
            "description": "Dátum vystavenia"
          },
          "delivery_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Dátum dodania, platca DPH ho musí uviesť na daňovom doklade (§74)"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Splatnosť, povinná okrem cenovej ponuky"
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Platnosť cenovej ponuky"
          },
          "payment_method": {
            "type": "string",
            "maxLength": 50,
            "description": "Spôsob úhrady, napr. `Prevodom`"
          },
          "variable_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Predvolene číslice z čísla dokladu"
          },
          "constant_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "specific_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217, predvolene `EUR`"
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Kurz k EUR, predvolene kurz ECB"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "sk",
              "en",
              null
            ]
          },
          "vat_regime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Režim DPH, napr. `prenesenie_dp`"
          },
          "vat_note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "eu_supply_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "tovar",
              "sluzba",
              null
            ]
          },
          "posting_account_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "description": "Výnosový účet (trieda 6)"
          },
          "branch_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Prevádzka s vlastným číselným radom (len pri vytvorení)"
          },
          "pdf_template": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vzhľad PDF, len cenová ponuka"
          },
          "pdf_accent": {
            "type": [
              "string",
              "null"
            ],
            "description": "Farba #rrggbb, len cenová ponuka"
          },
          "customer_name": {
            "type": "string",
            "maxLength": 255
          },
          "customer_street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "customer_street2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "customer_city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "customer_zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "customer_ico": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_dic": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_ic_dph": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 255,
            "description": "Kam ide faktúra pri odoslaní"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Text na doklade"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "maxLength": 255
                },
                "quantity": {
                  "type": "number",
                  "minimum": 0
                },
                "unit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Predvolene `ks`"
                },
                "unit_price_cents": {
                  "type": "number",
                  "description": "Jednotková cena bez DPH v centoch, smie mať jedno desatinné miesto (1,589 € = 158.9)"
                },
                "vat_rate": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100,
                  "description": "Sadzba DPH v %, predvolene 23. Pri režime bez slovenskej DPH sa nastaví 0."
                },
                "vat_cents": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Presná suma DPH riadku v centoch, ak sa nemá dopočítať zo sadzby"
                },
                "discount_percent": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100
                },
                "product_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Produkt z cenníka (výdaj zo skladu, ak má firma modul Sklad)"
                },
                "service_valid_until": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date",
                  "description": "Platnosť predplatenej služby"
                }
              },
              "required": [
                "description",
                "quantity",
                "unit_price_cents"
              ]
            }
          },
          "ext_source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Názov vášho systému, napr. `eshop`. Spolu s `ext_id`."
          },
          "ext_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "ID záznamu vo vašom systéme."
          }
        },
        "required": [
          "issue_date",
          "payment_method",
          "customer_name",
          "items"
        ]
      },
      "InvoiceUpdate": {
        "type": "object",
        "properties": {
          "issue_date": {
            "type": "string",
            "format": "date",
            "description": "Dátum vystavenia"
          },
          "delivery_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Dátum dodania, platca DPH ho musí uviesť na daňovom doklade (§74)"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Splatnosť, povinná okrem cenovej ponuky"
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Platnosť cenovej ponuky"
          },
          "payment_method": {
            "type": "string",
            "maxLength": 50,
            "description": "Spôsob úhrady, napr. `Prevodom`"
          },
          "variable_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Predvolene číslice z čísla dokladu"
          },
          "constant_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "specific_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217, predvolene `EUR`"
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Kurz k EUR, predvolene kurz ECB"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "sk",
              "en",
              null
            ]
          },
          "vat_regime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Režim DPH, napr. `prenesenie_dp`"
          },
          "vat_note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "eu_supply_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "tovar",
              "sluzba",
              null
            ]
          },
          "posting_account_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "description": "Výnosový účet (trieda 6)"
          },
          "pdf_template": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vzhľad PDF, len cenová ponuka"
          },
          "pdf_accent": {
            "type": [
              "string",
              "null"
            ],
            "description": "Farba #rrggbb, len cenová ponuka"
          },
          "customer_name": {
            "type": "string",
            "maxLength": 255
          },
          "customer_street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "customer_street2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "customer_city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "customer_zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "customer_ico": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_dic": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_ic_dph": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 255,
            "description": "Kam ide faktúra pri odoslaní"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Text na doklade"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "maxLength": 255
                },
                "quantity": {
                  "type": "number",
                  "minimum": 0
                },
                "unit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20,
                  "description": "Predvolene `ks`"
                },
                "unit_price_cents": {
                  "type": "number",
                  "description": "Jednotková cena bez DPH v centoch, smie mať jedno desatinné miesto (1,589 € = 158.9)"
                },
                "vat_rate": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100,
                  "description": "Sadzba DPH v %, predvolene 23. Pri režime bez slovenskej DPH sa nastaví 0."
                },
                "vat_cents": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Presná suma DPH riadku v centoch, ak sa nemá dopočítať zo sadzby"
                },
                "discount_percent": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100
                },
                "product_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Produkt z cenníka (výdaj zo skladu, ak má firma modul Sklad)"
                },
                "service_valid_until": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date",
                  "description": "Platnosť predplatenej služby"
                }
              },
              "required": [
                "description",
                "quantity",
                "unit_price_cents"
              ]
            }
          },
          "ext_source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Názov vášho systému, napr. `eshop`. Spolu s `ext_id`."
          },
          "ext_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "ID záznamu vo vašom systéme."
          }
        },
        "required": [
          "issue_date",
          "payment_method",
          "customer_name",
          "items"
        ],
        "description": "Celý doklad, položky sa nahradia. Typ a prevádzka sa nemenia."
      },
      "SendInput": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "efaktura"
            ],
            "description": "`email` (predvolené) alebo `efaktura` (digitálny poštár)"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "Príjemca, predvolene `customer_email` faktúry"
          },
          "cc": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "subject": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "Predvolene podľa šablóny e-mailov firmy"
          },
          "body": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000,
            "description": "Predvolene podľa šablóny e-mailov firmy"
          }
        }
      },
      "Payment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "amount_cents": {
            "type": "integer",
            "description": "Záporná suma = vrátenie peňazí"
          },
          "paid_on": {
            "type": "string",
            "format": "date"
          },
          "method": {
            "type": "string"
          },
          "bank_account_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "settled_eur_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Skutočná suma v EUR pri doklade v cudzej mene"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "description": "`manual`, `bank`, …"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PaymentInput": {
        "type": "object",
        "properties": {
          "amount_cents": {
            "type": "integer",
            "description": "Záporná suma = vrátenie peňazí"
          },
          "paid_on": {
            "type": "string",
            "format": "date"
          },
          "method": {
            "type": "string"
          },
          "bank_account_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "settled_eur_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Skutočná suma v EUR pri doklade v cudzej mene"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "amount_cents",
          "paid_on"
        ],
        "description": "Len bezhotovostná úhrada. Hotovosť ide cez pokladňu v SaveÚčte."
      },
      "PurchaseInvoiceInput": {
        "type": "object",
        "properties": {
          "doc_kind": {
            "type": "string",
            "enum": [
              "invoice",
              "receipt",
              "proforma"
            ],
            "description": "`invoice` faktúra (predvolené), `receipt` bloček, `proforma` zálohová"
          },
          "receipt_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pri bločku: `ekasa` (do 400 €) alebo `ine` (do 100 €)"
          },
          "correction_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "credit_note",
              "debit_note",
              null
            ]
          },
          "original_purchase_invoice_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pri dobropise/ťarchopise"
          },
          "supplier_name": {
            "type": "string",
            "maxLength": 255
          },
          "supplier_street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "supplier_street2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "supplier_city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "supplier_zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "supplier_country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "supplier_eori": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "supplier_ico": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "supplier_dic": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "supplier_ic_dph": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "supplier_iban": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 34
          },
          "supplier_number": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 60,
            "description": "Číslo dokladu dodávateľa, povinné okrem bločku"
          },
          "variable_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "constant_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "issue_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "delivery_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "received_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "vat_period_override": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Uplatnenie odpočtu v inom mesiaci toho istého roka"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "vat_regime": {
            "type": [
              "string",
              "null"
            ]
          },
          "reverse_charge": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "supplier_is_foreign": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "vat_deduction": {
            "type": [
              "string",
              "null"
            ]
          },
          "vat_deduction_percent": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "vehicle_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fuel_liters": {
            "type": [
              "number",
              "null"
            ]
          },
          "odometer_km": {
            "type": [
              "integer",
              "null"
            ]
          },
          "expense_category_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "posting_account_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Účet (triedy 0, 1, 3, 5)"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "maxLength": 255
                },
                "quantity": {
                  "type": "number"
                },
                "unit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20
                },
                "unit_price_cents": {
                  "type": "number",
                  "description": "Jednotková cena bez DPH v centoch"
                },
                "vat_rate": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "vat_cents": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Presná DPH riadku v centoch"
                },
                "discount_percent": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100
                },
                "product_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "vat_deduction": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Odpočet DPH riadku"
                },
                "posting_account_code": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Nákladový účet"
                }
              },
              "required": [
                "description",
                "quantity",
                "unit_price_cents"
              ]
            }
          },
          "ext_source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Názov vášho systému, napr. `eshop`. Spolu s `ext_id`."
          },
          "ext_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "ID záznamu vo vašom systéme."
          }
        },
        "required": [
          "supplier_name",
          "items"
        ]
      },
      "PurchaseInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Interné číslo bločku"
          },
          "status": {
            "type": "string"
          },
          "doc_kind": {
            "type": "string",
            "enum": [
              "invoice",
              "receipt",
              "proforma"
            ],
            "description": "`invoice` faktúra (predvolené), `receipt` bloček, `proforma` zálohová"
          },
          "receipt_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pri bločku: `ekasa` (do 400 €) alebo `ine` (do 100 €)"
          },
          "correction_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "credit_note",
              "debit_note",
              null
            ]
          },
          "original_purchase_invoice_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pri dobropise/ťarchopise"
          },
          "supplier_name": {
            "type": "string",
            "maxLength": 255
          },
          "supplier_street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "supplier_street2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "supplier_city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "supplier_zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "supplier_country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "supplier_eori": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "supplier_ico": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "supplier_dic": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "supplier_ic_dph": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "supplier_iban": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 34
          },
          "supplier_number": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 60,
            "description": "Číslo dokladu dodávateľa, povinné okrem bločku"
          },
          "variable_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "constant_symbol": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "issue_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "delivery_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "received_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "vat_period_override": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Uplatnenie odpočtu v inom mesiaci toho istého roka"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "vat_regime": {
            "type": [
              "string",
              "null"
            ]
          },
          "vat_deduction": {
            "type": [
              "string",
              "null"
            ]
          },
          "vat_deduction_percent": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "vehicle_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fuel_liters": {
            "type": [
              "number",
              "null"
            ]
          },
          "odometer_km": {
            "type": [
              "integer",
              "null"
            ]
          },
          "posting_account_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Účet (triedy 0, 1, 3, 5)"
          },
          "subtotal_cents": {
            "type": "integer"
          },
          "vat_total_cents": {
            "type": "integer"
          },
          "total_cents": {
            "type": "integer"
          },
          "paid_cents": {
            "type": "integer"
          },
          "has_attachment": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "description": {
                  "type": "string",
                  "maxLength": 255
                },
                "quantity": {
                  "type": "number"
                },
                "unit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 20
                },
                "unit_price_cents": {
                  "type": "number",
                  "description": "Jednotková cena bez DPH v centoch"
                },
                "vat_rate": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "vat_cents": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Presná DPH riadku v centoch"
                },
                "discount_percent": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100
                },
                "product_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "vat_deduction": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Odpočet DPH riadku"
                },
                "posting_account_code": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Nákladový účet"
                },
                "line_total_cents": {
                  "type": "integer"
                }
              }
            }
          },
          "external_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalId"
            }
          }
        }
      },
      "CashDocumentInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "income",
              "expense"
            ],
            "description": "`income` príjem, `expense` výdavok"
          },
          "operation": {
            "type": "string",
            "description": "Druh operácie z číselníka SaveÚčta"
          },
          "issued_on": {
            "type": "string",
            "format": "date"
          },
          "partner_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "partner_ico": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "description": {
            "type": "string",
            "maxLength": 255
          },
          "amount_cents": {
            "type": "integer",
            "minimum": 1,
            "description": "Suma vrátane DPH"
          },
          "vat_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "posting_account_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Účet triedy 5 alebo 6"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "cash_register_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pokladnica, predvolene prvá aktívna"
          },
          "ext_source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Názov vášho systému, napr. `eshop`. Spolu s `ext_id`."
          },
          "ext_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "ID záznamu vo vašom systéme."
          }
        },
        "required": [
          "kind",
          "operation",
          "issued_on",
          "description",
          "amount_cents"
        ]
      },
      "CashDocument": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "number": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "income",
              "expense"
            ],
            "description": "`income` príjem, `expense` výdavok"
          },
          "operation": {
            "type": "string",
            "description": "Druh operácie z číselníka SaveÚčta"
          },
          "issued_on": {
            "type": "string",
            "format": "date"
          },
          "partner_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "partner_ico": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "description": {
            "type": "string",
            "maxLength": 255
          },
          "amount_cents": {
            "type": "integer",
            "minimum": 1,
            "description": "Suma vrátane DPH"
          },
          "vat_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "posting_account_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Účet triedy 5 alebo 6"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "cash_register_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pokladnica, predvolene prvá aktívna"
          },
          "vat_cents": {
            "type": "integer"
          },
          "payable_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Uhradený doklad, napr. `invoice`"
          },
          "payable_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "external_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalId"
            }
          }
        }
      },
      "StockMovement": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "product_id": {
            "type": "integer"
          },
          "stock_location_id": {
            "type": "integer"
          },
          "type": {
            "type": "string",
            "enum": [
              "in",
              "out"
            ]
          },
          "quantity": {
            "type": "number"
          },
          "unit_price_cents": {
            "type": "integer"
          },
          "movement_date": {
            "type": "string",
            "format": "date"
          },
          "invoice_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "purchase_invoice_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "external_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalId"
            }
          }
        }
      },
      "StockLevel": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "unit": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "average_price_cents": {
            "type": "integer"
          },
          "value_cents": {
            "type": "integer"
          }
        }
      },
      "WebhookEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID udalosti (rovnaké pri opakovanom doručení)"
          },
          "event": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "ID záznamu, detail cez API"
              }
            },
            "required": [
              "id"
            ]
          }
        },
        "required": [
          "id",
          "event",
          "created_at",
          "data"
        ]
      },
      "SimulatedPaymentInput": {
        "type": "object",
        "properties": {
          "invoice_id": {
            "type": "integer"
          },
          "amount_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Predvolene celý zostatok faktúry"
          }
        },
        "required": [
          "invoice_id"
        ]
      }
    }
  }
}
