{
  "swagger": "2.0",
  "info": {
    "version": "v1",
    "title": "LemonRest 2026.9 release-2026.9.2-b1422531"
  },
  "host": "rest.lemon.fi",
  "schemes": [
    "https"
  ],
  "paths": {
    "/api/accounting/vouchers": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get paged list of vouchers",
        "operationId": "Accounting_ListVouchers",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.voucher_date_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.voucher_date_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.type",
            "in": "query",
            "description": "1 = Normaali\r\n2 = Alkusaldot\r\n3 = Alv-kirjaus\r\n4 = Tilinpäätös",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.state",
            "in": "query",
            "description": "0 = kirjattu\r\n1 = kierrossa\r\n2 = hylätty\r\n3 = hyväksytty",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.period_id",
            "in": "query",
            "description": "Tilikauden tunniste",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.voucher_class",
            "in": "query",
            "description": "Tilikauden tositelaji",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "description": "Sort field (database column name). Default is \"accounting_id\". Common values: accounting_id, accounting_date, accounting_vouchernumber.\r\nFalls back to default if column does not exist.",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Accounting]"
            }
          }
        }
      }
    },
    "/api/accounting/voucher_rows": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get paged list of voucher rows",
        "operationId": "Accounting_ListVoucherRows",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.voucher_date_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.voucher_date_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.type",
            "in": "query",
            "description": "1 = Normaali\r\n2 = Alkusaldot\r\n3 = Alv-kirjaus\r\n4 = Tilinpäätös",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.state",
            "in": "query",
            "description": "0 = kirjattu\r\n1 = kierrossa\r\n2 = hylätty\r\n3 = hyväksytty",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.period_id",
            "in": "query",
            "description": "Tilikauden tunniste",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.voucher_class",
            "in": "query",
            "description": "Tilikauden tositelaji",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "description": "Sort field (database column name). Default is \"accounting_id\". Common values: accounting_id, accounting_date, accounting_vouchernumber.\r\nFalls back to default if column does not exist.",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.AccountingCombined]"
            }
          }
        }
      }
    },
    "/api/accounting/upcoming_vouchers": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get a list of voucher rows from invoices and purchase invoices that are not in bookkeeping.",
        "operationId": "Accounting_ListUpComingVouchers",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.voucher_date_before",
            "in": "query",
            "description": "Date to",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.voucher_date_after",
            "in": "query",
            "description": "Date from",
            "required": false,
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Accounting]"
            }
          }
        }
      }
    },
    "/api/accounting/periods": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get paged list of accounting periods",
        "operationId": "Accounting_ListPeriods",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.description",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.AccountingPeriod]"
            }
          }
        }
      }
    },
    "/api/accounting/chart_of_accounts": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Returns a chart of accounts",
        "operationId": "Accounting_ListAccounts",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.AccountingPeriod]"
            }
          }
        }
      }
    },
    "/api/agent/purchase-invoice/preprocessing": {
      "post": {
        "tags": [
          "Agent"
        ],
        "summary": "Stores an agent report produced by the purchase-invoice preprocessing agent. Idempotent on\r\nexternal_ref: a worker retry returns the existing report instead of duplicating it. The\r\nreport target (target_object_id) is supplied in the payload, so the ERP does no invoice lookup.",
        "operationId": "Agent_PostPurchaseInvoicePreprocessing",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "description": "The report payload (target id, checks, suggestions).",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Lemonsoft.AgentLibrary.Dto.AgentReportDTO"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[Lemonsoft.AgentLibrary.Dto.AgentReportResultDTO]"
            }
          }
        }
      }
    },
    "/api/async/task/{task_id}": {
      "get": {
        "tags": [
          "Async"
        ],
        "summary": "Gets the result of a task by its ID.",
        "operationId": "Async_GetTaskResult",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "description": "",
            "required": true,
            "type": "string",
            "format": "uuid"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TaskResultResponse"
            }
          }
        }
      }
    },
    "/api/async/order/{order_id}/row": {
      "post": {
        "tags": [
          "Async"
        ],
        "summary": "Create new order row",
        "operationId": "Async_CreateRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyOrderRow",
            "in": "body",
            "description": "Order row",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TaskStartResponse"
            }
          }
        }
      }
    },
    "/api/auth/alive": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Check if the current session is still valid",
        "description": "Verify whether the current session is active and retrieve its expiration time.\r\nThe session is identified by the Session-Id header, which must contain the session_id\r\nvalue received from a successful login.\r\n            \r\nReturns ok = true if the session is valid, along with the expire_time.\r\nReturns ok = false if the session has expired or is not found.\r\n            \r\nUse this endpoint to check session validity before making API calls, or to determine\r\nwhen you need to re-authenticate.",
        "operationId": "Authentication_Alive",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.AliveResponse"
            }
          }
        }
      }
    },
    "/api/auth/renew": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Renew an existing session",
        "description": "Obtain a new session_id using the same credentials. This works identically to the login\r\nendpoint — it authenticates with username, password, database, and API key and returns\r\na fresh session_id with a new expiration time.\r\n            \r\nUse this endpoint to refresh your session before it expires, so your integration\r\ncan maintain continuous access without interruption.\r\n            \r\nThe request body and response format are the same as POST /api/auth/login.",
        "operationId": "Authentication_Renew",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "login_info",
            "in": "body",
            "description": "Login credentials",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.LogInInfo"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.AuthenticationResponse"
            }
          }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Log in with username and password",
        "description": "Authenticate with username, password, database, and API key to receive a session_id.\r\n            \r\n**How to use the session_id:**\r\nAfter a successful login, the response contains a session_id. Include this value\r\nin the `Session-Id` header of every subsequent API request:\r\n            \r\n```\r\nSession-Id: {session_id value from login response}\r\n```\r\n            \r\nThe session_id expires at the time indicated in the expire_time field (UTC).\r\nWhen the session expires, you must call this endpoint again to obtain a new session_id.\r\nAlternatively, use POST /api/auth/renew before the session expires to get a fresh session.\r\n            \r\n**Request body fields:**\r\n- **UserName** — your login email address\r\n- **Password** — your password\r\n- **Database** — the Lemonsoft database identifier for your company\r\n- **ApiKey** — the API key provided by Lemonsoft for your integration\r\n            \r\n**Error responses:**\r\n- HTTP 401 with \"Credential error\" — wrong username, password, or API key\r\n- HTTP 401 with \"Missing licenses\" — the user does not have the required REST API license\r\n- HTTP 401 with \"Person not found\" — the user does not have a matching entry in the person registry\r\n- HTTP 401 with \"Wrong environment\" — the database or environment is not accessible",
        "operationId": "Authentication_LogInUser",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "login_info",
            "in": "body",
            "description": "Login credentials",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.LogInInfo"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.AuthenticationResponse"
            }
          }
        }
      }
    },
    "/api/auth/login/token": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Log in with an authentication token",
        "description": "Authenticate using a pre-existing authentication token instead of username and password.\r\nThis endpoint is intended for integrations that already have a valid token\r\n(e.g., from Azure AD B2C) and need to exchange it for a Lemonsoft REST API session.\r\n            \r\nOn success, the response contains a session_id that you use in the same way as with\r\nthe standard login — include it in the `Session-Id` header of all subsequent requests.\r\n            \r\nIf the token has expired, the response returns a \"token expired\" error message.\r\n            \r\n**Request body fields:**\r\n- **Token** — a valid authentication token\r\n- **Database** — the Lemonsoft database identifier for your company\r\n- **ApiKey** — the API key provided by Lemonsoft for your integration",
        "operationId": "Authentication_LogInToken",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "login_token",
            "in": "body",
            "description": "Token-based login credentials",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.LogInToken"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.AuthenticationResponse"
            }
          }
        }
      }
    },
    "/api/automations": {
      "post": {
        "tags": [
          "Automations"
        ],
        "summary": "Creates an automation.",
        "operationId": "Automations_CreateAutomation",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "The automation to create.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Automation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Automation"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/api/automations/{id}": {
      "put": {
        "tags": [
          "Automations"
        ],
        "summary": "Updates an automation.",
        "operationId": "Automations_UpdateAutomation",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The identifier of the automation to update.",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxy",
            "in": "body",
            "description": "The automation values to save.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Automation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Automation"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "NotFound"
          }
        }
      }
    },
    "/api/campaigns": {
      "get": {
        "tags": [
          "Campaign"
        ],
        "summary": "Get a list of campaigns",
        "description": "Retrieve a paginated list of campaigns with optional filtering by type, state,\r\nresponsible person, creation date, and description.\r\n            \r\nThe search filter searches across campaign description and notes.",
        "operationId": "Campaign_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.campaign_type",
            "in": "query",
            "description": "Filter by campaign type. For possible values, refer to /api/settings/crm_types\r\n[here](#tag/Settings/operation/Settings_GetCrmTypes)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.campaign_state",
            "in": "query",
            "description": "Filter by campaign state",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.responsible_person",
            "in": "query",
            "description": "Filter by responsible person number. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.campaign_created_before",
            "in": "query",
            "description": "Filter campaigns created before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.campaign_created_after",
            "in": "query",
            "description": "Filter campaigns created after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.campaign_description",
            "in": "query",
            "description": "Filter by campaign description (partial match)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter campaigns updated before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter campaigns updated after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Campaign]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Campaign"
        ],
        "summary": "Update a campaign",
        "description": "Update an existing campaign's header data, contacts, products, attributes, and project links.\r\n            \r\n**Important:** This endpoint only updates existing contacts and products — it does not add new ones.\r\nTo add new contacts or products, use the dedicated POST /api/campaigns/contact and\r\nPOST /api/campaigns/product endpoints. Each contact and product in the request body must include\r\nits ID (campaign_contact_id or campaign_product_id) to match the existing record.\r\n            \r\n**Project links:** New project numbers in campaign_project_number_list are added as links.\r\nExisting links are preserved.",
        "operationId": "Campaign_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyCampaign",
            "in": "body",
            "description": "The campaign data to update",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Campaign"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Campaign"
        ],
        "summary": "Create a new campaign",
        "description": "Create a new campaign with contacts, products, attributes, and project links in a single request.\r\nThe campaign_number must be unique — if a campaign with the given number already exists,\r\nthe endpoint returns an error.\r\n            \r\n**Contacts and products:** Include them in the campaign_contacts and campaign_products arrays\r\nin the request body. They are created together with the campaign.\r\n            \r\n**Attributes:** Include campaign_attributes with the attribute_code and is_checked values.\r\nOnly attributes with is_checked = true are saved.\r\n            \r\n**Project links:** Include project numbers in campaign_project_number_list to link projects\r\nto the campaign.",
        "operationId": "Campaign_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyCampaign",
            "in": "body",
            "description": "The campaign to create",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Campaign"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/campaigns/{campaignNumber}": {
      "get": {
        "tags": [
          "Campaign"
        ],
        "summary": "Get a single campaign",
        "description": "Retrieve a campaign by its campaign number, including all contacts, products, and attributes.",
        "operationId": "Campaign_Get",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "campaignNumber",
            "in": "path",
            "description": "The campaign number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Campaign]"
            }
          }
        }
      }
    },
    "/api/campaigns/contact": {
      "post": {
        "tags": [
          "Campaign"
        ],
        "summary": "Add a contact to a campaign",
        "description": "Add a new contact entry to an existing campaign. The campaign is identified by the\r\ncampaignNumber query parameter.",
        "operationId": "Campaign_AddContact",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "campaignNumber",
            "in": "query",
            "description": "The campaign number (query parameter)",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyContact",
            "in": "body",
            "description": "The contact to add",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CampaignContact"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Campaign"
        ],
        "summary": "Delete a contact from a campaign",
        "description": "Remove a contact entry from a campaign. Pass the contact to delete in the request body\r\nwith the campaign_contact_id set.",
        "operationId": "Campaign_DeleteContact",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyContact",
            "in": "body",
            "description": "The contact to delete (campaign_contact_id required)",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CampaignContact"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/campaigns/product": {
      "post": {
        "tags": [
          "Campaign"
        ],
        "summary": "Add a product to a campaign",
        "description": "Add a new product to an existing campaign. The campaign is identified by the\r\ncampaignNumber query parameter.",
        "operationId": "Campaign_AddProduct",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "campaignNumber",
            "in": "query",
            "description": "The campaign number (query parameter)",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyProduct",
            "in": "body",
            "description": "The product to add",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CampaignProduct"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Campaign"
        ],
        "summary": "Delete a product from a campaign",
        "description": "Remove a product from a campaign. Pass the product to delete in the request body\r\nwith both campaign_product_id and campaign_id set.",
        "operationId": "Campaign_DeleteProduct",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyProduct",
            "in": "body",
            "description": "The product to delete (campaign_product_id and campaign_id required)",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CampaignProduct"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/Campaign": {
      "delete": {
        "tags": [
          "Campaign"
        ],
        "summary": "Delete a campaign",
        "description": "Delete a campaign and all its associated data.",
        "operationId": "Campaign_Delete",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "campaignNumber",
            "in": "query",
            "description": "The campaign number to delete",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/codelist/description": {
      "get": {
        "tags": [
          "Codelist"
        ],
        "summary": "Get codelist entries by type",
        "description": "Retrieve codelist entries for a specific codelist type. The CodeListFilter parameter is required\r\nand determines which type of codelist to return.\r\n            \r\n**Available CodeListFilter values:**\r\n- CODELISTS (0) — returns the list of all available codelist types\r\n- ABC_GROUPS (1) — ABC groups for customer classification\r\n- AREAS (2) — geographic areas\r\n- BUSINESS_ACTIVITY_AREACODES (3) — business activity area codes (TOL-koodit)\r\n- BUSINESSCODES (4) — business codes (toimialakoodit)\r\n- CHAINS (5) — customer chains (ketjut)\r\n- COMPANY_GROUPS (6) — company groups (konsernit)\r\n- CUSTOMER_CLASSES (7) — customer classes (asiakasluokat)\r\n- CUSTOMER_SEGMENT_CODES (8) — customer segment codes (asiakassegmentit)\r\n- EMPLOYER_QUANTITY_CODES (9) — employer quantity codes (henkilöstömääräluokat)\r\n- MAINBUSINESS_CODES (10) — main business codes (päätoimialakoodit)\r\n- TURNOVER_CODES (11) — turnover codes (liikevaihtoluokat)\r\n- DELIVERY_METHODS (12) — delivery methods (toimitustavat)\r\n- DELIVERYPACKAGE_TYPES (13) — delivery package types (kollin tyypit)\r\n- PRODUCT_COLORS (14) — product colors (tuotevärit)\r\n- DRIVERS (15) — drivers (kuljettajat)\r\n- COUNTRIES (16) — countries (maat)\r\n- DELIVERY_TERMS (17) — delivery terms (toimitusehdot)\r\n- INVOICE_METHODS (18) — invoice methods (laskutustavat)\r\n- EXPENSE_GROUPS (19) — expense groups (kululajit)\r\n- ACCOUNT_TYPES (20) — account types (tilityypit)\r\n- TAXTREATMENT_CODES (21) — tax treatment codes (verokäsittelykoodit)\r\n- PRODUCT_SHELF (22) — product shelf locations (tuotehyllypaikat)\r\n- PRODUCT_MARKS (23) — product marks (tuotemerkit)\r\n- ROUTES (24) — routes (reitit)\r\n- INVOICING_TYPE (25) — invoicing types (laskutustyypit)\r\n- PRODUCT_LINES (26) — product lines (tuotelinjat)\r\n- PRODUCTFAMILY (27) — product families (tuoteperheet)\r\n- PROJECT_CONTRACT_TYPES (28) — project contract types (projektin sopimustyypit)\r\n- PROJECT_ENTERPRISE (29) — project enterprises (projektiyritykset)\r\n- PROJECT_TYPE (30) — project types (projektityypit)\r\n- PROJECTPHASES (31) — project phases (projektivaiheet)\r\n- TITLE_NUMBERS (32) — contact person title numbers (yhteyshenkilön tittelit)\r\n- PERSON_ABSENCE_REASONS (33) — person absence reasons (poissaolon syyt)\r\n- SALESCHANNEL (34) — sales channels (myyntikanavat)\r\n- PRODUCT_MATERIAL (35) — product materials (tuotemateriaalit)\r\n            \r\n**Response model varies by type:**\r\n- Most types return CodelistCommon (Id, Description, CodeId)\r\n- BUSINESSCODES, COUNTRIES, and PROJECTPHASES return CodelistCommonCodeAsString (Id, Description, Code as string)\r\n- DELIVERYPACKAGE_TYPES returns CodelistDeliveryPackage (Id, Description, CodeId, PackageCode)\r\n- PERSON_ABSENCE_REASONS returns CodelistAbsenceReason (Id, Description, CodeId, TransferMaterialCode)\r\n            \r\nResults can be filtered by Name (partial match on description) and Object_ids (list of specific IDs).",
        "operationId": "Codelist_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.name",
            "in": "query",
            "description": "Filter by codelist entry description (partial match)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.codeListFilter",
            "in": "query",
            "description": "The codelist type to retrieve (required). See the CodeList enum for available values (0–35)",
            "required": true,
            "type": "string",
            "enum": [
              "CODELISTS",
              "ABC_GROUPS",
              "AREAS",
              "BUSINESS_ACTIVITY_AREACODES",
              "BUSINESSCODES",
              "CHAINS",
              "COMPANY_GROUPS",
              "CUSTOMER_CLASSES",
              "CUSTOMER_SEGMENT_CODES",
              "EMPLOYER_QUANTITY_CODES",
              "MAINBUSINESS_CODES",
              "TURNOVER_CODES",
              "DELIVERY_METHODS",
              "DELIVERYPACKAGE_TYPES",
              "PRODUCT_COLORS",
              "DRIVERS",
              "COUNTRIES",
              "DELIVERY_TERMS",
              "INVOICE_METHODS",
              "EXPENSE_GROUPS",
              "ACCOUNT_TYPES",
              "TAXTREATMENT_CODES",
              "PRODUCT_SHELF",
              "PRODUCT_MARKS",
              "ROUTES",
              "INVOICING_TYPE",
              "PRODUCT_LINES",
              "PRODUCTFAMILY",
              "PROJECT_CONTRACT_TYPES",
              "PROJECT_ENTERPRISE",
              "PROJECT_TYPE",
              "PROJECTPHASES",
              "TITLE_NUMBERS",
              "PERSON_ABSENCE_REASONS",
              "SALESCHANNEL",
              "PRODUCT_MATERIAL"
            ]
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by specific codelist entry IDs",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodelistBase]"
            }
          }
        }
      }
    },
    "/api/codelist/payment_term": {
      "get": {
        "tags": [
          "Codelist"
        ],
        "summary": "Get all payment terms",
        "description": "Retrieve the full list of payment terms (maksuehdot) with their discount tiers,\r\ncash flow tiers, and due date calculation settings. This endpoint does not accept filters.",
        "operationId": "Codelist_ListPaymentTerms",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PaymentTerm]"
            }
          }
        }
      }
    },
    "/api/codelist/currency": {
      "get": {
        "tags": [
          "Codelist"
        ],
        "summary": "Get all currencies",
        "description": "Retrieve the full list of currencies with their exchange rates. This endpoint does not accept filters.",
        "operationId": "Codelist_ListCurrencies",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Currency]"
            }
          }
        }
      }
    },
    "/api/codelist/expense_group": {
      "put": {
        "tags": [
          "Codelist"
        ],
        "summary": "Update an expense group",
        "description": "Update an existing expense group (kululaji) by its id.",
        "operationId": "Codelist_PutExpenseGroup",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyExpenseGroup",
            "in": "body",
            "description": "The expense group data to update",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ExpenseGroup"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Codelist"
        ],
        "summary": "Create a new expense group",
        "description": "Create a new expense group (kululaji). The id must be unique — if an expense group\r\nwith the given id already exists, the endpoint returns an error.",
        "operationId": "Codelist_PostExpenseGroup",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyExpenseGroup",
            "in": "body",
            "description": "The expense group to create",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ExpenseGroup"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/codelist/absence_reason": {
      "post": {
        "tags": [
          "Codelist"
        ],
        "summary": "Create a new person absence reason from the given description.",
        "operationId": "Codelist_PostAbsenceReason",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "The absence reason to create; only the description is used.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CodeBase"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CodeBase"
            }
          },
          "400": {
            "description": "BadRequest"
          }
        }
      }
    },
    "/api/codelist/expense_group/{expense_group_id}": {
      "delete": {
        "tags": [
          "Codelist"
        ],
        "summary": "Delete an expense group",
        "description": "Soft-delete an expense group (kululaji) by its ID. The expense group is marked as deleted\r\nbut not permanently removed from the database.",
        "operationId": "Codelist_DeleteExpenseGroup",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "expense_group_id",
            "in": "path",
            "description": "The expense group ID to delete",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/codelist/lta": {
      "put": {
        "tags": [
          "Codelist"
        ],
        "summary": "Update an existing LTA dimension",
        "description": "Update an existing LTA (Long Term Agreement) selection-list value identified by its id. The\r\ncode is required and must stay unique — changing it to a code already used by a different LTA\r\nreturns an error. The description and passive flag are updated from the request body.",
        "operationId": "Codelist_PutLta",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyLta",
            "in": "body",
            "description": "The LTA dimension data to update (id identifies the record)",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.LtaDimension"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Codelist"
        ],
        "summary": "Create a new LTA dimension",
        "description": "Create a new LTA (Long Term Agreement / pitkäaikaissopimus) selection-list value. The code is\r\nrequired and must be unique — if an LTA with the given code already exists, the endpoint returns an error.\r\nThe description and passive flag are optional. This uses the same internal creation logic\r\n(LtaDimension) as the purchase order POST endpoint's lta_create extension.",
        "operationId": "Codelist_PostLta",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyLta",
            "in": "body",
            "description": "The LTA dimension to create",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.LtaDimension"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/codelist/product_material": {
      "put": {
        "tags": [
          "Codelist"
        ],
        "summary": "Update a product material",
        "description": "Update an existing product material (tuotemateriaali) by its id.\r\nIf no product material with the given id exists, the endpoint returns an error.",
        "operationId": "Codelist_PutProductMaterial",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyProductMaterial",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProductMaterial"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Codelist"
        ],
        "summary": "Create a new product material",
        "description": "Create a new product material (tuotemateriaali). The id must be unique — if a product material\r\nwith the given id already exists, the endpoint returns an error.",
        "operationId": "Codelist_PostProductMaterial",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyProductMaterial",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProductMaterial"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/codelist/lta/{lta_id}": {
      "delete": {
        "tags": [
          "Codelist"
        ],
        "summary": "Delete an LTA dimension",
        "description": "Delete an LTA (Long Term Agreement) selection-list value by its id. If no LTA with the given id exists,\r\nthe endpoint returns an error.",
        "operationId": "Codelist_DeleteLta",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "lta_id",
            "in": "path",
            "description": "The LTA dimension id to delete",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/codelist/product_material/{product_material_id}": {
      "delete": {
        "tags": [
          "Codelist"
        ],
        "summary": "Delete a product material",
        "description": "Soft-delete a product material (tuotemateriaali) by its ID. The material is marked as deleted\r\nbut not permanently removed from the database.\r\nIf no product material with the given id exists, the endpoint returns an error.",
        "operationId": "Codelist_DeleteProductMaterial",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_material_id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/company": {
      "get": {
        "tags": [
          "Company"
        ],
        "summary": "Get company information",
        "description": "Returns the company's basic information (name, VAT, OVT, GLN) together with all\r\ncompany locations (toimipaikat). Location data includes address, cost center, LTA,\r\nand late payment settings.",
        "operationId": "Company_GetCompany",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Company]"
            }
          }
        }
      }
    },
    "/api/company/locations": {
      "post": {
        "tags": [
          "Company"
        ],
        "summary": "Create a new company location for the active company language.",
        "description": "Persists one companylocations row for the active language, then applies field values from body rows\r\nthat match existing row languages (same flow as LemonOnline CreateCompanyLocation).",
        "operationId": "Company_CreateCompanyLocation",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.CompanyLocationLanguage"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.CompanyLocationLanguage"
              }
            }
          }
        }
      }
    },
    "/api/company/locations/{id}": {
      "put": {
        "tags": [
          "Company"
        ],
        "summary": "Update an existing company location by location_id.",
        "operationId": "Company_UpdateCompanyLocation",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.CompanyLocationLanguage"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.CompanyLocationLanguage"
              }
            }
          },
          "400": {
            "description": "BadRequest"
          }
        }
      }
    },
    "/api/company/locations/{companylocationId}": {
      "delete": {
        "tags": [
          "Company"
        ],
        "summary": "Delete a logical company location and all its language rows by companylocation_id.",
        "description": "Any row id for the location may be passed; CompanyLocation.Update removes every row with the same\r\nlocation_id (same behaviour as LemonOnline DeleteCompanyLocation).",
        "operationId": "Company_DeleteCompanyLocation",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "companylocationId",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "NotFound"
          }
        }
      }
    },
    "/api/company/accounts": {
      "get": {
        "tags": [
          "Company"
        ],
        "summary": "Get company bank accounts used with invoices",
        "description": "Returns the company's bank accounts (pankkitilit) filtered by account type. The\r\n`account_type` filter selects which set of accounts is returned:\r\n            \r\n- **Invoicing** (0, default) — Bank accounts shown on invoices\r\n- **ElectronicInvoicing** (1) — Bank accounts used for electronic invoices (verkkolaskut)\r\n- **Payments** (2) — Bank accounts used for outgoing payments (maksuliikenne)\r\n            \r\nUse this endpoint to populate bank account selections when creating invoices or\r\npayment transactions.",
        "operationId": "Company_GetBankAccounts",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.account_type",
            "in": "query",
            "description": "The bank account type to retrieve. Required. 0 = Invoicing (default), 1 = ElectronicInvoicing, 2 = Payments",
            "required": true,
            "type": "string",
            "enum": [
              "Invoicing",
              "ElectronicInvoicing",
              "Payments"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CompanyAccount]"
            }
          }
        }
      }
    },
    "/api/contacts/{customer_id}": {
      "get": {
        "tags": [
          "Contact"
        ],
        "summary": "List contacts for a customer",
        "description": "Returns a paged list of contact persons (yhteyshenkilöt) for the given customer.\r\nResults can be filtered by name, email, and modification date. The customer must\r\nexist — otherwise the response contains an error.",
        "operationId": "Contact_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id whose contacts are returned",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.name",
            "in": "query",
            "description": "Filter by contact name. Uses a contains match against the contact's name",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.email",
            "in": "query",
            "description": "Filter by contact email. Uses a contains match against the contact's email address",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.modified_before",
            "in": "query",
            "description": "Return only contacts modified before this date/time (default: tomorrow)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.modified_after",
            "in": "query",
            "description": "Return only contacts modified after this date/time (default: 1970-01-01)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CustomerContact]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Contact"
        ],
        "summary": "Create a new contact for a customer",
        "description": "Creates a new contact person for the given customer. The `customer_id` from the route\r\nis used — any value in the payload is overridden. The customer must exist, otherwise\r\nthe response contains the error code `customer_doesnt_exist`.\r\n            \r\nContact attributes can be set via the `attributes` collection — each attribute refers\r\nto a contact attribute setting by id and carries a `selected` flag.",
        "operationId": "Contact_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id that the new contact is created for",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "contact",
            "in": "body",
            "description": "The contact information payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerContact"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/contacts/{contact_id}": {
      "put": {
        "tags": [
          "Contact"
        ],
        "summary": "Update an existing contact",
        "description": "Updates a contact person identified by `contact_id`. The contact must already exist,\r\notherwise the response contains the error code `contact_doesnt_exist`. The `customer_id`\r\nof the contact cannot be changed — if the payload omits it (or sets it to 0) the original\r\ncustomer is preserved.\r\n            \r\nContact attributes in the payload replace the current set of attributes for the contact.",
        "operationId": "Contact_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "description": "The id of the contact to update",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "contact",
            "in": "body",
            "description": "The contact information payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerContact"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers": {
      "get": {
        "tags": [
          "Customer"
        ],
        "summary": "Get a list of customers",
        "description": "Retrieve a paginated list of customers with full details: contacts, attributes, texts,\r\nagreements (with products and recurrence), bank accounts, circulations, and dimension data.\r\n            \r\nUse CustomerFilter to narrow results by name, email, seller, date range, or other criteria.\r\nThe default page size is 10 and can be adjusted with the page_size parameter (max 100).\r\n            \r\n**Filtering by contact information:**\r\nThe contact_email and contact_phone filters search across all of a customer's contacts,\r\nallowing you to find customers by their contact persons' details.\r\n            \r\n**Filtering by attributes:**\r\nUse the attribute_ids filter to find customers that have specific attribute codes set.\r\nFor possible attribute values, refer to GET /api/settings/attribute_customers.\r\n            \r\nFor a lighter response without sub-collections (contacts, agreements, etc.),\r\nuse the /base endpoint instead.",
        "operationId": "Customer_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.name",
            "in": "query",
            "description": "Filter by customer name. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.search_name",
            "in": "query",
            "description": "Filter by customer search name (hakutermi). Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.email",
            "in": "query",
            "description": "Filter by customer email. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.phone",
            "in": "query",
            "description": "Filter by customer phone number. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.contact_email",
            "in": "query",
            "description": "Filter by contact person's email. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.contact_phone",
            "in": "query",
            "description": "Filter by contact person's phone. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.vat",
            "in": "query",
            "description": "Filter by VAT number (Y-tunnus). Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.city",
            "in": "query",
            "description": "Filter by city. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.postal_code",
            "in": "query",
            "description": "Filter by postal code. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.agreement_product",
            "in": "query",
            "description": "Filter by agreement product code. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.modified_before",
            "in": "query",
            "description": "Filter customers modified before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.modified_after",
            "in": "query",
            "description": "Filter customers modified after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.has_email",
            "in": "query",
            "description": "Filter by email existence. 1 = has email, 0 = no email",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.is_customer",
            "in": "query",
            "description": "Filter by customer flag. 1 = is customer, 0 = not customer",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.is_supplier",
            "in": "query",
            "description": "Filter by supplier flag. 1 = is supplier, 0 = not supplier",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.seller_number",
            "in": "query",
            "description": "Filter by seller person number (myyjänumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "Filter by customer numbers. Accepts a list of customer numbers",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.group",
            "in": "query",
            "description": "Filter by customer group number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.type",
            "in": "query",
            "description": "Filter by customer type",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.skip_passive",
            "in": "query",
            "description": "When true, excludes non-active customers from results",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.is_prospect",
            "in": "query",
            "description": "Filter by prospect flag. When set, returns only matching prospect status",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.is_nonactive",
            "in": "query",
            "description": "Filter by non-active flag. When set, returns only matching non-active status",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.created_before",
            "in": "query",
            "description": "Filter customers created before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.created_after",
            "in": "query",
            "description": "Filter customers created after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter customers updated (edit_date) before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter customers updated (edit_date) after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.attribute_ids",
            "in": "query",
            "description": "Filter by customer attribute ids. Returns only customers that have all specified attributes selected",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.hide_models",
            "in": "query",
            "description": "When true, hides model customers (customer_number = 0) from results",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order by id. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Customer]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Customer"
        ],
        "summary": "Create a new customer",
        "description": "Create a new customer with optional contacts, attributes, texts, agreements (with products),\r\nbank accounts, circulations, and dimension data in a single request.\r\n            \r\n**Customer number:**\r\n- Set number to 0 to let the system auto-assign the next available customer number.\r\n- To use a specific number, ensure it does not already exist — the endpoint returns\r\n  HTTP 409 Conflict if the number is already in use.\r\n            \r\n**Contacts:**\r\nEach contact can include contact attributes. The contact's language is validated\r\nagainst the available languages. For valid language codes, refer to /api/settings/languages\r\n[here](#tag/Settings/operation/Settings_GetLanguages)\r\n            \r\n**Agreements:**\r\nAgreements can be created with product lines in the same request.\r\nTo set the recurring invoicing schedule, use the dedicated PUT recurrence endpoint after creation.",
        "operationId": "Customer_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer",
            "in": "body",
            "description": "The customer object to create",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Customer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/base": {
      "get": {
        "tags": [
          "Customer"
        ],
        "summary": "Get a list of customers with basic information only",
        "description": "Retrieve a paginated list of customers with basic header data only.\r\nThis endpoint uses the same filtering as the full customer list but returns a significantly\r\nlighter response without sub-collections such as contacts, agreements, bank accounts, or texts.\r\n            \r\nUse this endpoint when you only need customer names, numbers, and addresses — for example,\r\nwhen populating a customer dropdown or performing a customer search.",
        "operationId": "Customer_ListBase",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.name",
            "in": "query",
            "description": "Filter by customer name. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.search_name",
            "in": "query",
            "description": "Filter by customer search name (hakutermi). Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.email",
            "in": "query",
            "description": "Filter by customer email. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.phone",
            "in": "query",
            "description": "Filter by customer phone number. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.contact_email",
            "in": "query",
            "description": "Filter by contact person's email. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.contact_phone",
            "in": "query",
            "description": "Filter by contact person's phone. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.vat",
            "in": "query",
            "description": "Filter by VAT number (Y-tunnus). Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.city",
            "in": "query",
            "description": "Filter by city. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.postal_code",
            "in": "query",
            "description": "Filter by postal code. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.agreement_product",
            "in": "query",
            "description": "Filter by agreement product code. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.modified_before",
            "in": "query",
            "description": "Filter customers modified before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.modified_after",
            "in": "query",
            "description": "Filter customers modified after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.has_email",
            "in": "query",
            "description": "Filter by email existence. 1 = has email, 0 = no email",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.is_customer",
            "in": "query",
            "description": "Filter by customer flag. 1 = is customer, 0 = not customer",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.is_supplier",
            "in": "query",
            "description": "Filter by supplier flag. 1 = is supplier, 0 = not supplier",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.seller_number",
            "in": "query",
            "description": "Filter by seller person number (myyjänumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "Filter by customer numbers. Accepts a list of customer numbers",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.group",
            "in": "query",
            "description": "Filter by customer group number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.type",
            "in": "query",
            "description": "Filter by customer type",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.skip_passive",
            "in": "query",
            "description": "When true, excludes non-active customers from results",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.is_prospect",
            "in": "query",
            "description": "Filter by prospect flag. When set, returns only matching prospect status",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.is_nonactive",
            "in": "query",
            "description": "Filter by non-active flag. When set, returns only matching non-active status",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.created_before",
            "in": "query",
            "description": "Filter customers created before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.created_after",
            "in": "query",
            "description": "Filter customers created after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter customers updated (edit_date) before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter customers updated (edit_date) after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.attribute_ids",
            "in": "query",
            "description": "Filter by customer attribute ids. Returns only customers that have all specified attributes selected",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.hide_models",
            "in": "query",
            "description": "When true, hides model customers (customer_number = 0) from results",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order by id. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Customer]"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}": {
      "get": {
        "tags": [
          "Customer"
        ],
        "summary": "Get a single customer by id",
        "description": "Retrieve full details for a single customer, including contacts, attributes, texts,\r\nagreements (with products and recurrence schedule), bank accounts, circulations, and dimension data.",
        "operationId": "Customer_Get",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Customer]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Customer"
        ],
        "summary": "Update an existing customer",
        "description": "Update a customer's header data, contacts, attributes, agreements, bank accounts,\r\ncirculations, and dimension data.\r\n            \r\n**Important:** This endpoint updates existing child objects only — it does not create new ones.\r\nOnly child objects (agreements, bank accounts, circulations, contacts) with a matching id\r\nin the payload are updated. To add new child objects, use the dedicated POST endpoints:\r\n- POST /api/customers/{customer_id}/agreements for adding agreements\r\n- POST /api/customers/{customer_id}/accounts for adding bank accounts\r\n- POST /api/customers/{customer_id}/contacts for adding contacts\r\n- POST /api/customers/{customer_id}/circulations for adding circulations\r\n            \r\nThe customer number cannot be changed via update — the original number is always preserved.\r\n            \r\n**Contact attributes:**\r\nContact attributes are toggled via the selected field. Setting selected to true activates\r\nthe attribute, while false deactivates it.",
        "operationId": "Customer_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "customer",
            "in": "body",
            "description": "The customer object with updated data",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Customer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/agreements": {
      "post": {
        "tags": [
          "Customer"
        ],
        "summary": "Add a new agreement to a customer",
        "description": "Add a service agreement (sopimus) to an existing customer. The agreement can include\r\nproduct lines in the same request. The agreement id is auto-assigned by the system.\r\n            \r\nTo set a recurring invoicing schedule for the agreement, use the dedicated\r\nPUT /api/customers/{customer_id}/agreements/{agreement_id}/recurrence endpoint.",
        "operationId": "Customer_AddAgreement",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "agreement",
            "in": "body",
            "description": "The agreement to add",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerAgreement"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/agreements/{agreement_id}/products": {
      "post": {
        "tags": [
          "Customer"
        ],
        "summary": "Add a new product to a customer agreement",
        "description": "Add a product line to an existing agreement. The product id is auto-assigned by the system.\r\nThe agreement must belong to the specified customer.",
        "operationId": "Customer_AddAgreementProduct",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "agreement_id",
            "in": "path",
            "description": "The agreement id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "agreementProduct",
            "in": "body",
            "description": "The agreement product to add",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerAgreementProduct"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/agreements/products/{agreement_product_id}": {
      "delete": {
        "tags": [
          "Customer"
        ],
        "summary": "Delete an agreement product",
        "description": "Remove a product line from a customer agreement.",
        "operationId": "Customer_DeleteAgreementProduct",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "agreement_product_id",
            "in": "path",
            "description": "The agreement product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/agreements/{agreement_id}/recurrence": {
      "put": {
        "tags": [
          "Customer"
        ],
        "summary": "Update a customer agreement's recurrence pattern",
        "description": "Set or update the recurring invoicing schedule (toistuvuus) for an agreement.\r\nThe payload is a LemonsoftTimeSpan object that defines the recurrence interval\r\n(e.g., monthly, quarterly, yearly).\r\n            \r\nThe agreement must belong to the specified customer.",
        "operationId": "Customer_UpdateAgreementRecurrence",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "agreement_id",
            "in": "path",
            "description": "The agreement id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxy",
            "in": "body",
            "description": "The recurrence pattern to set",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.LemonsoftTimeSpan"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/agreements/{agreement_id}": {
      "delete": {
        "tags": [
          "Customer"
        ],
        "summary": "Delete a customer agreement",
        "description": "Remove an agreement and its product lines from a customer.\r\nThe agreement must belong to the specified customer.",
        "operationId": "Customer_DeleteAgreement",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "agreement_id",
            "in": "path",
            "description": "The agreement id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/accounts": {
      "post": {
        "tags": [
          "Customer"
        ],
        "summary": "Add a new bank account to a customer",
        "description": "Add a bank account (pankkitili) to an existing customer. The account id is auto-assigned\r\nby the system. Use this for storing both domestic and foreign bank account details (IBAN, BIC, etc.).",
        "operationId": "Customer_AddAccount",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "account",
            "in": "body",
            "description": "The bank account to add",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerAccount"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/accounts/{account_id}": {
      "delete": {
        "tags": [
          "Customer"
        ],
        "summary": "Delete a customer bank account",
        "description": "Remove a bank account from a customer. The account must belong to the specified customer.",
        "operationId": "Customer_DeleteAccount",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "account_id",
            "in": "path",
            "description": "The account id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/transactions": {
      "get": {
        "tags": [
          "Customer"
        ],
        "summary": "Get a paginated list of CRM transactions",
        "description": "Retrieve a paginated list of CRM transactions (asiakkuustapahtumat) across all customers.\r\nUse CustomerTransactionFilter to narrow results by customer, person, type, state, project,\r\nor date range.\r\n            \r\nEach transaction includes its attributes and participants. For available transaction types,\r\nrefer to /api/settings/crm_types\r\n[here](#tag/Settings/operation/Settings_GetCrmTypes)\r\n            \r\nTo get transactions for a specific customer only, use\r\nGET /api/customers/{customer_id}/transactions instead.",
        "operationId": "Customer_ListTransaction",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.type",
            "in": "query",
            "description": "Filter by transaction type. For possible values, refer to /api/settings/crm_types\r\n[here](#tag/Settings/operation/Settings_GetCrmTypes)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.state",
            "in": "query",
            "description": "Filter by transaction state. For possible values, refer to /api/settings/states/2\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "Filter by customer number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.transaction_date_before",
            "in": "query",
            "description": "Filter transactions with date before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.transaction_date_after",
            "in": "query",
            "description": "Filter transactions with date after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.person_number",
            "in": "query",
            "description": "Filter by creator person number. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.todo_person_number",
            "in": "query",
            "description": "Filter by todo assignee person number. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.project_number",
            "in": "query",
            "description": "Filter by project number. For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.customer_contact_id",
            "in": "query",
            "description": "Filter by customer contact id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "description": "Sort field (database column name). Default is \"transaction_id\". Common values: transaction_id, transaction_date.\r\nFalls back to default if column does not exist.",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CustomerTransaction]"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/transactions": {
      "get": {
        "tags": [
          "Customer"
        ],
        "summary": "Get all CRM transactions for a single customer",
        "description": "Retrieve all CRM transactions for a specific customer. Unlike the global transactions endpoint,\r\nthis returns all transactions without pagination.\r\n            \r\nUse the global GET /api/customers/transactions endpoint when you need filtering and pagination\r\nacross multiple customers.",
        "operationId": "Customer_GetSingleCustomerTransactions",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CustomerTransaction]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Customer"
        ],
        "summary": "Update a CRM transaction",
        "description": "Update an existing CRM transaction's data, attributes, and participants.\r\nThe transaction is identified by the id field in the payload.\r\n            \r\n**Attributes:**\r\n- Setting is_checked = false on an existing attribute removes it from the transaction.\r\n- Setting is_checked = true on a new attribute code adds it to the transaction.\r\n- Only valid attribute codes from the master list are accepted.\r\n            \r\n**Participants:** Existing participants are updated by matching their id.\r\nThis endpoint does not add new participants — to add participants, re-create the transaction\r\nor manage them through the initial POST.",
        "operationId": "Customer_UpdateTransaction",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxytransaction",
            "in": "body",
            "description": "The CRM transaction with updated data",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerTransaction"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Customer"
        ],
        "summary": "Add a new CRM transaction to a customer",
        "description": "Create a CRM transaction (asiakkuustapahtuma) for a customer with optional attributes\r\nand participants in a single request.\r\n            \r\n**Attributes:** Include only the attributes you want to set on the transaction.\r\nOnly attributes with is_checked = true are saved. For available attribute codes,\r\nuse GET /api/customers/transactions/attributes.\r\n            \r\n**Participants:** Each participant represents a person involved in the transaction.\r\nFor available persons, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
        "operationId": "Customer_AddTransaction",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxytransaction",
            "in": "body",
            "description": "The CRM transaction to create",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerTransaction"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/transactions/{transaction_id}": {
      "delete": {
        "tags": [
          "Customer"
        ],
        "summary": "Delete a CRM transaction",
        "description": "Remove a CRM transaction from a customer. The transaction must belong to the specified customer.",
        "operationId": "Customer_DeleteTransaction",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "transaction_id",
            "in": "path",
            "description": "The transaction id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/contacts": {
      "post": {
        "tags": [
          "Customer"
        ],
        "summary": "Add a new contact to a customer",
        "description": "Add a contact person (yhteyshenkilö) to an existing customer with optional contact attributes.\r\nThe contact id is auto-assigned by the system.\r\n            \r\nThe contact's language field is validated against available languages.\r\nFor valid language codes, refer to /api/settings/languages\r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
        "operationId": "Customer_AddContact",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "contact",
            "in": "body",
            "description": "The contact to add",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerContact"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/contacts/{contact_id}": {
      "delete": {
        "tags": [
          "Customer"
        ],
        "summary": "Delete a customer contact",
        "description": "Remove a contact person from a customer. The contact must belong to the specified customer.",
        "operationId": "Customer_DeleteContact",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "contact_id",
            "in": "path",
            "description": "The contact id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/texts": {
      "post": {
        "tags": [
          "Customer"
        ],
        "summary": "Add a new text to a customer",
        "description": "Add a text entry (asiakasteksti) to an existing customer. Customers support up to 10 text entries,\r\neach identified by a unique header_number (1–10).\r\n            \r\nEach header_number can only be used once per customer — if a text with the same header_number\r\nalready exists, the request is rejected. To update existing texts, use the PUT customer endpoint.",
        "operationId": "Customer_AddText",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "text",
            "in": "body",
            "description": "The text entry to add",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerText"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/circulations": {
      "post": {
        "tags": [
          "Customer"
        ],
        "summary": "Add a new circulation to a customer",
        "description": "Add a circulation entry (kierrätys) to an existing customer. Circulations define the inspection\r\nand approval workflow for the customer. The circulation id is auto-assigned by the system.",
        "operationId": "Customer_AddCirculation",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "circulation",
            "in": "body",
            "description": "The circulation entry to add",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerCirculation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/circulations/{circulation_id}": {
      "delete": {
        "tags": [
          "Customer"
        ],
        "summary": "Delete a customer circulation",
        "description": "Remove a circulation entry from a customer. The circulation must belong to the specified customer.",
        "operationId": "Customer_DeleteCirculation",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "circulation_id",
            "in": "path",
            "description": "The circulation id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/customers/groups": {
      "get": {
        "tags": [
          "Customer"
        ],
        "summary": "Get a list of customer groups",
        "description": "Retrieve a paginated list of customer groups (asiakasryhmät). Groups can be organized\r\nhierarchically using the parent_id field, forming a tree structure.\r\n            \r\nUse CustomerGroupFilter to filter by name or parent group.\r\nCustomer groups are used for categorizing and organizing customers for reporting and pricing purposes.",
        "operationId": "Customer_ListGroups",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.name",
            "in": "query",
            "description": "Filter by group name. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.parent_id",
            "in": "query",
            "description": "Filter by parent group id. Use 0 to get only top-level groups",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CustomerGroup]"
            }
          }
        }
      }
    },
    "/api/customers/transactions/attributes": {
      "get": {
        "tags": [
          "Customer"
        ],
        "summary": "Get the master list of CRM transaction attributes",
        "description": "Retrieve the available CRM transaction attribute definitions. These are the master attribute codes\r\nthat can be assigned to individual transactions.\r\n            \r\nUse this endpoint to populate attribute selection when creating or updating CRM transactions.",
        "operationId": "Customer_ListTransactionAttributes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CustomerTransactionAttribute]"
            }
          }
        }
      }
    },
    "/api/customers/{customer_id}/iban-change-history": {
      "get": {
        "tags": [
          "Customer"
        ],
        "summary": "Get IBAN change history for a customer (supplier)",
        "description": "Returns IBAN changes recorded for the customer within the given date range, newest first.\r\n{from} and {to} are interpreted as calendar dates in the\r\ndatabase's local (Finnish) time, matching the wall-clock stored in transaction_date. When omitted,\r\nthe range defaults to the trailing 30 days ending today.",
        "operationId": "Customer_GetIbanChangeHistory",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "description": "The customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive start date (yyyy-MM-dd). Defaults to 30 days before today.",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "to",
            "in": "query",
            "description": "Inclusive end date (yyyy-MM-dd); the whole day is included. Defaults to today.",
            "required": false,
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CustomerIbanChange]"
            }
          }
        }
      }
    },
    "/api/customers/ytj-status/{vat}": {
      "get": {
        "tags": [
          "Customer"
        ],
        "summary": "Get YTJ/PRH status for a VAT (Y-tunnus)",
        "description": "Queries the Finnish Business Information System (YTJ) via Lemonsoft's existing SOAP integration\r\nand returns a flattened status payload. Returns business_id_found = false when YTJ does not recognise the VAT.",
        "operationId": "Customer_GetYtjStatus",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "vat",
            "in": "path",
            "description": "VAT / Y-tunnus to look up",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.CustomerYtjStatus]"
            }
          }
        }
      }
    },
    "/api/edi/confirmpurchaseorder": {
      "post": {
        "tags": [
          "Edi"
        ],
        "summary": "Confirm purchase order",
        "operationId": "Edi_ConfirmPurchaseOrder",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "purchaseOrderConfirmation",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderConfirmation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.EdiReturnCode]"
            }
          }
        }
      }
    },
    "/api/edi/orders": {
      "post": {
        "tags": [
          "Edi"
        ],
        "summary": "Writes sales order from edi messages",
        "operationId": "Edi_EdiOrders",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "EdiOrderList",
            "in": "body",
            "description": "List of salesorders",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.EDI_ArrayofOrder"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.EdiReturnCode]"
            }
          }
        }
      }
    },
    "/api/edi/order_delivery": {
      "post": {
        "tags": [
          "Edi"
        ],
        "summary": "create delivery from edi message",
        "operationId": "Edi_Delivery",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "colEdiDelivery",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.EDI_ArrayOfSalesOrder"
            }
          },
          {
            "name": "HasPallet",
            "in": "query",
            "description": "",
            "required": true,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.EdiReturnCode]"
            }
          }
        }
      }
    },
    "/api/edi/purchaseorder_delivery": {
      "post": {
        "tags": [
          "Edi"
        ],
        "summary": "Create a new purchaseorder delivery",
        "operationId": "Edi_PurchaseOrder_Delivery",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "PurchaseOrderDeliveries",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderDeliveries"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PurchaseOrderDeliveryResponse]"
            }
          }
        }
      }
    },
    "/api/exceptiondays": {
      "post": {
        "tags": [
          "ExceptionDays"
        ],
        "summary": "Creates an exception day.",
        "operationId": "ExceptionDays_CreateExceptionDay",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "The exception day to create.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ExceptionDay"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ExceptionDay"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/api/exceptiondays/{id}": {
      "put": {
        "tags": [
          "ExceptionDays"
        ],
        "summary": "Updates an exception day by id.",
        "operationId": "ExceptionDays_UpdateExceptionDay",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The identifier of the exception day to update.",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxy",
            "in": "body",
            "description": "The exception day values to save.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ExceptionDay"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ExceptionDay"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "ExceptionDays"
        ],
        "summary": "Deletes an exception day by id.",
        "operationId": "ExceptionDays_DeleteExceptionDay",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The identifier of the exception day to delete.",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "NotFound"
          }
        }
      }
    },
    "/api/files": {
      "get": {
        "tags": [
          "File"
        ],
        "summary": "List files from LemonFiles",
        "description": "Returns LemonFiles blob items for a given LemonSoft application context. The response contains metadata only — to download a file, pass the Base64-encoded `name` field to /api/files/azure/url/{azure_blob_name} to get a SAS URI.\r\n            \r\n**Supported `application_id` values:**\r\n            \r\n1 Customer, 2 Product, 3 Person, 4 Invoicing, 5 PLedger, 6 Campaign, 7 Offer, 8 SalesOrder, 9 PurchaseOrder, 11 Payroll, 12 Production, 13 Accounting, 15 Project, 16 ServiceOrder, 17 TravelExpense, 18 CustomerAgreement, 21 Complaints, 22 DeliveryAgreement, 23 Assets, 200 TimeRegistration, 300 CustomerTransaction, 570 AccountStatement.",
        "operationId": "File_GetFiles",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.application_id",
            "in": "query",
            "description": "The LemonSoft application context for the file search (e.g. 1=Customer, 2=Product, 8=SalesOrder — see /api/files for the full list of supported values)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "The identifier of the source record within the application context, such as a sales order number, purchase order number, product code, or offer number",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.AzureBlobItem]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "File"
        ],
        "summary": "Upload a file to LemonFiles",
        "description": "Uploads a single file into the LemonFiles Azure blob container. The file bytes must be Base64-encoded in the payload. The target folder path is created automatically if it does not exist. At least one metadata entry is required — metadata links the file to its LemonSoft application context.\r\n            \r\nFor large files prefer the direct-upload flow via /api/files/azure/uploadurl and /api/files/azure/uploadurl/complete, which avoids streaming the file contents through this API.",
        "operationId": "File_Upload",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "azureBlobItem",
            "in": "body",
            "description": "The upload payload (filename, folder path, metadata, Base64-encoded bytes)",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.AzureBlobItemUpload"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/files/azure/url/{azure_blob_name}": {
      "get": {
        "tags": [
          "File"
        ],
        "summary": "Get a SAS URI for downloading a LemonFiles blob",
        "description": "Returns a time-limited SAS URI that the client can use to download the file directly from Azure blob storage. The `azure_blob_name` path parameter is the `name` field from /api/files, Base64-encoded.",
        "operationId": "File_GetSasUri",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "azure_blob_name",
            "in": "path",
            "description": "The Base64-encoded Azure blob name (the `name` field from /api/files)",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/files/azure/uploadurl": {
      "post": {
        "tags": [
          "File"
        ],
        "summary": "Create an Azure direct-upload URL",
        "description": "Creates a time-limited SAS URI that the client can upload a file directly to, bypassing this API. Use this for large files instead of POST /api/files.\r\n            \r\n**Two-step upload flow:**\r\n1. Call this endpoint with the target `fileName` (including folder path, e.g. \"Customer/123/file.pdf\") to obtain a SAS upload URI.\r\n2. PUT the file bytes to the returned SAS URI directly from the client.\r\n3. Call POST /api/files/azure/uploadurl/complete with the same `fileName` to finalize the upload and register metadata.\r\n            \r\nFile extensions listed in the `lemonfiles_unsupported_extensions` application setting are rejected with HTTP 400.",
        "operationId": "File_CreateUploadUrl",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "The upload target (file path and name)",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.UploadUrl"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/files/azure/uploadurl/complete": {
      "post": {
        "tags": [
          "File"
        ],
        "summary": "Complete a direct upload and register the file in LemonFiles",
        "description": "Finalizes the direct-upload flow started via /api/files/azure/uploadurl. Call this after the client has PUT the file bytes to the SAS URI — this endpoint verifies the blob exists in Azure, creates any missing folder paths, and registers the file's metadata so it becomes visible in LemonFiles.",
        "operationId": "File_SetUploadUrlComplete",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "The file path that was uploaded (same value used with /api/files/azure/uploadurl)",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.UploadUrl"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/files/jobimage/{applicationId}/{dataId}": {
      "get": {
        "tags": [
          "File"
        ],
        "summary": "Get a job image",
        "description": "Returns the job image (työn kuva) stored for a given LemonSoft application record. The image bytes are included in the response as raw bytes.",
        "operationId": "File_GetJobImage",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "description": "The LemonSoft application id (see /api/files for supported values)",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "dataId",
            "in": "path",
            "description": "The id of the source record within the application context",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.JobImage]"
            }
          }
        }
      }
    },
    "/api/files/jobimage": {
      "post": {
        "tags": [
          "File"
        ],
        "summary": "Upload a new job image",
        "description": "Creates a new job image (työn kuva) attached to a LemonSoft application record. This endpoint creates only — it does not update existing images. The payload must have `id = 0`, a non-zero `object_id` (application id) and `data_id` (source record id).",
        "operationId": "File_UploadJobImage",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "The job image payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.JobImage"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/files/worknumber": {
      "get": {
        "tags": [
          "File"
        ],
        "summary": "Download a production image by work number",
        "description": "Downloads a file from the Production folder of LemonFiles (`Production/{work_number}/{filename}`) and returns its contents as a Base64-encoded string. File names are case-sensitive.",
        "operationId": "File_GetFile",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "work_number",
            "in": "query",
            "description": "The production work number (työnumero). Must be greater than 0",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filename",
            "in": "query",
            "description": "The file name within the work number's folder (case-sensitive)",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "File"
        ],
        "summary": "Delete a production image by work number",
        "description": "Deletes a file from the Production folder of LemonFiles (`Production/{work_number}/{filename}`). File names are case-sensitive.",
        "operationId": "File_DeleteFile",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "work_number",
            "in": "query",
            "description": "The production work number (työnumero). Must be greater than 0",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filename",
            "in": "query",
            "description": "The file name within the work number's folder (case-sensitive)",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/files/programimage": {
      "post": {
        "tags": [
          "File"
        ],
        "summary": "Upload a program image",
        "description": "Attaches an image to a program record (ohjelman kuva). The payload must set `object_id`\r\n(the LemonSoft application id — see /api/files for the list of supported values) and\r\n`data_id` (the source record id within that application). The `id` field must be 0;\r\nupdating existing program images is not supported through this endpoint.",
        "operationId": "File_UploadProgramImage",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "The program image payload, including the raw image bytes and metadata",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProgramImage"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/holidays": {
      "post": {
        "tags": [
          "Holidays"
        ],
        "summary": "Creates a public holiday row.",
        "operationId": "Holidays_CreateHoliday",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Holiday"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Holiday"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/api/holidays/{id}": {
      "put": {
        "tags": [
          "Holidays"
        ],
        "summary": "Updates a public holiday by id.",
        "operationId": "Holidays_UpdateHoliday",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxy",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Holiday"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Holiday"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Holidays"
        ],
        "summary": "Deletes a public holiday by id.",
        "operationId": "Holidays_DeleteHoliday",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "NotFound"
          }
        }
      }
    },
    "/api/holidays/import-defaults": {
      "post": {
        "tags": [
          "Holidays"
        ],
        "summary": "Import default Finnish public holidays for a calendar year into the current company database.",
        "operationId": "Holidays_ImportDefaultHolidays",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "iYear",
            "in": "query",
            "description": "Calendar year (e.g. 2026).",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.Holiday"
              }
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/api/invoices": {
      "get": {
        "tags": [
          "Invoice"
        ],
        "summary": "Get a list of invoices",
        "description": "Retrieve a paginated list of sales invoices. The response includes full invoice details:\r\nheader data, all invoice rows with calculated sales prices, payment entries, and external links.\r\n            \r\nUse SalesInvoiceFilter to narrow results by customer, date range, type, or other criteria.\r\nThe default page size is 10 and can be adjusted with the page_size parameter (max 100).\r\n            \r\nThe invoice state is automatically calculated based on the invoice's current status:\r\n- KIRJATTU = Invoice has been recorded\r\n- HYVÄKSYTTY = Invoice has been approved\r\n- LASKUTETTU = Invoice has been sent to the customer\r\n- ERÄÄNTYNYT = Invoice is overdue (past due date and not fully paid)\r\n- SUORITETTU = Invoice has been fully paid\r\n            \r\nTax treatment (tax_treatment) is automatically resolved from the first invoice row's accounting account.\r\nFor possible tax treatment values, refer to /api/codelist/description?filter.codeListFilter=TAXTREATMENT_CODES\r\n[here](#tag/codelist/operation/Codelist_List)\r\n            \r\nSet the include_dimension_descriptions filter to true to populate dimension descriptions on each row:\r\nproject description (project_info.description), lta_description, cost_center_description, and project_phase_description.\r\n            \r\nThe online_url field provides a direct link for viewing the invoice online (e.g., for sending to customers).",
        "operationId": "Invoice_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.numbers",
            "in": "query",
            "description": "Filter by invoice numbers. Accepts a list of invoice numbers",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "Filter by the invoicing customer's number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_customer_number",
            "in": "query",
            "description": "Filter by the delivery customer's number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.type",
            "in": "query",
            "description": "Filter by the invoice type code",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.invoice_date_before",
            "in": "query",
            "description": "Filter invoices with invoice date before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.invoice_date_after",
            "in": "query",
            "description": "Filter invoices with invoice date after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter invoices updated before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter invoices updated after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.has_external_id",
            "in": "query",
            "description": "Filter by whether the invoice has an external id. True = only with external id, false = only without",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.external_id",
            "in": "query",
            "description": "Filter by exact external id value",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.include_dimension_descriptions",
            "in": "query",
            "description": "When set to true, dimension descriptions (project, LTA, cost center, project phase) are included in the response for each invoice row",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.row_project_number",
            "in": "query",
            "description": "Filter by the invoice row's project number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "description": "Sort field (database column name). Default is \"invoice_id\". Common values: invoice_id, invoice_date, invoice_number, invoice_duedate.\r\nFalls back to default if column does not exist.",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Invoice]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Invoice"
        ],
        "summary": "Update an existing invoice",
        "description": "Update an existing sales invoice identified by the id field in the payload.\r\n            \r\n**Important:** This endpoint updates existing rows and payments only — it does not create new ones.\r\nTo add new rows or payments, use the dedicated POST endpoints:\r\n- POST /api/invoices/{id}/row for adding rows\r\n- POST /api/invoices/{id}/payment for adding payments\r\n            \r\nOnly rows, payments, and links with matching id values in the payload are updated.\r\nItems that do not match an existing id are ignored.\r\nSize amounts within rows are also updated by matching size_amount_id.\r\n            \r\nThe customerdata_from_payload and autofill_product fields work the same way as in the create endpoint.",
        "operationId": "Invoice_UpdateInvoice",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyInvoice",
            "in": "body",
            "description": "Invoice payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Invoice"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Invoice"
        ],
        "summary": "Create a new invoice",
        "description": "Create a new sales invoice with optional rows, payments, and links in a single request.\r\nWhen the invoice number is set to 0, the system automatically assigns the next available\r\nnumber based on the invoice type's number series. When a specific number is provided,\r\nit must be unique.\r\n            \r\n**Customer data handling (customerdata_from_payload):**\r\n- When true (default): Customer data from the request payload is used as-is.\r\n- When false: The system retrieves customer data from the customer registry based on\r\n  customer_number, delivery_customer_number, and orderer_customer_number.\r\n  This ensures the invoice always has the latest customer address and contact information.\r\n            \r\n**Currency rate handling (currencyrate_from_payload):**\r\n- When true (default): The currency_rate value from the payload is used.\r\n- When false: The system retrieves the current exchange rate from the currency registry.\r\n  Requires currency_code to be set. To check available currencies, use /api/settings/currency/{code}\r\n  [here](#tag/Settings/operation/Settings_GetCurrency)\r\n            \r\n**Invoice rows:**\r\n- When autofill_product is set to true on a row, the system automatically fills in product data\r\n  (name, price, tax rate, discounts, etc.) from the product registry based on the product_code\r\n  and the invoice's customer_number. Customer-specific pricing is applied when available.\r\n- Rows with size types (sizes) are supported — provide the size amounts in the sizes array.\r\n            \r\n**Invoice type:**\r\n- The type field determines the invoice category (laskulaji).\r\n  Available types can be found via /api/settings/salesorder_numberseries\r\n  [here](#tag/Settings/operation/Settings_GetSalesOrderNumberseries)",
        "operationId": "Invoice_CreateNewInvoice",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyInvoice",
            "in": "body",
            "description": "Invoice payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Invoice"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/invoices/{id}": {
      "get": {
        "tags": [
          "Invoice"
        ],
        "summary": "Get a single invoice by id",
        "description": "Retrieve full details for a single sales invoice, including all rows, payments, and links.\r\n            \r\nThe online_url field is automatically generated and provides a URL for viewing the invoice online.",
        "operationId": "Invoice_Get",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The invoice id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Invoice]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Invoice"
        ],
        "summary": "Delete an invoice",
        "description": "Delete a sales invoice and its associated rows, payments, and links.",
        "operationId": "Invoice_DeleteInvoice",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The invoice id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/invoices/order/{number}": {
      "post": {
        "tags": [
          "Invoice"
        ],
        "summary": "Create a new invoice from a sales order",
        "description": "Create a new sales invoice directly from an existing sales order.\r\n            \r\nThe system automatically:\r\n- Determines the invoice type from the sales order's number series configuration\r\n  (numberserie_salesorder_invoice_type)\r\n- Copies all order data (customer info, rows, delivery details) to the new invoice\r\n- Transfers any documents (LemonFiles) associated with the sales order to the invoice,\r\n  based on the document types configured in function settings\r\n- Sets the invoice date to the current date\r\n            \r\nThe response contains the complete created invoice object with all populated fields.\r\n            \r\nTo check available number series and their invoice types,\r\nuse /api/settings/salesorder_numberseries\r\n[here](#tag/Settings/operation/Settings_GetSalesOrderNumberseries)",
        "operationId": "Invoice_CreateNewInvoiceFromSalesOrder",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "description": "The sales order number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Invoice]"
            }
          }
        }
      }
    },
    "/api/invoices/{id}/row": {
      "post": {
        "tags": [
          "Invoice"
        ],
        "summary": "Create a new invoice row",
        "description": "Add a new row to an existing sales invoice.\r\n            \r\n**autofill_product:** When set to true, the system automatically fills in product data\r\nfrom the product registry based on the product_code and the invoice's customer_number.\r\nThis sets the product name, price, tax rate, discounts, and other product-specific fields.\r\nCustomer-specific pricing is applied when available.\r\n            \r\n**Size types:** If the product has a size type (e.g., clothing sizes) and no sizes are provided\r\nin the payload, the system automatically generates the size amount list from the product's\r\nsize type configuration.\r\n            \r\n**Accounting fields:** The account, cost_center, project_number, project_phase_id, and lta fields\r\ncontrol how the row is posted in accounting.\r\n- For account values: /api/settings/chart_of_accounts [here](#tag/Settings/operation/Settings_GetChartOfAccounts)\r\n- For cost centers: /api/settings/costcenters [here](#tag/Settings/operation/Settings_GetCostCenters)\r\n- For projects: /api/projects [here](#tag/projects/operation/Project_List)\r\n- For LTA codes: /api/settings/ltas [here](#tag/Settings/operation/Settings_GetLtas)",
        "operationId": "Invoice_CreateNewInvoiceRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The invoice id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyInvoiceRow",
            "in": "body",
            "description": "Invoice row payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.InvoiceRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/invoices/{id}/payment": {
      "post": {
        "tags": [
          "Invoice"
        ],
        "summary": "Create a new invoice payment",
        "description": "Record a payment against an existing sales invoice.\r\n            \r\n**processCashDiscount parameter (optional, query string):**\r\nWhen set to true, the system automatically handles cash discount processing after the payment is recorded.\r\nThis covers two scenarios:\r\n1) **Early-payment discount (käteisalennus):** If the payment is made before the invoice's cash_date\r\n   (cash discount deadline), and the remaining open balance is within the ACCEPT_DIFFERENCE tolerance,\r\n   the system automatically posts a cash discount entry to close the invoice.\r\n2) **Rounding difference (pyöristysero):** When settling an invoice in cash, small cent-level\r\n   differences within the ACCEPT_DIFFERENCE tolerance are automatically posted as cash discounts.\r\n            \r\nThe cash discount is posted to the customer's sales discount account (if configured),\r\nor to the system's default sales discount account (function setting ACCOUNT_SALES_DISC).\r\n            \r\n**Payment accounting fields:**\r\n- accountlist_account: For values, see /api/settings/chart_of_accounts [here](#tag/Settings/operation/Settings_GetChartOfAccounts)\r\n- costcenter_code: For values, see /api/settings/costcenters [here](#tag/Settings/operation/Settings_GetCostCenters)",
        "operationId": "Invoice_CreateNewInvoicePayment",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The invoice id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyInvoicePayment",
            "in": "body",
            "description": "Invoice payment payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.InvoicePayment"
            }
          },
          {
            "name": "processCashDiscount",
            "in": "query",
            "description": "Optional. When true, automatically processes cash discount if applicable",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/invoices/{id}/row/{row_id}": {
      "delete": {
        "tags": [
          "Invoice"
        ],
        "summary": "Delete an invoice row",
        "description": "Remove a row from an existing sales invoice.",
        "operationId": "Invoice_DeleteInvoiceRow",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The invoice id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "row_id",
            "in": "path",
            "description": "The invoice row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/invoices/{id}/payment/{payment_id}": {
      "delete": {
        "tags": [
          "Invoice"
        ],
        "summary": "Delete an invoice payment",
        "description": "Remove a payment entry from an existing sales invoice.",
        "operationId": "Invoice_DeletePaymentRow",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The invoice id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "payment_id",
            "in": "path",
            "description": "The invoice payment id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/invoices/{id}/link": {
      "post": {
        "tags": [
          "Invoice"
        ],
        "summary": "Add an external link to an invoice",
        "description": "Attach an external resource (URL, file path, or reference) to an existing sales invoice.\r\nThe link's application_id is automatically set to the invoicing application.",
        "operationId": "Invoice_CreateLink",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The invoice id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyLink",
            "in": "body",
            "description": "Invoice link payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/invoices/{id}/link/{link_id}": {
      "delete": {
        "tags": [
          "Invoice"
        ],
        "summary": "Delete a link from an invoice",
        "description": "Remove an external link from a sales invoice.",
        "operationId": "Invoice_DeleteLink",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The invoice id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "link_id",
            "in": "path",
            "description": "The link id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/log/deleted": {
      "get": {
        "tags": [
          "Log"
        ],
        "summary": "List IDs of deleted objects from the audit log",
        "description": "Returns a paginated list of identifiers for objects that have been deleted within the requested log type and date range.\r\nUseful for synchronising external systems by detecting which records have been removed since the last poll.\r\n            \r\n**Date range:** Each date is defaulted independently — if `startDate` is omitted it falls back to one year before the current date, and if `endDate` is omitted it falls back to the current date.\r\nIf `endDate` is provided as a date with no time component, it is automatically extended to the end of that day.\r\n            \r\n**Worktime log type:** When `logType` is `Worktime` (253), the data is sourced from the worktime history table instead of the generic log records.\r\nFor this log type the `description`, `data1`, and `data2` fields of each event are always returned as `null`.\r\n            \r\n**Possible values for logType:**\r\n<list type=\"bullet\"><item><description>Customer = 1, </description></item><item><description>Product = 2, </description></item><item><description>Person = 3, </description></item><item><description>Invoicing = 4, </description></item><item><description>PLedger = 5, </description></item><item><description>Campaign = 6, </description></item><item><description>Offer = 7, </description></item><item><description>SalesOrder = 8, </description></item><item><description>PurchaseOrder = 9, </description></item><item><description>CashRegister = 10, </description></item><item><description>Payroll = 11, </description></item><item><description>Production = 12, </description></item><item><description>Accounting = 13, </description></item><item><description>AccountList = 14, </description></item><item><description>Project = 15, </description></item><item><description>ServiceOrder = 16, </description></item><item><description>TravelExpense = 17, </description></item><item><description>CustomerAgreement = 18, </description></item><item><description>Complaints = 21, </description></item><item><description>Assets = 23, </description></item><item><description>NumberSeries = 57, </description></item><item><description>FormOfSalaries = 63, </description></item><item><description>Pricelist = 75, </description></item><item><description>TimeRegistration = 200, </description></item><item><description>HRCalendar = 212, </description></item><item><description>Worktime = 253, </description></item><item><description>CustomerTransaction = 300, </description></item><item><description>ExpenseInvoice = 400, </description></item><item><description>eKuittiLemon = 402, </description></item><item><description>AccountStatement = 570, </description></item><item><description>ProjectPhase = 17000, </description></item><item><description>ShiftPlanning = 17005, </description></item><item><description>Kellokortti2 = 20000</description></item></list>",
        "operationId": "Log_GetDeletedIds",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "logType",
            "in": "query",
            "description": "The domain of the log to query. See remarks for the full list of values",
            "required": true,
            "type": "string",
            "enum": [
              "Lemonsoft",
              "Customer",
              "Product",
              "Person",
              "Invoicing",
              "PLedger",
              "Campaign",
              "Offer",
              "SalesOrder",
              "PurchaseOrder",
              "CashRegister",
              "Payroll",
              "Production",
              "Accounting",
              "AccountList",
              "Project",
              "ServiceOrder",
              "TravelExpense",
              "CustomerAgreement",
              "PurchaceinvoicingCirculation",
              "TravelExpenseCirculation",
              "Complaints",
              "DeliveryAgreement",
              "Assets",
              "SalesOrderDelivery",
              "SalaryCirculation",
              "PurchaseInvoiceCirculationSmart",
              "AccountingCirculation",
              "SalaryCirculationSmart",
              "TaxFormAttachment",
              "PurchaseOrderDelivery",
              "OfferDecision",
              "AccountingArchive",
              "InvoicePayment",
              "NumberSeries",
              "FormOfSalaries",
              "Pricelist",
              "TimeRegistration",
              "CustomerList",
              "CustomerCentrum",
              "TransactionCentrum",
              "ProductCentrum",
              "SalesLedgerCentrum",
              "InvoicingCentrum",
              "ReferencePayments",
              "PurchaseInvoicePayments",
              "ProductList",
              "ProjectCentrum",
              "OfferCentrum",
              "HRCalendar",
              "Timestamp",
              "PersonSkillProfile",
              "PurchaseInvoiceImportedImages",
              "HRCalendarAcceptance",
              "PurchaseInvoiceHubZips",
              "IncomeRegisterSending",
              "Worktime",
              "CustomerTransaction",
              "Calendar",
              "CustomerTransactionList",
              "ExpenseInvoice",
              "eKuittiLemon",
              "eKuittiLemonAccountStatement",
              "AccountStatement",
              "MultiBank",
              "CompanyPayments",
              "LemonFiles",
              "Initiatives",
              "LoyalityHandling",
              "SalesOrderCentrum",
              "Consignment",
              "SSCC",
              "PurchaseOrderCentrum",
              "SupplierPortalCentrum",
              "FeedbackCentre",
              "Feedback",
              "DevelopmentIdea",
              "CustomerHistory",
              "BalanceOfAccount",
              "BalanceofAccountSupplier",
              "PurchaseInvoiceFinvoiceImport",
              "PurchaseInvoiceCentrum",
              "ProductBatchHandling",
              "ProductStructure",
              "StockCollectJobs",
              "ProductDevice",
              "PalletHandling",
              "ProductionJobList",
              "ProductionList",
              "ProductionStatus",
              "ProductionGANTT",
              "ProductionBatchPlanning",
              "ProductionStandars",
              "ProductionComplaints",
              "ProductionJobDone",
              "SSRSReports",
              "MachineHistory",
              "Worknumbers",
              "ResourceHandling",
              "ResourcePlanning",
              "LemonShop",
              "CollectJobs",
              "ProjectEnterpriseSearch",
              "WorktimeRegulation",
              "Fee",
              "ProjectPhase",
              "WorkHour",
              "PreOrderInfo",
              "WorkHourMaterial",
              "WorkTimeMaterial",
              "ShiftPlanning",
              "ShiftPlanningProposedShifts",
              "ShiftPlanningFreeShifts",
              "Kellokortti2",
              "eKuittiMobile",
              "SalaryChangeEvent",
              "ProjectBudgetVersions",
              "ProjectPredictionVersions"
            ]
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Inclusive lower bound for the deletion timestamp. Defaults to one year before the current date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "Inclusive upper bound for the deletion timestamp. Defaults to the current date. Date-only values are extended to end-of-day",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[System.Int32]"
            }
          }
        }
      }
    },
    "/api/log/deletion_events": {
      "get": {
        "tags": [
          "Log"
        ],
        "summary": "List deletion events from the audit log with full details",
        "description": "Returns a paginated list of deletion events for the requested log type and date range. Each entry contains the\r\ndeleted object's identifier, the deletion timestamp, a description, and supplementary context fields (`data1`, `data2`)\r\nwhose content depends on the log type.\r\n            \r\nUse this endpoint instead of `/api/log/deleted` when the consumer needs the deletion metadata in addition to the IDs.\r\n            \r\n**Date range:** Each date is defaulted independently — if `startDate` is omitted it falls back to one year before the current date, and if `endDate` is omitted it falls back to the current date.\r\nIf `endDate` is provided as a date with no time component, it is automatically extended to the end of that day.\r\n            \r\n**Worktime log type:** When `logType` is `Worktime` (253), the data is sourced from the worktime history table instead of the generic log records.\r\nFor this log type the `description`, `data1`, and `data2` fields of each event are always returned as `null`.\r\n            \r\n**Possible values for logType:**\r\n<list type=\"bullet\"><item><description>Customer = 1, </description></item><item><description>Product = 2, </description></item><item><description>Person = 3, </description></item><item><description>Invoicing = 4, </description></item><item><description>PLedger = 5, </description></item><item><description>Campaign = 6, </description></item><item><description>Offer = 7, </description></item><item><description>SalesOrder = 8, </description></item><item><description>PurchaseOrder = 9, </description></item><item><description>CashRegister = 10, </description></item><item><description>Payroll = 11, </description></item><item><description>Production = 12, </description></item><item><description>Accounting = 13, </description></item><item><description>AccountList = 14, </description></item><item><description>Project = 15, </description></item><item><description>ServiceOrder = 16, </description></item><item><description>TravelExpense = 17, </description></item><item><description>CustomerAgreement = 18, </description></item><item><description>Complaints = 21, </description></item><item><description>Assets = 23, </description></item><item><description>NumberSeries = 57, </description></item><item><description>FormOfSalaries = 63, </description></item><item><description>Pricelist = 75, </description></item><item><description>TimeRegistration = 200, </description></item><item><description>HRCalendar = 212, </description></item><item><description>Worktime = 253, </description></item><item><description>CustomerTransaction = 300, </description></item><item><description>ExpenseInvoice = 400, </description></item><item><description>eKuittiLemon = 402, </description></item><item><description>AccountStatement = 570, </description></item><item><description>ProjectPhase = 17000, </description></item><item><description>ShiftPlanning = 17005, </description></item><item><description>Kellokortti2 = 20000</description></item></list>",
        "operationId": "Log_GetDeleteEvents",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "logType",
            "in": "query",
            "description": "The domain of the log to query. See remarks for the full list of values",
            "required": true,
            "type": "string",
            "enum": [
              "Lemonsoft",
              "Customer",
              "Product",
              "Person",
              "Invoicing",
              "PLedger",
              "Campaign",
              "Offer",
              "SalesOrder",
              "PurchaseOrder",
              "CashRegister",
              "Payroll",
              "Production",
              "Accounting",
              "AccountList",
              "Project",
              "ServiceOrder",
              "TravelExpense",
              "CustomerAgreement",
              "PurchaceinvoicingCirculation",
              "TravelExpenseCirculation",
              "Complaints",
              "DeliveryAgreement",
              "Assets",
              "SalesOrderDelivery",
              "SalaryCirculation",
              "PurchaseInvoiceCirculationSmart",
              "AccountingCirculation",
              "SalaryCirculationSmart",
              "TaxFormAttachment",
              "PurchaseOrderDelivery",
              "OfferDecision",
              "AccountingArchive",
              "InvoicePayment",
              "NumberSeries",
              "FormOfSalaries",
              "Pricelist",
              "TimeRegistration",
              "CustomerList",
              "CustomerCentrum",
              "TransactionCentrum",
              "ProductCentrum",
              "SalesLedgerCentrum",
              "InvoicingCentrum",
              "ReferencePayments",
              "PurchaseInvoicePayments",
              "ProductList",
              "ProjectCentrum",
              "OfferCentrum",
              "HRCalendar",
              "Timestamp",
              "PersonSkillProfile",
              "PurchaseInvoiceImportedImages",
              "HRCalendarAcceptance",
              "PurchaseInvoiceHubZips",
              "IncomeRegisterSending",
              "Worktime",
              "CustomerTransaction",
              "Calendar",
              "CustomerTransactionList",
              "ExpenseInvoice",
              "eKuittiLemon",
              "eKuittiLemonAccountStatement",
              "AccountStatement",
              "MultiBank",
              "CompanyPayments",
              "LemonFiles",
              "Initiatives",
              "LoyalityHandling",
              "SalesOrderCentrum",
              "Consignment",
              "SSCC",
              "PurchaseOrderCentrum",
              "SupplierPortalCentrum",
              "FeedbackCentre",
              "Feedback",
              "DevelopmentIdea",
              "CustomerHistory",
              "BalanceOfAccount",
              "BalanceofAccountSupplier",
              "PurchaseInvoiceFinvoiceImport",
              "PurchaseInvoiceCentrum",
              "ProductBatchHandling",
              "ProductStructure",
              "StockCollectJobs",
              "ProductDevice",
              "PalletHandling",
              "ProductionJobList",
              "ProductionList",
              "ProductionStatus",
              "ProductionGANTT",
              "ProductionBatchPlanning",
              "ProductionStandars",
              "ProductionComplaints",
              "ProductionJobDone",
              "SSRSReports",
              "MachineHistory",
              "Worknumbers",
              "ResourceHandling",
              "ResourcePlanning",
              "LemonShop",
              "CollectJobs",
              "ProjectEnterpriseSearch",
              "WorktimeRegulation",
              "Fee",
              "ProjectPhase",
              "WorkHour",
              "PreOrderInfo",
              "WorkHourMaterial",
              "WorkTimeMaterial",
              "ShiftPlanning",
              "ShiftPlanningProposedShifts",
              "ShiftPlanningFreeShifts",
              "Kellokortti2",
              "eKuittiMobile",
              "SalaryChangeEvent",
              "ProjectBudgetVersions",
              "ProjectPredictionVersions"
            ]
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Inclusive lower bound for the deletion timestamp. Defaults to one year before the current date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "Inclusive upper bound for the deletion timestamp. Defaults to the current date. Date-only values are extended to end-of-day",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.LogDeleteEvent]"
            }
          }
        }
      }
    },
    "/api/message": {
      "post": {
        "tags": [
          "Message"
        ],
        "summary": "Sends an internal message and/or email to recipients by role.",
        "description": "Sends a role-based message by using Lemonsoft message handling.\r\n            \r\nThe message is delivered to persons that have the given role. If the role has\r\na restricted recipient list configured in person attributes, only those persons\r\nreceive the message.\r\n            \r\nThe system can send the same message through one or both channels:\r\n- send_internal_message = true creates an internal Lemonsoft message\r\n- send_email = true sends an email notification to matching recipients that have an email address\r\n            \r\nAt least one delivery channel must be selected. If send_internal_message is not provided,\r\nit defaults to true.\r\n            \r\nThe function_id field is stored as the message application data id and can be used\r\nto identify the related Lemonsoft function context.",
        "operationId": "Message_Send",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "message",
            "in": "body",
            "description": "Message details.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Message"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/numberseries": {
      "get": {
        "tags": [
          "NumberSeries"
        ],
        "summary": "Get number series by category",
        "description": "Returns the available number series for the requested category. The NumberSeries enum value\r\nin the filter is required — without it the endpoint returns BadRequest.\r\n            \r\nThe enum value determines which source library is queried:\r\n- Invoice (1) — sales invoice number series\r\n- PurchaseInvoice (2) — purchase invoice number series\r\n- Product (3) — product number series\r\n- Project (4) — project number series",
        "operationId": "NumberSeries_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.numberSeries",
            "in": "query",
            "description": "The number series category to fetch (required). Determines which source library is queried:\r\nInvoice (1) → sales invoice number series, PurchaseInvoice (2) → purchase invoice number series,\r\nProduct (3) → product number series, Project (4) → project number series",
            "required": true,
            "type": "string",
            "enum": [
              "Invoice",
              "PurchaseInvoice",
              "Product",
              "Project"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.NumberSeriesBase]"
            }
          }
        }
      }
    },
    "/api/offers/{offerType}": {
      "post": {
        "tags": [
          "Offer"
        ],
        "summary": "Create an offer",
        "description": "Creates a new empty offer of the given type. Use the PUT and POST offerrow endpoints to populate the header and rows.",
        "operationId": "Offer_Create",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "offerType",
            "in": "path",
            "description": "The offer type to create",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Offer"
            }
          }
        }
      }
    },
    "/api/offers/{offerNumber}": {
      "get": {
        "tags": [
          "Offer"
        ],
        "summary": "Get an offer",
        "description": "Returns a single offer with its rows, sales phase information, and computed profit. When `version` is supplied, that specific version of the offer is returned; otherwise the newest version is returned.",
        "operationId": "Offer_Get",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "offerNumber",
            "in": "path",
            "description": "The offer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "version",
            "in": "query",
            "description": "Optional version string (e.g. \"A\"). Defaults to the newest version",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Offer"
            }
          }
        }
      }
    },
    "/api/offers": {
      "get": {
        "tags": [
          "Offer"
        ],
        "summary": "Get a paged list of offers",
        "description": "Returns offers matching the supplied filter. By default only the newest version of each offer is returned — set `include_old_versions=true` to include all versions. Note: state and action_date filters are applied via the `v_offer_all` view and have no effect when `include_old_versions=true`.",
        "operationId": "Offer_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "Filter offers by invoicing customer number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_customer_number",
            "in": "query",
            "description": "Filter offers by delivery customer number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.offer_date_before",
            "in": "query",
            "description": "Filter offers whose offer date is on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.offer_date_after",
            "in": "query",
            "description": "Filter offers whose offer date is on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter offers whose updated_at is on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter offers whose updated_at is on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.include_old_versions",
            "in": "query",
            "description": "When true, returns all offer versions (not just the newest). State and action_date filters have no effect when this is true",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.offer_numbers",
            "in": "query",
            "description": "Filter offers by one or more specific offer numbers",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.has_external_id",
            "in": "query",
            "description": "When true, only offers with an external_id are returned; when false, only offers without one",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.external_id",
            "in": "query",
            "description": "Filter by a specific external_id value",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.seller_number",
            "in": "query",
            "description": "Filter offers by seller person number. Supports multiple values.\r\nOmit or leave empty to disable the filter.",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.state",
            "in": "query",
            "description": "Filter offers by state (tila). Values: 0 = open (kesken), 1 = waiting (odottaa),\r\n2 = lost (menetetty), 3 = won (kauppa). Multiple states may be provided.\r\nNote: state filter is applied via the v_offer_all view and therefore has no effect\r\nwhen include_old_versions=true.",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.action_date_before",
            "in": "query",
            "description": "Filter offers by the state action date upper bound (offer_action_date: won/lost/wait date\r\nof the current state). Omit to disable. Applied via the v_offer_all view — no effect\r\nwhen include_old_versions=true. Offers with no action date (open) are excluded.",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.action_date_after",
            "in": "query",
            "description": "Filter offers by the state action date lower bound (offer_action_date: won/lost/wait date\r\nof the current state). Omit to disable. Applied via the v_offer_all view — no effect\r\nwhen include_old_versions=true. Offers with no action date (open) are excluded.",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "description": "Sort field (database column name). Default is \"offer_date\". Common values: offer_id, offer_date, offer_number, offer_last_deadline.\r\nFalls back to default if column does not exist.",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Offer]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Offer"
        ],
        "summary": "Update an offer",
        "description": "Updates header data and existing rows on an offer. To add new rows, use POST `/{offerNumber}/offerrows` or POST `/{offerNumber}/offerrowlist`. To remove rows, use the matching DELETE endpoints.",
        "operationId": "Offer_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyOffer",
            "in": "body",
            "description": "A offer",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Offer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/offers/{offerNumber}/offerrows": {
      "put": {
        "tags": [
          "Offer"
        ],
        "summary": "Update a row on an offer",
        "description": "Updates an existing row identified by `id` on the payload. Does not create new rows — use POST endpoints to add rows.",
        "operationId": "Offer_UpdateOfferRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "offerNumber",
            "in": "path",
            "description": "offer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyOfferRow",
            "in": "body",
            "description": "offerrow",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.OfferRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Offer"
        ],
        "summary": "Add a row to an offer",
        "description": "Creates a single new row on the offer. When `productdata_from_payload=false`, the product data is resolved from the product registry by product_code and quantity; otherwise the data from the payload is used as-is.",
        "operationId": "Offer_CreateOfferRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "offerNumber",
            "in": "path",
            "description": "offer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyOfferRow",
            "in": "body",
            "description": "offerrow",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.OfferRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Offer"
        ],
        "summary": "Delete a row from an offer",
        "operationId": "Offer_DeleteOfferRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "offerNumber",
            "in": "path",
            "description": "offer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyOfferRow",
            "in": "body",
            "description": "offerrow",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.OfferRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/offers/{offerNumber}/offerrowlist": {
      "put": {
        "tags": [
          "Offer"
        ],
        "summary": "Update multiple rows on an offer",
        "description": "Bulk variant of PUT `/{offerNumber}/offerrows`. Each entry must include its `id`. Rows not present in the payload are left untouched.",
        "operationId": "Offer_UpdateOfferRows",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "offerNumber",
            "in": "path",
            "description": "offer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyOfferRows",
            "in": "body",
            "description": "List of offerrows",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.OfferRow"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Offer"
        ],
        "summary": "Add multiple rows to an offer",
        "description": "Bulk variant of POST `/{offerNumber}/offerrows`. Each row honors its own `productdata_from_payload` setting.",
        "operationId": "Offer_CreateOfferRows",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "offerNumber",
            "in": "path",
            "description": "offer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyOfferRows",
            "in": "body",
            "description": "List of offerrows",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.OfferRow"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Offer"
        ],
        "summary": "Delete multiple rows from an offer by their ids",
        "operationId": "Offer_DeleteOfferRows",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "offerNumber",
            "in": "path",
            "description": "offer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "offerRowIds",
            "in": "body",
            "description": "List of offerrow Ids",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "format": "int32",
                "type": "integer"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/offers/{offerNumber}/links": {
      "post": {
        "tags": [
          "Offer"
        ],
        "summary": "Add an external link to an offer",
        "operationId": "Offer_CreateLink",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "offerNumber",
            "in": "path",
            "description": "Offer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "link",
            "in": "body",
            "description": "Offer link payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/offers/{offerNumber}/links/{link_id}": {
      "delete": {
        "tags": [
          "Offer"
        ],
        "summary": "Delete an external link from an offer",
        "operationId": "Offer_DeleteLink",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "offerNumber",
            "in": "path",
            "description": "Offer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "link_id",
            "in": "path",
            "description": "Id of link",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/offers/salesPhaseCollections": {
      "get": {
        "tags": [
          "Offer"
        ],
        "summary": "Get sales phase collections",
        "description": "Returns every sales phase collection (myyntivaihekokoelma) with its sales phases. Use this when populating a sales-phase dropdown for offers.",
        "operationId": "Offer_GetSalesPhaseCollectionList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesPhaseCollection]"
            }
          }
        }
      }
    },
    "/api/orders": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get a list of orders",
        "operationId": "Order_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.type",
            "in": "query",
            "description": "Specifies the sales order type (laji). For possible values and descriptions, see /api/settings/salesorder_numberseries salesorder_type\r\n[here](#tag/Settings/operation/Settings_GetSalesOrderNumberseries)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.state",
            "in": "query",
            "description": "Specifies the sales order state (tila). For possible values and descriptions, see /api/settings/states/2\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "The billing customer’s number in the sales order (laskutusasiakkaan numero)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_customer_number",
            "in": "query",
            "description": "The delivery customer’s number in the sales order (toimitusasiakkaan numero)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.orderer_customer_number",
            "in": "query",
            "description": "The orderer customer’s number in the sales order (tilaajasasiakkaan numero)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.consignee_customer_number",
            "in": "query",
            "description": "The consignee customer’s number in the sales order (vastaanottajasasiakkaan numero)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.order_numbers",
            "in": "query",
            "description": "The sales order number (myyntitilauksen numero). May include multiple numbers.",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.ordered_before",
            "in": "query",
            "description": "The date/time before which the sales order was ordered (tilattu ennen).",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.ordered_after",
            "in": "query",
            "description": "The date/time after which the sales order was ordered (tilattu jälkeen).",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "The date/time before which the sales order was modified (muokattu ennen)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "The date/time after which the sales order was modified (muokattu jälkeen)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.only_allowed_types",
            "in": "query",
            "description": "Filters out sales orders to which the user does not have access by type.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.skip_service",
            "in": "query",
            "description": "Skip service orders in query. Service orders are orders with type less than 200.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.only_service",
            "in": "query",
            "description": "Only service orders in query. Service order are orders with type equal or greater than 200.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order by id. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.product_code",
            "in": "query",
            "description": "Search sales order by product code (tuotekoodi, sku)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.customer_ordernumber",
            "in": "query",
            "description": "Search sales order by customer order number (tilausnumeronne)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.seller_number",
            "in": "query",
            "description": "Search sales order by seller number (myyjä)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.only_models",
            "in": "query",
            "description": "Search only for sales order base models (mallipohjat). These are sales orders where sales_order_number is less than 0",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.service_order_serial",
            "in": "query",
            "description": "Search service order by service order serial (huoltotilauksen sarjanumero)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.service_order_product_code",
            "in": "query",
            "description": "Search service order by service order product code (huoltotilauksen tuotekoodi)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.project_number",
            "in": "query",
            "description": "Search order by project number (projektin numero). Use project_number = -1 to disable search by project number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.SalesOrder]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Order"
        ],
        "summary": "Update order",
        "operationId": "Order_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyOrder",
            "in": "body",
            "description": "Order payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrder"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Create an order",
        "operationId": "Order_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order",
            "in": "body",
            "description": "SalesOrder payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrder"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/orders/delivery/{delivery_id}": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Returns order's delivery info with corresponding delivery info id",
        "operationId": "Order_ReadDelivery",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "delivery_id",
            "in": "path",
            "description": "Delivery id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.SalesOrderDeliveryInfoFull]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/delivery": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Returns order's deliveries with corresponding order id",
        "operationId": "Order_ReadDeliveryByOrderId",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Collections.Generic.List[LemonRest.Models.Proxy.SalesOrderDeliveryInfoFull]]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/predelivery": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Creates pre delivery info for order",
        "operationId": "Order_CreatePreDelivery",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "calculate_amounts",
            "in": "query",
            "description": "recalculates amounts",
            "required": true,
            "type": "boolean"
          },
          {
            "name": "delivery",
            "in": "body",
            "description": "delivery model",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.OrderPreDeliveryInfo"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Int32]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/status": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get order status",
        "operationId": "Order_GetOrderStatus",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "SalesOrder id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.StatusResponse"
            }
          }
        }
      }
    },
    "/api/orders/{order_number}/preinvoicing": {
      "put": {
        "tags": [
          "Order"
        ],
        "summary": "Updates preinvoicing information for a sales order.\r\nCalculates the preinvoice amount based on the order's tax type and total sum,\r\nusing either the provided percent or the preinvoice product's price as a fallback.",
        "operationId": "Order_SetOrderPreInvoicing",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "description": "Sales order number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPreInvoicingInfo",
            "in": "body",
            "description": "Preinvoicing information containing percent, description and note",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderPreInvoicingInfo"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Creates a preinvoice for the sales order based on the given preinvoicing information and marks the order to be preinvoiced.\r\nValidates that the order has not already been preinvoiced or invoiced, calculates the preinvoice amount\r\nbased on the order's tax type, and creates the invoice using the configured preinvoice product.",
        "operationId": "Order_CreateOrderPreInvoicing",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "description": "Sales order number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPreInvoicingInfo",
            "in": "body",
            "description": "Preinvoicing information containing percent, description, note and invoiced flag",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderPreInvoicingCreateInfo"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get order",
        "operationId": "Order_Get",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "A order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "prepare_delivery",
            "in": "query",
            "description": "Prepare order for the delivery or not",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "get_row_shelves",
            "in": "query",
            "description": "Should selectable shelves for pallet picking be included for each row or not. Default false.",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.SalesOrder]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Order"
        ],
        "summary": "Delete order",
        "operationId": "Order_Delete",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Order's id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/orders/work/{work_number}": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get order based on the work number",
        "operationId": "Order_GetByWorknumber",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "work_number",
            "in": "path",
            "description": "Work number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.SalesOrder]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/row": {
      "put": {
        "tags": [
          "Order"
        ],
        "summary": "Update order row",
        "operationId": "Order_UpdateRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyOrderRow",
            "in": "body",
            "description": "Order row",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Create new order row",
        "operationId": "Order_CreateRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyOrderRow",
            "in": "body",
            "description": "Order row",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/row/{product_code}/{amount}/{unit_id}": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get body of order row",
        "operationId": "Order_CreateOrderRowBody",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "amount",
            "in": "path",
            "description": "Amount",
            "required": true,
            "type": "number",
            "format": "double"
          },
          {
            "name": "unit_id",
            "in": "path",
            "description": "Product unit id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.SalesOrderRow]"
            }
          }
        }
      }
    },
    "/api/orders/row_changed": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Get body of row after changed values.",
        "operationId": "Order_rowManagement",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "changedRowProxy",
            "in": "body",
            "description": "Proxy model for changed row",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRowChange"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesOrderRow]"
            }
          }
        }
      }
    },
    "/api/orders/rows_changed_batch": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Performs row management (price calculation, product data lookup, etc.) for multiple rows in a single request.\r\nEquivalent to calling row_changed for each row individually, but shares order context, customer data and product cache across all rows.",
        "operationId": "Order_RowManagementBatch",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "description": "Batch request containing common order-level fields and a list of row changes to process",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRowChangeBatch"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesOrderRow]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/row/{row_id}": {
      "delete": {
        "tags": [
          "Order"
        ],
        "summary": "Delete order row",
        "operationId": "Order_DeleteRow",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "row_id",
            "in": "path",
            "description": "Row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/row/{row_id}/serials": {
      "put": {
        "tags": [
          "Order"
        ],
        "summary": "Set serial numbers to row",
        "operationId": "Order_SetRowSerials",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "row_id",
            "in": "path",
            "description": "Row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxys",
            "in": "body",
            "description": "List of serials",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRowSerialNumber"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/row/{row_id}/batchs": {
      "put": {
        "tags": [
          "Order"
        ],
        "summary": "Set batch numbers to row",
        "operationId": "Order_SetRowBatchNumbers",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "row_id",
            "in": "path",
            "description": "Row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxys",
            "in": "body",
            "description": "List of batchs",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRowBatchNumber"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/instruction/{instruction_id}": {
      "put": {
        "tags": [
          "Order"
        ],
        "summary": "Set service instruction to sales order",
        "operationId": "Order_SetServiceInstructionToOrder",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Sales order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "instruction_id",
            "in": "path",
            "description": "Service instruction id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/orders/instructions": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get a list of service instructions",
        "operationId": "Order_GetServiceInstructions",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ServiceInstruction]"
            }
          }
        }
      }
    },
    "/api/orders/instructions/{id}": {
      "put": {
        "tags": [
          "Order"
        ],
        "summary": "Updates service order instruction row",
        "operationId": "Order_UpdateServiceInstruction",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Service order instruction id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "instruction",
            "in": "body",
            "description": "Instruction proxy",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ServiceOrderInstruction"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/orders/from_offer": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Create an order from offer payload",
        "operationId": "Order_CreateOrderFromOffer",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyOffer",
            "in": "body",
            "description": "Offer payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Offer"
            }
          },
          {
            "name": "orderType",
            "in": "query",
            "description": "SalesOrder type",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "copyLinks",
            "in": "query",
            "description": "Copy offer links to salesorder",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "getCustomerData",
            "in": "query",
            "description": "Refresh customer data",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/orders/from_offer/{number}": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Create an order from offer by offer number",
        "operationId": "Order_CreateOrderFromOfferByNumber",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "description": "Offer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "orderType",
            "in": "query",
            "description": "SalesOrder type",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "copyLinks",
            "in": "query",
            "description": "Copy offer links to salesorder",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "getCustomerData",
            "in": "query",
            "description": "Refresh customer data",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/orders/invoicingparties": {
      "put": {
        "tags": [
          "Order"
        ],
        "summary": "Updates order invoicing parties",
        "operationId": "Order_CreateInvoicingParties",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyPartyList",
            "in": "body",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderInvoicingParty"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/orders/{number}/invoicingparties": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get order invoicing parties",
        "operationId": "Order_GetInvoicingPartyList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "description": "Sales order number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesOrderInvoicingParty]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/links": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Create a sales order link",
        "operationId": "Order_CreateLink",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Sales order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "link",
            "in": "body",
            "description": "Salesorder link payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/links/{link_id}": {
      "delete": {
        "tags": [
          "Order"
        ],
        "summary": "Delete salesorder link",
        "operationId": "Order_DeleteLink",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Sales order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "link_id",
            "in": "path",
            "description": "Id of link",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/packet_row": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Create salesorder packet product row to existing sales order",
        "operationId": "Order_CreateRowPacketProduct",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Sales order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "product_code",
            "in": "query",
            "description": "Product sku code",
            "required": true,
            "type": "string"
          },
          {
            "name": "amount",
            "in": "query",
            "description": "Product amount",
            "required": true,
            "type": "number",
            "format": "double"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.SalesOrderRow]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/deliverypallets": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Gets list of delivery pallets that are linked to order",
        "operationId": "Order_GetOrderDeliveryPallets",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Sales order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.OrderDeliveryPallet]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/deliverypallets/{id}": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Gets single delivery pallet",
        "operationId": "Order_GetOrderDeliveryPallet",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Sales order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Order_delivery_pallet_id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.OrderDeliveryPallet]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/newdeliverypallet": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Returns a body of new delivery pallet for sales order. Does not save.",
        "operationId": "Order_GetNewPallet",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.OrderDeliveryPallet]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/PreDeliveryInfoRow": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Add predelivery info row to order",
        "operationId": "Order_AddPreDeliveryInfoRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Sales order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "preDeliveryInfoPackageProxy",
            "in": "body",
            "description": "predelivery info",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PreDeliveryInfoPackage"
            }
          },
          {
            "name": "reCalculate",
            "in": "query",
            "description": "recalculate M2, M3, Weight, PalletMeters and Packages",
            "required": true,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/orders/deliverypallet/new_sscc": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Returns autogenerated SSCC-code for pallet",
        "operationId": "Order_GetNewSSCC",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/deliverypallet": {
      "put": {
        "tags": [
          "Order"
        ],
        "summary": "Updates delivery pallet for salesorder.",
        "operationId": "Order_UpdateOrderDeliveryPallet",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Sales order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pallet",
            "in": "body",
            "description": "Pallet to be created",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryPallet"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Creates a new delivery pallet for salesorder.",
        "operationId": "Order_CreateOrderDeliveryPallet",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Sales order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pallet",
            "in": "body",
            "description": "Pallet to be created",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryPallet"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.OrderDeliveryPallet]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/deliverypallet/{order_delivery_pallet_id}": {
      "delete": {
        "tags": [
          "Order"
        ],
        "summary": "Deletes delivery pallet from sales order.",
        "operationId": "Order_DeletePallet",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "order_delivery_pallet_id",
            "in": "path",
            "description": "Order delivery pallet id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/deliverypalletrow": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Creates a new delivery pallet row for salesorder.",
        "operationId": "Order_CreateOrderDeliveryPalletRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Sales order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "row",
            "in": "body",
            "description": "Pallet row to be created",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryPalletRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.OrderDeliveryPalletRow]"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/deliverypalletrow/{pallet_row_id}": {
      "delete": {
        "tags": [
          "Order"
        ],
        "summary": "Delete pallet row.",
        "operationId": "Order_DeletePalletRow",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "Order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pallet_row_id",
            "in": "path",
            "description": "Pallet row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/orders/{order_id}/row/{row_id}/serialsuggestions/{serial}": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Returns automatically selected serials for an order row",
        "operationId": "Order_GetSerialNumberSuggestions",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "order id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "row_id",
            "in": "path",
            "description": "row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "serial",
            "in": "path",
            "description": "Serial number that is set as a first serial for the row",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.StockTransactionSerialNumber]"
            }
          }
        }
      }
    },
    "/api/orders/deliverydate/{type}": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get deliverydate based on order type",
        "operationId": "Order_GetDeliveryDate",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "description": "Sales order type",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.DateTime]"
            }
          }
        }
      }
    },
    "/api/orders/delivery_rows": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Returns the delivery rows associated with the order",
        "operationId": "Order_GetDeliveryRows",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.orderrow_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.invoice_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.order_number",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_date_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.delivery_date_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.amount",
            "in": "query",
            "required": false,
            "type": "number",
            "format": "double"
          },
          {
            "name": "filter.stock_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.deliveryinfo_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.box",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.SalesDeliveryRow]"
            }
          }
        }
      }
    },
    "/api/orders/undeliveredrows/{product_code}": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Returns undelivered order rows by product code and stock",
        "operationId": "Order_GetUndeliveredOrderRows",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "stock",
            "in": "query",
            "description": "Stock number",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesOrderRow]"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet": {
      "get": {
        "tags": [
          "Pallet"
        ],
        "summary": "Return product stock pallets based on filters",
        "operationId": "Pallet_GetProductStockPallets",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.product_code",
            "in": "query",
            "description": "Filter pallets by product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.stock_number",
            "in": "query",
            "description": "Filter pallets by stock number (varastonumero). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.shelf",
            "in": "query",
            "description": "Filter pallets by shelf code (hylly)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.info",
            "in": "query",
            "description": "Filter pallets by the info / description field",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductStockPallet]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Pallet"
        ],
        "summary": "Create a product stock pallet",
        "description": "Creates a new product stock pallet. The payload may include rows and child pallets — all of them are persisted in a single request.",
        "operationId": "Pallet_CreateProductStockPallet",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyPallet",
            "in": "body",
            "description": "The pallet payload including rows and optional child pallets",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStockPallet"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/{id}": {
      "get": {
        "tags": [
          "Pallet"
        ],
        "summary": "Return product stock pallet",
        "operationId": "Pallet_GetProductStockPallet",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStockPallet]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pallet"
        ],
        "summary": "Delete product stock pallet",
        "operationId": "Pallet_DeleteProductStockPallet",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pallet ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/{id}/row": {
      "post": {
        "tags": [
          "Pallet"
        ],
        "summary": "Creates new product stock pallet row",
        "operationId": "Pallet_CreateProductStockPalletRow",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pallet ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "productCode",
            "in": "query",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "stockNumber",
            "in": "query",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "unit",
            "in": "query",
            "description": "Unit",
            "required": true,
            "type": "string"
          },
          {
            "name": "amount",
            "in": "query",
            "description": "Amount",
            "required": true,
            "type": "number",
            "format": "double"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/sscc": {
      "get": {
        "tags": [
          "Pallet"
        ],
        "summary": "Return product stock pallets based on SSCC",
        "operationId": "Pallet_GetProductStockPalletSSCC",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "sscc",
            "in": "query",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductStockPallet]"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/instock/{code}": {
      "get": {
        "tags": [
          "Pallet"
        ],
        "summary": "Returns a list of pallets in stock by product code",
        "operationId": "Pallet_GetPalletListInStockWithCode",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductStockPallet]"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/info": {
      "get": {
        "tags": [
          "Pallet"
        ],
        "summary": "Return product stock pallets based on info",
        "operationId": "Pallet_GetProductStockPalletByInfo",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "info",
            "in": "query",
            "description": "Pallet info (description)",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductStockPallet]"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet_paged": {
      "get": {
        "tags": [
          "Pallet"
        ],
        "summary": "Return product stock pallets based on filters paged",
        "operationId": "Pallet_GetProductStockPallets_Paged",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.product_code",
            "in": "query",
            "description": "Filter pallets by product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.stock_number",
            "in": "query",
            "description": "Filter pallets by their rows' stock number. Pallets without rows are excluded when this is set. For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.shelf",
            "in": "query",
            "description": "Filter pallets by one or more shelf codes (hyllyt)",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.pallet_code",
            "in": "query",
            "description": "Filter pallets by the pallet identifier code (lavakoodi)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.info",
            "in": "query",
            "description": "Filter pallets by the info / description field",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.batch_id",
            "in": "query",
            "description": "Filter pallets by the batch id of any row",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.batchnr_suppliercode",
            "in": "query",
            "description": "Filter pallets by the supplier batch code (toimittajan eränumero) of any row",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sort order by pallet id. False (default) sorts ascending; true sorts descending",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.serial",
            "in": "query",
            "description": "Filter pallets by serial number (substring match)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.pallet_stock",
            "in": "query",
            "description": "Filter pallets by one or more pallet stock numbers (the pallet-level stock, not the row stock). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductStockPallet]"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/{id}/frompurchaseorder": {
      "post": {
        "tags": [
          "Pallet"
        ],
        "summary": "Create product stock pallet from purchase order delivery pallet",
        "operationId": "Pallet_CreateProductStockPalletFromPurchaseOrderPallet",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pallet main ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/main/{mainId}": {
      "get": {
        "tags": [
          "Pallet"
        ],
        "summary": "Return product stock pallet using common pallet id",
        "operationId": "Pallet_GetProductStockPalletWithMainId",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "mainId",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStockPallet]"
            }
          }
        }
      }
    },
    "/api/pallets/salesorder/deliverypallet": {
      "get": {
        "tags": [
          "Pallet"
        ],
        "summary": "Return sales order pallet by description / palletnumber",
        "operationId": "Pallet_GetSalesOrderPalletByDescription",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "description",
            "in": "query",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.OrderDeliveryPallet]"
            }
          }
        }
      }
    },
    "/api/pallets/salesorder/deliverypallet/fromstock": {
      "post": {
        "tags": [
          "Pallet"
        ],
        "summary": "Creates a new sales order delivery pallet from product stock pallet",
        "operationId": "Pallet_CreateNewSalesOrderPalletFromStock",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "palletMainID",
            "in": "query",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "salesOrderID",
            "in": "query",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/tosalesorder": {
      "put": {
        "tags": [
          "Pallet"
        ],
        "summary": "Converts product stock pallet to sales order delivery pallet",
        "operationId": "Pallet_UpdateStockPalletToSalesOrderPallet",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "palletID",
            "in": "query",
            "description": "Pallet main ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "salesOrderNumber",
            "in": "query",
            "description": "Sales order number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/instock": {
      "get": {
        "tags": [
          "Pallet"
        ],
        "summary": "Return a list pallets currently in stock",
        "operationId": "Pallet_PalletsInStock",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductStockPallet]"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/transaction": {
      "post": {
        "tags": [
          "Pallet"
        ],
        "summary": "Record an inward or outward stock transaction for a pallet",
        "description": "Creates stock transactions for every row on the pallet. The direction (1 = Outward, 2 = Inward) determines whether the transaction removes product from stock or adds product to stock. Child pallets are processed recursively. Returns 400 when the pallet payload is missing or when an unknown direction value is supplied, and 404 when a row references a stock id that does not exist.\r\n            \r\n**Batch handling on rows:**\r\n- `batch_supplier_code_input` set → a new batch entry is created (or an existing batch with the same supplier code at the same stock + shelf is reused).\r\n- `batch_id` set (and `batch_supplier_code_input` empty) → the row references an existing batch.",
        "operationId": "Pallet_StockPalletTransaction",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyPallet",
            "in": "body",
            "description": "The pallet payload describing the transaction",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStockPallet"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "description": "The transaction direction. Use 1 for Outward (otto) or 2 for Inward (tuloutus)",
            "required": true,
            "type": "string",
            "enum": [
              "Outward",
              "Inward"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStockPallet]"
            }
          }
        }
      }
    },
    "/api/pallets/product/stockpallet/transfer": {
      "post": {
        "tags": [
          "Pallet"
        ],
        "summary": "Transfer a pallet to another stock or shelf",
        "description": "Moves the entire pallet (header and rows) to a new stock and/or shelf by recording an Outward transaction on the source location and an Inward transaction on the destination. Child pallets are processed recursively for both the Outward and Inward transactions. When `batch_suppliercode` is set on the pallet, the stock transaction batch is also relocated.",
        "operationId": "Pallet_TransferPallet",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyPallet",
            "in": "body",
            "description": "The pallet payload to be transferred",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStockPallet"
            }
          },
          {
            "name": "newStockNumber",
            "in": "query",
            "description": "The destination stock number. For possible values, refer to /api/settings/products/stocks",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "newShelf",
            "in": "query",
            "description": "The destination shelf code. Optional — pass an empty string to leave the shelf empty",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStockPallet]"
            }
          }
        }
      }
    },
    "/api/persons": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get a paged list of persons",
        "description": "Returns persons matching the filter. By default model persons (non-real placeholder rows used in workshift planning) are included — set `hide_models=true` to exclude them. Use `only_lemonsoft_users` or `only_employees` to scope the result to specific subsets.",
        "operationId": "Person_GetPersons",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.created_before",
            "in": "query",
            "description": "Filter persons created on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.created_after",
            "in": "query",
            "description": "Filter persons created on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter persons whose updated_at is on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter persons whose updated_at is on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.role",
            "in": "query",
            "description": "Filter persons by role / attribute code",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.costcenter",
            "in": "query",
            "description": "Filter persons by their payroll cost center code (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.hide_models",
            "in": "query",
            "description": "When true, model persons (non-real placeholder rows used in workshift planning) are excluded",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.number",
            "in": "query",
            "description": "Filter by person number (exact match)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.numbers",
            "in": "query",
            "description": "Filter by person numbers. Accepts a list of person numbers",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.only_lemonsoft_users",
            "in": "query",
            "description": "When true, only persons that are Lemonsoft users are returned",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.only_employees",
            "in": "query",
            "description": "When true, only persons flagged as employees are returned",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.person_code",
            "in": "query",
            "description": "Filter persons by any of their identifier codes (e.g. RFID code)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order by id. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Person]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Update an existing person",
        "description": "Updates an existing person. The person is identified by the `number` field in the\r\nrequest body — there is no id/number in the URL. The `id` field in the payload is\r\nignored (updates go by number, not id), and the existing person number is preserved.\r\nEmployment (Työsuhde) and tax (Verot), texts (Tekstit), and images (Kuvat) are\r\nnot handled by this endpoint.\r\nRequires the WPL or OPL license in addition to IWS_LOG.",
        "operationId": "Person_UpdatePerson",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person",
            "in": "body",
            "description": "Person payload (number identifies which person to update)",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Person"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateWithNumberResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Create a new person",
        "description": "Creates a new person with the provided data. Employment (Työsuhde) and tax (Verot),\r\ntexts (Tekstit), and images (Kuvat) are not handled by this endpoint.\r\nRequires the WPL or OPL license in addition to IWS_LOG.",
        "operationId": "Person_CreatePerson",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person",
            "in": "body",
            "description": "Person payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Person"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateWithNumberResponse"
            }
          }
        }
      }
    },
    "/api/persons/rfid/{code}": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get person number by code",
        "operationId": "Person_GetPersonNumberByCode",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "description": "Person code",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Int32]"
            }
          }
        }
      }
    },
    "/api/persons/{number}": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get person by number",
        "operationId": "Person_GetPersonByNumber",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Person]"
            }
          }
        }
      }
    },
    "/api/persons/current": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get login person",
        "operationId": "Person_GetCurrentPerson",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Person]"
            }
          }
        }
      }
    },
    "/api/persons/{person_id}/stock": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get person default stock number",
        "operationId": "Person_GetPersonDefaultStock",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person_id",
            "in": "path",
            "description": "Person id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Int32]"
            }
          }
        }
      }
    },
    "/api/persons/{id}/codes": {
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Replace the RFID codes attached to a person",
        "operationId": "Person_ReplacePersonRfidCodes",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "codes",
            "in": "body",
            "description": "Replacement list of RFID codes",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.PutPersonCodeRequest"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/persons/from-template": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Create a person from a template.",
        "description": "Creates a new person by copying template person {templateNumber}, overriding its\r\nname and type. Requires person write access (WPL/OPL license or Kellokortti operations-admin role).",
        "operationId": "Person_CreatePersonFromTemplate",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "templateNumber",
            "in": "query",
            "description": "Template person number to copy.",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "name",
            "in": "query",
            "description": "Name for the new person.",
            "required": true,
            "type": "string"
          },
          {
            "name": "type",
            "in": "query",
            "description": "Person type for the new person.",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateWithNumberResponse"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/persons/template": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Clone an existing person into a template.",
        "description": "Reserves a negative (template) person number, clones person {personId} into it,\r\nwipes contact fields and marks it as a new copy. Requires person write access (WPL/OPL license or\r\nKellokortti operations-admin role); a per-object ACL for the source person is unavailable in\r\nLemonRest, so the operations-admin gate is the effective access control.",
        "operationId": "Person_CreatePersonTemplate",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "personId",
            "in": "query",
            "description": "Id of the person to clone.",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "name",
            "in": "query",
            "description": "Name for the template.",
            "required": true,
            "type": "string"
          },
          {
            "name": "type",
            "in": "query",
            "description": "Person type for the template.",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateWithNumberResponse"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/persons/{id}": {
      "delete": {
        "tags": [
          "Person"
        ],
        "summary": "Delete a person.",
        "description": "Deletes the person identified by {id} when Person.CheckDeletePerson allows it.\r\nRequires person write access (WPL/OPL license or Kellokortti operations-admin role).",
        "operationId": "Person_DeletePerson",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person id.",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "BadRequest"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "NotFound"
          }
        }
      }
    },
    "/api/persons/{id}/clear-as-supervisor": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Clears this person as supervisor from all of their subordinates. Requires person write access\r\n(WPL or OPL license, or the Kellokortti operations-admin role).",
        "operationId": "Person_ClearAsSupervisor",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The identifier of the person whose subordinates are cleared.",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "BadRequest"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "NotFound"
          }
        }
      }
    },
    "/api/persons/{id}/attributes": {
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Reconcile a person's Kellokortti attributes.",
        "description": "Reconciles the whitelisted Kellokortti person_attributes (roles + recording methods + can-cancel-approval\r\n9002 + can-start-subordinate-calendar-stamp 9003 + can-edit-own-time-bank-events 9004) to match the request:\r\nwhitelisted attributes no longer selected are deleted, newly selected ones are inserted. Requires person\r\nwrite access (WPL/OPL license or Kellokortti operations-admin role).",
        "operationId": "Person_UpdatePersonAttributes",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person id.",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "request",
            "in": "body",
            "description": "Selected attribute ids and permission flags.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PutPersonAttributesRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/persons/{id}/paymenttype": {
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Set a person's payment type.",
        "description": "Reconciles the person_transactions payment type: when it changed, today's transaction row is read or\r\ncreated, an audit note is appended, and the payment type is written. Requires person write access\r\n(WPL/OPL license or Kellokortti operations-admin role).",
        "operationId": "Person_UpdatePersonPaymentType",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person id.",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "paymentType",
            "in": "body",
            "description": "New payment type.",
            "required": true,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/persons/jobs": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get a paged list of person jobs",
        "description": "Returns the jobs assigned to a person. Each job carries a `type` code identifying the source object (project, sales order, service order, etc.) and a `state` reflecting where the job is in its lifecycle.",
        "operationId": "Person_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.person_number",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.states",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.job_types",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.company_location",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.department",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.costcenter",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.project_type",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Job]"
            }
          }
        }
      }
    },
    "/api/persons/jobs/{id}/{type}/start": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Start a person job",
        "description": "Marks the job as started, sets `start_date`, and transitions the job's state. Use this when a worker begins work on an assigned job (työkeikan aloitus).",
        "operationId": "Person_StartPersonJob",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person job object id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "type",
            "in": "path",
            "description": "Person job type",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPersonJob",
            "in": "body",
            "description": "Person job",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Job"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/persons/jobs/{id}/{type}/pause": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Pause a person job",
        "description": "Suspends a started job without finalizing it. The worker can resume the job later via start.",
        "operationId": "Person_PausePersonJob",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person job object id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "type",
            "in": "path",
            "description": "Person job type",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPersonJob",
            "in": "body",
            "description": "Person job",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Job"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/persons/jobs/{id}/{type}/done": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Mark a person job as done",
        "description": "Finalizes the job: sets `end_date`, transitions state to done, and records the accumulated `hours` and `billable_hours`. When `set_order_invoiced=true` on the payload, the underlying order is also marked invoiced. For service orders, when `send_sms=true` an SMS is sent to the customer contact, and when `send_email=true` the service report PDF (function 160011, SSRS) is emailed to the agreement address.",
        "operationId": "Person_DonePersonJob",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person job object id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "type",
            "in": "path",
            "description": "Person job type",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPersonJob",
            "in": "body",
            "description": "Person job",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Job"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/persons/jobs/{id}/{type}/assign/{person_number}": {
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Assign person job to worker",
        "operationId": "Person_AssignPersonJob",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person job object id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "type",
            "in": "path",
            "description": "Person job type",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "person_number",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/persons/jobs/{id}/{type}/startdate": {
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Set person job start date",
        "operationId": "Person_SetPersonJobStartDate",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person job id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "type",
            "in": "path",
            "description": "Person job type",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "date",
            "in": "body",
            "description": "New datetime",
            "required": true,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/persons/jobs/{id}/{type}/enddate": {
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Set person job end date",
        "operationId": "Person_SetPersonJobEndDate",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person job id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "type",
            "in": "path",
            "description": "Person job type",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "date",
            "in": "body",
            "description": "New datetime",
            "required": true,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/persons/jobs/{id}/{type}/remove/{person_number}": {
      "delete": {
        "tags": [
          "Person"
        ],
        "summary": "Remove person from job",
        "operationId": "Person_RemovePersonFromJob",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Person job object id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "type",
            "in": "path",
            "description": "Person job type",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "person_number",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/persons/jobs/workday": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Create a worktime workday entry from a job",
        "description": "Posts a full workday's hours as a worktime entry derived from the given job's details (person, project, cost center, form of salary). Use this when a worker completes a job and the entire day should be recorded against that job.",
        "operationId": "Person_CreateWorkday",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Person job",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Job"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/persons/jobs/daysummary": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Create worktimes summarizing a day across several jobs",
        "description": "Posts a list of jobs as a day summary — one worktime entry is created per job. Use this when a worker has worked across several jobs in a day and the hours need to be split per job.",
        "operationId": "Person_CreateDaySummary",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person_number",
            "in": "query",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyList",
            "in": "body",
            "description": "Days jobs",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.Job"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/persons/jobs/workhours": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Create workhour from job",
        "operationId": "Person_CreateWorkHourFromPersonJob",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Person job",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Job"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/persons/worktimes": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get worktimes",
        "operationId": "Person_GetWorkTimes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.created_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.created_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.date_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.date_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.states",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.job_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.person_number",
            "in": "query",
            "description": "Person number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.sources",
            "in": "query",
            "description": "Worktime sources",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.project_number",
            "in": "query",
            "description": "Project number. Returns only worktimes booked on the given project.",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.project_phase_id",
            "in": "query",
            "description": "Project phase id. Value 0 returns worktimes that have no phase; omit the parameter to skip phase filtering.",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.WorkTime]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Update a worktime entry",
        "description": "Updates an existing worktime entry. The `person_number` cannot be changed — a worktime always belongs to its original person. Use the dedicated material and addition routes to manage child rows.",
        "operationId": "Person_UpdateWorktime",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Worktime proxy",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTime"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Create a worktime entry",
        "description": "Records a worktime (työtunti) for a person. The `formofsalary_number` resolves the row's salary handling — leave it 0 to use the person's default. Materials and additions can be attached separately via the `worktimes/{id}/materials` and `worktimes/{id}/additions` routes.",
        "operationId": "Person_CreateWorktime",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Worktime proxy",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTime"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/persons/worktimes/{id}": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get worktime",
        "operationId": "Person_GetWorkTime",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "A worktime id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.WorkTime]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Person"
        ],
        "summary": "Delete worktime",
        "operationId": "Person_DeleteWorkTime",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "A worktime id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/persons/worktimes/{id}/materials": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get worktime materials",
        "operationId": "Person_GetWorkTimeMaterials",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "A worktime id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.product_type",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.WorkTimeMaterial]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Update worktime material",
        "operationId": "Person_UpdateWorkTimeMaterial",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Worktime id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyMaterial",
            "in": "body",
            "description": "Worktime material proxy",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeMaterial"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Create worktime material",
        "operationId": "Person_CreateWorkTimeMaterial",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Worktime id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyMaterial",
            "in": "body",
            "description": "Worktime material proxy",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeMaterial"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/persons/worktimes/{worktime_id}/materials/{material_id}": {
      "delete": {
        "tags": [
          "Person"
        ],
        "summary": "Delete worktime material",
        "operationId": "Person_DeleteWorkTimeMaterial",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "worktime_id",
            "in": "path",
            "description": "WorkTime ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "material_id",
            "in": "path",
            "description": "WorkTime material ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/persons/worktimes/regulations/{regulation_id}": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get worktime regulation",
        "operationId": "Person_GetWorkTimeRegulation",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "regulation_id",
            "in": "path",
            "description": "Worktime regulation id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.WorkTimeRegulation]"
            }
          }
        }
      }
    },
    "/api/persons/worktimes/additions/{person_number}/{formofsalary_number}/{regulation_id}": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get worktime additions",
        "operationId": "Person_GetWorkTimeAdditions",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person_number",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "formofsalary_number",
            "in": "path",
            "description": "Form of salary number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "regulation_id",
            "in": "path",
            "description": "Person worktime regulation",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorkTimeAddition]"
            }
          }
        }
      }
    },
    "/api/persons/worktimes/{worktime_id}/additions": {
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Add worktime additions",
        "operationId": "Person_AddWorkTimeAdditionals",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "worktime_id",
            "in": "path",
            "description": "WorkTime ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyAdditions",
            "in": "body",
            "description": "Addtions",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeAddition"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/persons/worktimes/startdate/{person_number}": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get next startdate for worktime",
        "operationId": "Person_GetWorktimeStartDate",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person_number",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Nullable[System.DateTime]]"
            }
          }
        }
      }
    },
    "/api/persons/absences": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get persons absence list",
        "operationId": "Person_GetPersonAbsenceList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.person_number",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.states",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order by id. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PersonAbsence]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Update person absence",
        "operationId": "Person_UpdatePersonAbsence",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "PersonAbsence payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PersonAbsence"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Create a person absence",
        "description": "Creates a new absence (poissaolo) for a person. The absence starts in the draft state (0) and progresses through submitted → approved / rejected as approvers act on it. Use `absences/calculate` first to preview the absence's duration in days and hours before submitting.",
        "operationId": "Person_CreateNewPersonAbsence",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "PersonAbsence payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PersonAbsence"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/persons/absences/{id}": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get single person absence",
        "operationId": "Person_GetPersonAbsence",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Absence id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PersonAbsence]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Person"
        ],
        "summary": "Delete person absence",
        "operationId": "Person_DeletePersonAbsence",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Absence id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/persons/absences/{id}/dates": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Save the day-level rows for an absence",
        "description": "Replaces the day rows of an absence with the supplied set. Rows outside the absence's date range are\r\nremoved, extra in-range rows are removed, existing rows get their realized workshift updated, and new\r\nrows are created. Absences already in the Accepted state are rejected before any rows are changed,\r\nwhich is the state under which days have typically been moved to payroll. Each supplied day must carry a\r\nvalid date that falls within the absence's [person_absence_date, person_absence_enddate] range; otherwise\r\nthe request is rejected with 400.",
        "operationId": "Person_SavePersonAbsenceDates",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Absence id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxy",
            "in": "body",
            "description": "The desired set of day rows",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.PersonAbsenceDate"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/persons/absences/{person_id}/payload": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get a default absence payload prefilled for a person",
        "description": "Returns an absence object prefilled with the person's information and sensible defaults. Use this to seed a new absence form in the client before submitting via POST `/absences`.",
        "operationId": "Person_GetNewPersonAbsenceBody",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person_id",
            "in": "path",
            "description": "Person id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PersonAbsence]"
            }
          }
        }
      }
    },
    "/api/persons/absences/calculate": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Calculate the duration of an absence",
        "description": "Returns the absence's duration in days and hours based on the person, absence reason, and date range — without persisting the absence. Use this to preview duration before submitting via POST `/absences`.",
        "operationId": "Person_CalculatePersonAbsence",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "calculation",
            "in": "body",
            "description": "Calculation proxy",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PersonAbsenceCalculation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PersonAbsenceCalculationAmount]"
            }
          }
        }
      }
    },
    "/api/persons/basic": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Create a person with basic information only",
        "description": "Creates a new person with only login-level data (name, email, gsm, language, attributes). To add address, payroll and other fields, update the created person via the full /api/persons endpoint afterwards.",
        "operationId": "Person_CreatePersonWithBasicInfo",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person",
            "in": "body",
            "description": "PersonLogin payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PersonLogin"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateWithNumberResponse"
            }
          }
        }
      }
    },
    "/api/persons/{person_number}/ereceipts": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get person eReceipts",
        "operationId": "Person_GetPersonEReceipts",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person_number",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.filename",
            "in": "query",
            "description": "eReceipt file name",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.EReceipt]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Person"
        ],
        "summary": "Update eReceipt",
        "operationId": "Person_UpdateEReceipt",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person_number",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxy",
            "in": "body",
            "description": "eReceipt payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.EReceipt"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Create an e-receipt for a person",
        "description": "Creates a new e-receipt (eKuitti) with one or more price lines and optional file attachments. After creation the receipt can be forwarded to purchase invoicing, which generates a linked purchase invoice.",
        "operationId": "Person_CreateEReceipt",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person_number",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxy",
            "in": "body",
            "description": "eReceipt payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.EReceipt"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/persons/plannedshifts": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Get planned shifts (vuorosuunnittelurivit)",
        "description": "Returns planned shift rows for the supplied filter. The request shape is POST with the filter in the body — not a query string.",
        "operationId": "Person_GetPlannedShifts",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.date_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.date_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.persons",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.person_groups",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ShiftPlanningRow]"
            }
          }
        }
      }
    },
    "/api/persons/plannedshiftworkstations": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get planned shift work stations",
        "operationId": "Person_GetPlannedShiftWorkStations",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.date_before",
            "in": "query",
            "description": "Upper bound for the assignment start date. Defaults to one year from today.",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.date_after",
            "in": "query",
            "description": "Lower bound for the assignment start date. Defaults to 1970-01-01 (effectively unbounded).",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.persons",
            "in": "query",
            "description": "Optional list of person numbers to filter assignments by. Null or empty disables this filter.",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ShiftPlanningRowWorkStation]"
            }
          }
        }
      }
    },
    "/api/persons/worktimefossummary": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get worktime fos summary list",
        "operationId": "Person_GetWorktimeFosSummary",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.person",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.start",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.end",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorktimeFosSummary]"
            }
          }
        }
      }
    },
    "/api/persons/{person_number}/flexinfo": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get person's worktime/flex info",
        "operationId": "Person_GetFlexInfo",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person_number",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.WorktimeInfo]"
            }
          }
        }
      }
    },
    "/api/persons/{person_number}/travelinfo": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Get person's travel info",
        "operationId": "Person_GetTravelInfo",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person_number",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.start",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.end",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PersonTravelInfo]"
            }
          }
        }
      }
    },
    "/api/persons/synchronizefromkellokortti": {
      "post": {
        "tags": [
          "Person"
        ],
        "summary": "Synchronize persons, groups and workshifts from Kellokortti",
        "description": "Bulk import endpoint used by the external Kellokortti time tracking system. The payload (`KellokorttiShiftPlanningDetails`) carries persons, person groups, and workshifts that are merged into Lemonsoft in a single transaction.",
        "operationId": "Person_SynchronizeFromKellokortti",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.KellokorttiShiftPlanningDetails"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/pricelists": {
      "get": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Get a paged list of pricelists",
        "description": "Returns pricelists matching the filter. When `get_ids=true`, each pricelist's customers and products are enriched with `customer_register_id` and `product_register_id` values from the customer and product registers.",
        "operationId": "Pricelist_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.name",
            "in": "query",
            "description": "Filter pricelists whose description contains this string",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.number",
            "in": "query",
            "description": "Filter by pricelist number (exact match)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.type",
            "in": "query",
            "description": "Filter by pricelist type (exact match)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.start_date_before",
            "in": "query",
            "description": "Filter pricelists whose start date is on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.start_date_after",
            "in": "query",
            "description": "Filter pricelists whose start date is on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.end_date_before",
            "in": "query",
            "description": "Filter pricelists whose end date is on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.end_date_after",
            "in": "query",
            "description": "Filter pricelists whose end date is on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.get_ids",
            "in": "query",
            "description": "When true, the response is enriched with customer_register_id and product_register_id values for each pricelist entry",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Pricelist]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Update an existing pricelist",
        "description": "Updates header data and any sub-collection items that match an existing id. To add new customers, products, product groups, customer group discounts, supplier discounts or projects, use the dedicated POST endpoints (`/customers`, `/products`, `/product_groups`, `/cust_group_discounts`, `/supplier_discounts`, `/projects`). The pricelist number cannot be changed after creation.",
        "operationId": "Pricelist_UpdatePricelist",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyPricelist",
            "in": "body",
            "description": "Pricelist payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Pricelist"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Create a new pricelist",
        "description": "Creates the pricelist together with its customers, products, product groups, customer group discounts, supplier discounts and projects in a single request. The pricelist number must be unique.",
        "operationId": "Pricelist_CreateNewPricelist",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyPricelist",
            "in": "body",
            "description": "Pricelist payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Pricelist"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/{product_code}": {
      "get": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Get a product's price from a pricelist",
        "description": "Returns the computed price of a product. When `id` is 0, the price is computed without restricting to a single pricelist — the system resolves the best applicable pricelist using `cust_no`, `product_unit`, and `list_valid_date`.\r\n            \r\nThe response includes both `price_with_discount_no_tax` and `price_with_discount_and_tax`, computed from the product's tax handling settings.",
        "operationId": "Pricelist_GetProductPrice",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id. Use 0 to compute the price across all applicable pricelists",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code (tuotekoodi). For possible values, refer to /api/products",
            "required": true,
            "type": "string"
          },
          {
            "name": "get_purchase_price",
            "in": "query",
            "description": "When true, the purchase price is returned; when false, the sales price is returned",
            "required": true,
            "type": "boolean"
          },
          {
            "name": "filter.list_valid_date",
            "in": "query",
            "description": "The date used to determine which pricelist entries are valid (required)",
            "required": true,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.product_unit",
            "in": "query",
            "description": "Optional unit of measurement to scope the price lookup",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.cust_no",
            "in": "query",
            "description": "Optional customer number to apply customer-specific pricing rules. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductPrice]"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}": {
      "get": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Get single pricelist",
        "operationId": "Pricelist_Get",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "A pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Pricelist]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Delete pricelist",
        "operationId": "Pricelist_DeletePricelist",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/customers": {
      "post": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Add new customer to pricelist",
        "operationId": "Pricelist_CreateNewPricelistCustomer",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyCustomer",
            "in": "body",
            "description": "Customer payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PricelistCustomer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/products": {
      "post": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Add new product to pricelist",
        "operationId": "Pricelist_CreateNewPricelistProduct",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyProduct",
            "in": "body",
            "description": "Product payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PricelistProduct"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/product_groups": {
      "post": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Add new product group to pricelist",
        "operationId": "Pricelist_CreateNewPricelistProductGroup",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyProductGroup",
            "in": "body",
            "description": "Product group payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PriceListProductGroup"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/cust_group_discounts": {
      "post": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Add new customer group discount for pricelist",
        "operationId": "Pricelist_CreateNewPricelistCustomerGroupDiscount",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyCustGroupDiscount",
            "in": "body",
            "description": "Customer group discount payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PricelistCustomerGroupDiscount"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/supplier_discounts": {
      "post": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Add new supplier discount to pricelist",
        "operationId": "Pricelist_CreateNewPricelistSupplierDiscount",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxySupplierDiscount",
            "in": "body",
            "description": "Supplier discount payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PricelistSupplierDiscount"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/projects": {
      "post": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Add new project to pricelist",
        "operationId": "Pricelist_CreateNewPricelistProject",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyProject",
            "in": "body",
            "description": "Project payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PricelistProject"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/customers/{customer_id}": {
      "delete": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Delete customer from pricelist",
        "operationId": "Pricelist_DeletePricelistCustomer",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "customer_id",
            "in": "path",
            "description": "Pricelist customer id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/products/{product_id}": {
      "delete": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Delete product from pricelist",
        "operationId": "Pricelist_DeletePricelistProduct",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "product_id",
            "in": "path",
            "description": "Pricelist product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/product_groups/{group_id}": {
      "delete": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Delete product group from pricelist",
        "operationId": "Pricelist_DeletePricelistProductGroup",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "group_id",
            "in": "path",
            "description": "Pricelist product group id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/cust_group_discounts/{group_id}": {
      "delete": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Delete customer discount group from pricelist",
        "operationId": "Pricelist_DeletePricelistCustomerGroupDiscount",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "group_id",
            "in": "path",
            "description": "Pricelist customer discount group id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/supplier_discounts/{discount_id}": {
      "delete": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Delete supplier discount from pricelist",
        "operationId": "Pricelist_DeletePricelistSupplierDiscount",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "discount_id",
            "in": "path",
            "description": "Pricelist supplier discount id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/pricelists/{id}/projects/{project_id}": {
      "delete": {
        "tags": [
          "Pricelist"
        ],
        "summary": "Delete project from pricelist",
        "operationId": "Pricelist_DeletePricelistProject",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pricelist id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "project_id",
            "in": "path",
            "description": "Pricelist project id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/products": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get a list of products",
        "operationId": "Product_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.name",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sku",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.ean",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.modified_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.modified_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.attribute_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.extra_name",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.category_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.group_code",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.group_codes",
            "in": "query",
            "description": "Filter products by one or more product group codes (exact match). Multiple values are OR-ed together.",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.show_models",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.show_nonactive",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.show_nonstock",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.include_pricing",
            "in": "query",
            "description": "Control whether to include pricing information in the response",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.shelf",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.shelf_stock",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.stock",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_by_sku",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false). Works with sort_by_sku.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.search_words",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.is_sales",
            "in": "query",
            "description": "Vain myytävät tuotteet",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.is_purchase",
            "in": "query",
            "description": "Vain ostettavat tuotteet",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.only_with_balance",
            "in": "query",
            "description": "Vain saldolliset",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.only_below_alert_level",
            "in": "query",
            "description": "Only products below alert level. Requires stock filter to be set.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.search_from_additional_eancodes",
            "in": "query",
            "description": "Search by searchword from additional EAN codes as well",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Product]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Product"
        ],
        "summary": "Update product",
        "operationId": "Product_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Product"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Create a product",
        "operationId": "Product_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product",
            "in": "body",
            "description": "Product payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Product"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{id}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get product",
        "operationId": "Product_Get",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Product]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Product"
        ],
        "summary": "Delete product",
        "operationId": "Product_Delete",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Product"
        ],
        "summary": "Patch product",
        "operationId": "Product_Patch",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Product ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "productPatch",
            "in": "body",
            "description": "List of patch operations",
            "required": true,
            "schema": {
              "title": "JsonPatchDocument",
              "type": "array",
              "items": {
                "$ref": "#/definitions/Microsoft.AspNetCore.JsonPatch.Operations.Operation[LemonRest.Models.Proxy.Product]"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{id}/links": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get product links",
        "operationId": "Product_GetLinks",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter links updated on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter links updated on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.description",
            "in": "query",
            "description": "Filter links whose description contains the given text",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Link]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Create a product link",
        "operationId": "Product_CreateLink",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "link",
            "in": "body",
            "description": "Product link payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/groups": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get a list of Product Groups",
        "operationId": "Product_ListGroups",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.name",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.web_only",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.parent_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductGroup]"
            }
          }
        }
      }
    },
    "/api/products/categories": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get a list of Product Categories",
        "operationId": "Product_ListCategories",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.name",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.web_only",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.parent_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductCategory]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/serials": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get a list of Product Serial numbers",
        "operationId": "Product_GetProductSerialNumbers",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "filter.serial_code",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.father_serial",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.stock",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.in_stock",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.only_empty",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.StockTransactionSerialNumber]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/batchs": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get a list of Product batch numbers",
        "operationId": "Product_GetProductBatchs",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "filter.supplier_code",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.stock",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.in_stock",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.shelf",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.StockTransactionBatch]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/images": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get product images",
        "operationId": "Product_GetProductImages",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "product code",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProgramImageEncoded]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/suitableproducts/{suitability_type}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get suitable products based on given product code and suitability type",
        "operationId": "Product_GetSuitableProducts",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "suitability_type",
            "in": "path",
            "description": "Suitability type",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Product]"
            }
          }
        }
      }
    },
    "/api/products/batch": {
      "put": {
        "tags": [
          "Product"
        ],
        "summary": "Update product batch using batch id",
        "operationId": "Product_UpdateProductBatch",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyBatch",
            "in": "body",
            "description": "Product batch",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/gtincodes": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get GTIN codes from the product",
        "operationId": "Product_GetProductGTINCodes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductGTINCode]"
            }
          }
        }
      }
    },
    "/api/products/{id}/stocks": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get a list of Product stocks",
        "operationId": "Product_GetProductStocks",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Collections.Generic.IEnumerable[LemonRest.Models.Proxy.ProductStock]]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Create product stock for existing product",
        "operationId": "Product_CreateProductStocks",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "stock",
            "in": "body",
            "description": "Product stock payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStock"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{productCode}/stocks/{stock}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get a product stock",
        "operationId": "Product_GetProductStock",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "productCode",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStock]"
            }
          }
        }
      }
    },
    "/api/products/stocks/default": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get default product stock number",
        "operationId": "Product_GetCustomerDefaultProductStock",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "query",
            "description": "Product code",
            "required": false,
            "type": "string"
          },
          {
            "name": "customer_number",
            "in": "query",
            "description": "Customer number",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Int32]"
            }
          }
        }
      }
    },
    "/api/products/base": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get paged list of all products with basic information",
        "operationId": "Product_GetProductBaseList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.name",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sku",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.ean",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.modified_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.modified_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.attribute_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.extra_name",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.category_id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.group_code",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.group_codes",
            "in": "query",
            "description": "Filter products by one or more product group codes (exact match). Multiple values are OR-ed together.",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.show_models",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.show_nonactive",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.show_nonstock",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.include_pricing",
            "in": "query",
            "description": "Control whether to include pricing information in the response",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.shelf",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.shelf_stock",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.stock",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_by_sku",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false). Works with sort_by_sku.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.search_words",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.is_sales",
            "in": "query",
            "description": "Vain myytävät tuotteet",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.is_purchase",
            "in": "query",
            "description": "Vain ostettavat tuotteet",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.only_with_balance",
            "in": "query",
            "description": "Vain saldolliset",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.only_below_alert_level",
            "in": "query",
            "description": "Only products below alert level. Requires stock filter to be set.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.search_from_additional_eancodes",
            "in": "query",
            "description": "Search by searchword from additional EAN codes as well",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductBase]"
            }
          }
        }
      }
    },
    "/api/products/{id}/purchase_price/{supplier}/{stock}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get product purchase price",
        "operationId": "Product_GetProductPurchasePrice",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "supplier",
            "in": "path",
            "description": "Supplier number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Decimal]"
            }
          }
        }
      }
    },
    "/api/products/{id}/units/{unit_id}": {
      "delete": {
        "tags": [
          "Product"
        ],
        "summary": "Delete product units",
        "operationId": "Product_DeleteUnit",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "unit_id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{id}/stocks/{stock_id}": {
      "delete": {
        "tags": [
          "Product"
        ],
        "summary": "Delete product stocks",
        "operationId": "Product_DeleteStock",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "stock_id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{id}/attribute_data/{attribute_data_id}": {
      "delete": {
        "tags": [
          "Product"
        ],
        "summary": "Delete product attribute data",
        "operationId": "Product_DeleteAttributeData",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "attribute_data_id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{id}/suppliers/{supplier_id}": {
      "delete": {
        "tags": [
          "Product"
        ],
        "summary": "Delete product suppliers",
        "operationId": "Product_DeleteSuppliers",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "supplier_id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{id}/languages/{language_id}": {
      "delete": {
        "tags": [
          "Product"
        ],
        "summary": "Delete product language",
        "operationId": "Product_DeleteLanguage",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "language_id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{id}/links/{link_id}": {
      "delete": {
        "tags": [
          "Product"
        ],
        "summary": "Delete product link",
        "operationId": "Product_DeleteLink",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "link_id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/stocks/saldos/changed": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Lists products with saldo changes based on datetime filter",
        "operationId": "Product_GetProductsSaldos",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Timestamp after product saldo should have changed",
            "required": true,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Product]"
            }
          }
        }
      }
    },
    "/api/products/stocks/availability/changed": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Lists products with saldo or reservation changes based on datetime filter",
        "operationId": "Product_GetProductsSaldosOrReservations",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Timestamp after product saldo should have changed",
            "required": true,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Product]"
            }
          }
        }
      }
    },
    "/api/products/stocks/rentalsaldo": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Returns a list containing products daily saldo for given date range",
        "operationId": "Product_GetProductStockRentalSaldo",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "productCode",
            "in": "query",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "stockNumber",
            "in": "query",
            "description": "Stock number",
            "required": true,
            "type": "string"
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date",
            "required": true,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date",
            "required": true,
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductPreStockOut]"
            }
          }
        }
      }
    },
    "/api/products/stocks/orders": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Returns product stocks from products on sales orders",
        "operationId": "Product_GetProductsStocksFromOrders",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order",
            "in": "query",
            "description": "Sales order numbers",
            "required": true,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductStock]"
            }
          }
        }
      }
    },
    "/api/products/structure/one_level": {
      "put": {
        "tags": [
          "Product"
        ],
        "summary": "Update product's mainstructure and substructures",
        "description": "Please note that when calling this endpoint and work_number is equal to 0, you can only update the first level of substructures.\r\n            When updating nested substructures, send a separate request for that level with corresponding id.\r\n            When work_number is higher than 0, updating nested structures is allowed",
        "operationId": "Product_UpdateProductStructure",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "structure",
            "in": "body",
            "description": "structure model",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.MainStructureOriginUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/products/structure": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get product's structure",
        "operationId": "Product_GetStructure",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.product_code",
            "in": "query",
            "description": "The product code to filter by",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.work_number",
            "in": "query",
            "description": "The work number for structure",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.MainStructureOrigin]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Product"
        ],
        "summary": "Update product structure",
        "description": "Please note that when updating a product's structure, structures not present in the request will be deleted. Structures must be provided in full.",
        "operationId": "Product_UpdateStructure",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyMainStructure",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.MainStructureOrigin"
            }
          },
          {
            "name": "rowType",
            "in": "query",
            "description": "Setting this will override worknumber provided in the payload with the row's worknumber",
            "required": true,
            "type": "string",
            "enum": [
              "None",
              "SalesOrderRow",
              "OfferRow"
            ]
          },
          {
            "name": "row_id",
            "in": "query",
            "description": "Set this to match order's or offer's row's id if rowType is set",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Post complete product structure",
        "description": "Please note that when work number is 0 (rowtype=none), this endpoint creates every level of substructures as mainstructures with work number 0 for the corresponding product.\r\n            When work number is set (rowtype=SalesOrderRow, rowtype=OfferRow) every substructure is created for that work number. In this case properties under main_structure object in the posted model aren't taken into account.\r\n            <para>\r\n            When include_default_stages=true, each supplied sub_workstage_id is treated as a default (work number 0)\r\n            sub-workstage reference of that row's father in the structure and is replaced with the equivalent\r\n            work-number-specific sub-workstage created during save.\r\n            Supported only for rowType=OfferRow and rowType=SalesOrderRow.\r\n            </para><para>\r\n            This endpoint is not idempotent: it always creates new structure rows, so calling it twice for the same\r\n            work number appends a second set of rows instead of replacing the first. Post the structure once per work\r\n            number, and use the structure update endpoints to modify an existing structure. Work stages are not\r\n            re-created on a repeat call: if the work number already has its root work stage, it is reused, so rows\r\n            written by an earlier call keep pointing at sub-workstages that still exist.\r\n            </para>",
        "operationId": "Product_CreateStructure",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "mainStructure",
            "in": "body",
            "description": "structure model",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.MainStructureOrigin"
            }
          },
          {
            "name": "rowType",
            "in": "query",
            "description": "Set this argument if structure is related to specific work",
            "required": true,
            "type": "string",
            "enum": [
              "None",
              "SalesOrderRow",
              "OfferRow"
            ]
          },
          {
            "name": "row_id",
            "in": "query",
            "description": "Order/offer row id. Set this to corresponding order or offer row id if rowType is other than none. This sets correct work number for structure",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "include_default_stages",
            "in": "query",
            "description": "When true (and rowType is OfferRow or SalesOrderRow), each material row's sub_workstage_id —\r\nwhich must reference one of the default (work number 0) sub-workstages of that row's father in the\r\nstructure (the main structure product for top level rows, the parent row's product for nested rows) —\r\nis remapped to the equivalent work-number-specific sub-workstage that is created during save. This lets\r\nthe default structure's material reservations follow onto the work number's own workstages automatically.\r\nReturns HTTP 400 if a supplied sub_workstage_id does not match any of the father's default\r\nsub-workstages. Default: false.",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/{work_number}/structure": {
      "delete": {
        "tags": [
          "Product"
        ],
        "summary": "Deletes product's structure",
        "operationId": "Product_DeleteStructures",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "work_number",
            "in": "path",
            "description": "Work number. Use 0 for default structure",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/products/structure/{work_number}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get structure by work number",
        "operationId": "Product_GetStructureByWorkNumber",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "work_number",
            "in": "path",
            "description": "Work number. Use 0 for default structure",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStructureTree]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/{work_number}/one_level": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get one level of product structure",
        "operationId": "Product_GetStructureOneLevel",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "work_number",
            "in": "path",
            "description": "Work number. Use 0 for default structure",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStructureTree]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/{work_number}/all_levels": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get complete product structure",
        "operationId": "Product_GetProductStructureAll",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "work_number",
            "in": "path",
            "description": "Work number. Use 0 for default structure",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStructureTree]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/{work_number}/{level}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get specified product structure level",
        "operationId": "Product_GetProductStructureLevel",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "work_number",
            "in": "path",
            "description": "Work number. Use 0 for default structure",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "level",
            "in": "path",
            "description": "Structure level to be fetched",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStructureTree]"
            }
          }
        }
      }
    },
    "/api/products/{id}/units": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Create product unit for existing product",
        "operationId": "Product_CreateProductUnit",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "unit",
            "in": "body",
            "description": "Product unit payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProductUnit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{id}/suppliers": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Create product supplier for existing product",
        "operationId": "Product_CreateProductSupplier",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "supplier",
            "in": "body",
            "description": "Product supplier payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProductSupplier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/collectjobs": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get collect jobs",
        "operationId": "Product_GetCollectJobs",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.person_number",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.states",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.delivery_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.delivery_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_ascending",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CollectJob]"
            }
          }
        }
      }
    },
    "/api/products/collectjobs/{id}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get collect job by id-number.",
        "operationId": "Product_GetCollectJob",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Collect job id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "get_row_shelves",
            "in": "query",
            "description": "Should collect row's include shelves. Optional value, default false.",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.CollectJobRow]"
            }
          }
        }
      }
    },
    "/api/products/collectjobs/collectrow/{id}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get collect row",
        "operationId": "Product_GetCollectJobRow",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Collect row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.CollectJobRow]"
            }
          }
        }
      }
    },
    "/api/products/collectjobs/collectrow/{id}/cancel": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Cancel collection of collect row",
        "operationId": "Product_CancelCollectJobRowCollect",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Collect row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/products/collectjobs/{id}/start": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Start collect job",
        "operationId": "Product_StartCollectJob",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Collect job id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/products/collectjobs/{id}/abort": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Abort collect job",
        "operationId": "Product_AbortCollectJob",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Collect job id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/products/collectjobs/{id}/done": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Done collect job",
        "operationId": "Product_DoneCollectJob",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Collect job id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/products/collecttransactions/{row_id}/shelves": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Return a list of shelves from which shelfs can be collected for the collect transaction",
        "operationId": "Product_CreateCollectTransactionShelfList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "row_id",
            "in": "path",
            "description": "Collect job row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CollectTransactionShelf]"
            }
          }
        }
      }
    },
    "/api/products/collecttransactions/{row_id}/batches": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Return a list of batches that can be collected for the collect transaction",
        "operationId": "Product_CreateCollectTransactionBatchList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "row_id",
            "in": "path",
            "description": "Collect job row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CollectTransactionBatch]"
            }
          }
        }
      }
    },
    "/api/products/collecttransactions/{row_id}/serials": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Return a list of serials that can be collected for the collect transaction",
        "operationId": "Product_CreateCollectTransactionSerialList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "row_id",
            "in": "path",
            "description": "Collect job row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CollectTransactionSerial]"
            }
          }
        }
      }
    },
    "/api/products/collecttransactions/{row_id}/sizes": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Return a list of sizes that can be collected for the collect transaction",
        "operationId": "Product_CreateCollectTransactionSizeList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "row_id",
            "in": "path",
            "description": "Collect job row id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CollectTransactionSize]"
            }
          }
        }
      }
    },
    "/api/products/collecttransactions/collectrow": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Collecting collect row",
        "operationId": "Product_CollectingRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Collect routine proxy",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.CollectRoutine"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/products/{id}/stocktransaction": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Create stock transaction",
        "operationId": "Product_CreateStockTransaction",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Product id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxy",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransaction"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/{stock}/transactions/in": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get body of inward stock transaction",
        "operationId": "Product_CreateInTransaction",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.StockTransactionFull]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/{stock}/transactions/out": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get body of outward stock transaction",
        "operationId": "Product_CreateOutTransaction",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.StockTransactionFull]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/{stock}/transactions/inventory": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get body of inventory stock transaction",
        "operationId": "Product_CreateInventoryTransaction",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.StockTransactionFull]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/{stock}/saldo/{date}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Returns product stock saldo from the given stock at the end of the given date",
        "operationId": "Product_GetProductStockSaldoAtDate",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "date",
            "in": "path",
            "description": "Saldo date",
            "required": true,
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStock]"
            }
          }
        }
      }
    },
    "/api/products/stocks/saldos/date": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Returns paged product stock saldos by filters",
        "operationId": "Product_GetProductStockSaldoPaged",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Timestamp after product saldo should have changed",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Timestamp before product saldo should have changed",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.product_code",
            "in": "query",
            "description": "A list of product codes to filter by",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.stock_number",
            "in": "query",
            "description": "The stock number to filter by",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order by id. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductStock]"
            }
          }
        }
      }
    },
    "/api/products/transactions": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get stock transactions by filters",
        "operationId": "Product_GetTransactions",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.id",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.product_code",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.stock_number",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.modified_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.modified_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.transaction_date_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.transaction_date_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.type",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.source",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.search",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.person",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.work_number",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.getSalesOrderNumber",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.StockTransactionCompact]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Create new stock transaction",
        "operationId": "Product_SaveTransaction",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyTransaction",
            "in": "body",
            "description": "Transaction payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionFull"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/inputforms": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get product input forms",
        "operationId": "Product_GetProductInputForms",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.attribute_code",
            "in": "query",
            "description": "Ominaisuusrajaus syöttölomnakkeen nimikkeille",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductInputForm]"
            }
          }
        }
      }
    },
    "/api/products/complaints": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get a list of complaints/deviations",
        "operationId": "Product_GetComplaints",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.states",
            "in": "query",
            "description": "Complaint states",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.types",
            "in": "query",
            "description": "Complaint types",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.responsible_persons",
            "in": "query",
            "description": "Responsible person numbers",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.numbers",
            "in": "query",
            "description": "Complaint numbers",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.before_date",
            "in": "query",
            "description": "Complaint date before",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.after_date",
            "in": "query",
            "description": "Complaint date after",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.sales_order_number",
            "in": "query",
            "description": "Sales order number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "Responsible person number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.project_number",
            "in": "query",
            "description": "Project number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.product_code",
            "in": "query",
            "description": "Product code",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "description": "Sort field",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_ascending",
            "in": "query",
            "description": "Sort order (True = ASC, False = DESC)",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Complaint]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Create a complaint",
        "operationId": "Product_CreateComplaint",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Complaint payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Complaint"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/products/complaints/production/{worknumber}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get body of a new production complaint by worknumber",
        "operationId": "Product_GetComplaintBodyByWorknumber",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "worknumber",
            "in": "path",
            "description": "Work number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "extras.person_number",
            "in": "query",
            "description": "The person number for the production complaint extras",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "extras.production_hours",
            "in": "query",
            "description": "The production hours for the production complaint extras",
            "required": false,
            "type": "number",
            "format": "double"
          },
          {
            "name": "extras.production_amount",
            "in": "query",
            "description": "The production amount for the production complaint extras",
            "required": false,
            "type": "number",
            "format": "double"
          },
          {
            "name": "extras.production_faulty",
            "in": "query",
            "description": "The production faulty amount for the production complaint extras",
            "required": false,
            "type": "number",
            "format": "double"
          },
          {
            "name": "extras.sub_workstage_id",
            "in": "query",
            "description": "The sub workstage id for the production complaint extras",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "extras.source",
            "in": "query",
            "description": "The source for the production complaint extras",
            "required": false,
            "type": "string",
            "enum": [
              "None",
              "JobStop",
              "JobDone",
              "JobList",
              "MaterialStandard",
              "ProductJobList",
              "JobDetail"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Complaint]"
            }
          }
        }
      }
    },
    "/api/products/collecttransactions": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get list of collect transactions",
        "operationId": "Product_GetCollectTransactionList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.pallet_number",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CollectTransaction]"
            }
          }
        }
      }
    },
    "/api/products/inventory/list/{stock_number}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get paged inventory list by stock number",
        "operationId": "Product_GetInventoryList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "stock_number",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.inputform",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.get_collections",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.sort_order",
            "in": "query",
            "description": "ASC / DESC",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductStockInventory]"
            }
          }
        }
      }
    },
    "/api/products/inventory/list": {
      "put": {
        "tags": [
          "Product"
        ],
        "summary": "Update list inventory rows",
        "operationId": "Product_UpdateTransaction",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyList",
            "in": "body",
            "description": "List containing inventoried rows with serials, batches, sizes if necessary",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.ListInventoryRow"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Collections.Generic.List[System.Int32]]"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/is_package": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Check if the product has a structure type package.",
        "operationId": "Product_ProductIsPackage",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/products/{product_code}/attention_texts/{lemonsoftApplication}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get attention texts as a list for a product and mark them as read if necessary.",
        "operationId": "Product_GetProductTextListAttentionList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "lemonsoftApplication",
            "in": "path",
            "description": "Lemonsoft application number - Offer = 7, Sales order = 8, Purchase order = 9, Production = 12",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/products/{order_number}/attention_texts/purchase_order": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get attention texts as a list for every product in a purchase order and mark them as read if necessary.",
        "operationId": "Product_GetProductTextListAttentionListForPurhcaseOrder",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "description": "Purchase order number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/products/{order_number}/attention_texts/sales_order": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get attention texts as a list for every product in a sales order and mark them as read if necessary.",
        "operationId": "Product_GetProductTextListAttentionListForSalesOrder",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "description": "Sales order number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/production/main_ws/changed": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get a list of recently changed main work stages",
        "description": "Returns main work stages (päätyövaiheet) whose `updated_at` falls within the supplied range. Both `updated_after` and `updated_before` are required. Useful for synchronizing external systems incrementally.",
        "operationId": "Production_GetChangedMainWorkStages",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Inclusive lower bound for the updated_at timestamp (required)",
            "required": true,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Inclusive upper bound for the updated_at timestamp (required)",
            "required": true,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.state",
            "in": "query",
            "description": "Optionally restrict the result to a single state value",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.optimization",
            "in": "query",
            "description": "Toggle optimizations on or off for this endpoint. Default is false.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Production.ProductMainWorkStage]"
            }
          }
        }
      }
    },
    "/api/production/main_ws/sub_ws/available": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get sub work stages that can be started now",
        "description": "Returns sub work stages currently startable (state allows starting and prerequisites are met). Pass an optional `machineCode` to scope the result to a single machine.",
        "operationId": "Production_GetSubWorkStagesCanDo",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "machineCode",
            "in": "query",
            "description": "Optional machine code",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Production.ProductSubWorkStage]"
            }
          }
        }
      }
    },
    "/api/production/workstage": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get main work stages",
        "description": "Returns paged main work stages matching the filter. By default only state = 0 is returned — set `state = -1` to return all states.\r\n            \r\n`only_with_workstages` (bool, default false): by default all rows are returned,\r\nincluding auto-generated stages (e.g. from material clicks). Set explicitly to true\r\nto return only rows that have sub-workstages.\r\n            \r\n`dont_include_passives` (bool, default false): when true, excludes passive work stages\r\n(sub_structure_passive_bit = 1).",
        "operationId": "Production_GetMainWorkStages",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.product_code",
            "in": "query",
            "description": "Filter by product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.worknumber",
            "in": "query",
            "description": "Filter by work number (työnumero)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.id",
            "in": "query",
            "description": "Filter by main work stage id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.main_structure_id",
            "in": "query",
            "description": "Filter by the parent main structure id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sub_structure_id",
            "in": "query",
            "description": "Filter by the parent sub structure id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.product_description",
            "in": "query",
            "description": "Filter by product description (contains match)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.state",
            "in": "query",
            "description": "The state filter for workstages. By default returns workstages with state 0. Set to -1 to return all workstages.",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.only_with_workstages",
            "in": "query",
            "description": "When true, only return work stages that have sub-workstages.\r\nDefault false: all work stages are returned, including auto-generated stages (e.g. from material clicks).\r\nSet explicitly to true to return only work stages that have sub-workstages.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.dont_include_passives",
            "in": "query",
            "description": "When true, exclude passive work stages (sub_structure_passive_bit = 1).\r\nDefault false.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Production.ProductMainWorkStage]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Production"
        ],
        "summary": "Update a main work stage",
        "description": "Updates an existing main work stage and its sub work stages that match an existing id.",
        "operationId": "Production_UpdateWorkstage",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyMainWorkStage",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductMainWorkStage"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Production"
        ],
        "summary": "Create a main work stage",
        "description": "Creates a new main work stage together with its sub work stages in a single request. The work number is generated automatically.",
        "operationId": "Production_CreateWorkStage",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyMainWorkStage",
            "in": "body",
            "description": "The model describing the workstage to be created",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductMainWorkStage"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/production/workstage/{id}": {
      "delete": {
        "tags": [
          "Production"
        ],
        "summary": "Delete a main work stage",
        "operationId": "Production_DeleteWorkStage",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/production/main_ws/{id}": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get a main work stage by id (with sub work stages)",
        "operationId": "Production_GetSingleMainWorkStage",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Main workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Production.ProductMainWorkStage]"
            }
          }
        }
      }
    },
    "/api/production/main_ws/sub_ws": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get sub work stages",
        "description": "Returns paged sub work stages matching the filter. Use `only_startable=true` to scope the result to sub work stages that can be started right now. By default, compilation rows (`sub_workstage_rowtype = 9`) are excluded — set `show_in_compilation=true` to include them.",
        "operationId": "Production_GetSubWorkStages",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.only_startable",
            "in": "query",
            "description": "When true, only sub work stages that can be started right now are returned",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.after_date",
            "in": "query",
            "description": "Filter sub work stages whose planned start time is on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.before_date",
            "in": "query",
            "description": "Filter sub work stages whose planned start time is on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.states",
            "in": "query",
            "description": "Filter by one or more state codes",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.person",
            "in": "query",
            "description": "Filter by the assigned person number. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.read_materials",
            "in": "query",
            "description": "When true, the response includes the materials reserved for each sub work stage",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.worknumbers",
            "in": "query",
            "description": "Filter by one or more work numbers (työnumerot)",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.show_in_compilation",
            "in": "query",
            "description": "Should sub_workstage_rowtype = 9 (in compilation) jobs be included.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.machine_groups",
            "in": "query",
            "description": "Filter by one or more machine group ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.machines",
            "in": "query",
            "description": "Filter by one or more machine codes",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.project_number",
            "in": "query",
            "description": "Filter by project number (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.project_phase_id",
            "in": "query",
            "description": "Filter by project phase id (projektivaihe). For possible values, refer to /api/projects/{number}/phase\r\n[here](#tag/projects/operation/Project_GetPhases)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sales_order_number",
            "in": "query",
            "description": "Filter by sales order number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.only_own_machines",
            "in": "query",
            "description": "When true, only sub work stages on the user's own machines are returned",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.material_code",
            "in": "query",
            "description": "Filter sub work stages whose materials contain the given product code",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.workphases",
            "in": "query",
            "description": "Filter by one or more work phase ids (työvaihekoodit)",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "Filter by the customer number (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "description": "Sort field. Default is \"sub_workstage_start_time\". Accepted shortcuts: id, product_code, state, customer_number, start_time, end_time",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_order",
            "in": "query",
            "description": "Sort order. \"ASC\" (default) or \"DESC\"",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Production.ProductSubWorkStage]"
            }
          }
        }
      }
    },
    "/api/production/main_ws/sub_ws/{id}": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get a sub work stage by id (with materials)",
        "description": "Returns a single sub work stage with its materials and tools. Use the optional toggles to enrich the response:\r\n- `get_material_shelves=true` — include per-shelf breakdowns\r\n- `get_material_batches=true` — include per-batch breakdowns\r\n- `get_material_stock_saldoinfo=true` — include stock saldo info per material",
        "operationId": "Production_GetSingleSubWorkStage",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sub workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "get_material_shelves",
            "in": "query",
            "description": "Include shelves for material consumption for completion entry",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "get_material_batches",
            "in": "query",
            "description": "Include batches for material consumption for completion entry",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "get_material_stock_saldoinfo",
            "in": "query",
            "description": "Include stock_instock and stock_saldo_type properties for materials",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Production.ProductSubWorkStage]"
            }
          }
        }
      }
    },
    "/api/production/{person}/main_ws/sub_ws/{id}/jobhandling": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get a sub work stage's job handling for a person",
        "description": "Returns the data needed for a worker to record work on a sub work stage — pre-populated hours, amounts, default stock and shelf, etc. Use this when seeding the worker UI before starting a job.",
        "operationId": "Production_GetProductionJobHandling",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Sub workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Production.ProductionJobHandling]"
            }
          }
        }
      }
    },
    "/api/production/{work_number}/{person}/main_ws/sub_ws/{id}/start_job": {
      "post": {
        "tags": [
          "Production"
        ],
        "summary": "Start a sub work stage",
        "description": "Starts the sub work stage for the given person and work number. Optionally accepts a machine code, comment, list of selected tools, and a pre-filled batch number.\r\n            \r\n**Return codes (`result` field):**\r\n- 0 — OK\r\n- 1 — Person has already started this work stage\r\n- 2 — Person not found\r\n- 3 — Person has another work stage already started and cannot start a second\r\n- 4 — Person should end other open jobs first",
        "operationId": "Production_StartJob",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "work_number",
            "in": "path",
            "description": "Work number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "person",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Sub workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "productionJobStart",
            "in": "body",
            "description": "Optional values for starting a sub workstage",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProductionJobStart"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Int32]"
            }
          }
        }
      }
    },
    "/api/production/{work_number}/{person}/main_ws/sub_ws/{id}/pause_job": {
      "post": {
        "tags": [
          "Production"
        ],
        "summary": "Pause a sub work stage",
        "description": "Suspends a started sub work stage. The worker can resume it later via start.",
        "operationId": "Production_PauseJob",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "work_number",
            "in": "path",
            "description": "Work number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "person",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Sub workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pauseTime",
            "in": "query",
            "description": "Datetime when work paused",
            "required": true,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "hoursDone",
            "in": "query",
            "description": "Hours done before pause",
            "required": true,
            "type": "number",
            "format": "double"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/production/main_ws/sub_ws/completion_entry": {
      "post": {
        "tags": [
          "Production"
        ],
        "summary": "Job completion entry",
        "description": "Records a completion entry (valmistumiskirjaus) for a sub work stage: produced amount, failed amount, hours, used materials, serial numbers, batches and standard inspections — all in a single request. When `job_done=true`, the sub work stage is marked fully done.\r\n            \r\nFor compilation work numbers, `compilation_amounts` and `failed_compilation_amounts` describe the produced and failed amounts per compilation row.",
        "operationId": "Production_JobDone",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "jobDoneData",
            "in": "body",
            "description": "Job completion entry payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductionJobDone"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/production/{person}/main_ws/sub_ws/{id}/end_job": {
      "post": {
        "tags": [
          "Production"
        ],
        "summary": "End a sub work stage",
        "description": "Legacy end-job endpoint — finalizes a sub work stage with the produced and failed amounts, recording hours, payroll, stock transactions, batches and serial numbers.\r\n            \r\n**Return codes (`result` field):**\r\n- 1000 — all sub work stages for the main work stage are done\r\n- 0000 — only this sub work stage done; others remain open\r\n- 0100 — sub work stage done and a new purchase order was created for the next subcontracting sub work stage",
        "operationId": "Production_EndJob",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Sub workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "postEndJobData",
            "in": "body",
            "description": "POST end job payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Production.PostEndJob"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/production/{person}/main_ws/sub_ws/{id}/bad_production": {
      "post": {
        "tags": [
          "Production"
        ],
        "summary": "Report bad production for a sub work stage",
        "description": "Records a failed amount (hylkytuotanto) against a sub work stage with the given fail codes and free-text description.",
        "operationId": "Production_BadProduction",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "person",
            "in": "path",
            "description": "Person number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Sub workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "amount",
            "in": "query",
            "description": "Amount of bad items",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "description",
            "in": "query",
            "description": "Description of failure",
            "required": true,
            "type": "string"
          },
          {
            "name": "fail_codes",
            "in": "query",
            "description": "Optional fail codelist id:s",
            "required": true,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/production/main_ws/{id}/serials/{amount}": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get new serial numbers for a completion entry",
        "description": "Returns the next `amount` serial numbers for a main work stage, used when recording a completion entry for a serial-tracked product. Each call consumes the numbers from the configured number series.",
        "operationId": "Production_GetNewProductJobSerialNumberList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Mainworkstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "amount",
            "in": "path",
            "description": "Amount",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Production.ProductJobSerialNumber]"
            }
          }
        }
      }
    },
    "/api/production/main_ws/{worknumber}/materials": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get materials for a work number",
        "description": "Returns the materials reserved for the given work number, optionally enriched with sub structure shelf assignments.",
        "operationId": "Production_GetWorknumberMaterials",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "worknumber",
            "in": "path",
            "description": "Worknumber",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "get_sub_structure_shelves",
            "in": "query",
            "description": "Get product sub structure shelves for material",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Production.WorkstageMaterial]"
            }
          }
        }
      }
    },
    "/api/production/main_ws/{main_id}/sub_ws/{sub_id}/consolidation/rows": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get sub work stages of a compilation job",
        "description": "Returns the sub work stages that belong to a compilation job (koontityö), identified by the main and sub work stage id pair.",
        "operationId": "Production_GetProductSubWorkstageListCompilation",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "main_id",
            "in": "path",
            "description": "Main workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "sub_id",
            "in": "path",
            "description": "Sub workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Production.ProductSubWorkStage]"
            }
          }
        }
      }
    },
    "/api/production/main_ws/{id}/picking": {
      "post": {
        "tags": [
          "Production"
        ],
        "summary": "Update picked amounts for work stage materials",
        "description": "Updates the picked (kerätty) amounts on existing material rows of the given main work stage. Does not create new material rows — use PUT `/main_ws/{worknumber}/picking` for that.",
        "operationId": "Production_MaterialPicking",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Main workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pickedStructures",
            "in": "body",
            "description": "Proxy list of picked structures",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.StructurePicking"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/production/main_ws/{worknumber}/picking": {
      "put": {
        "tags": [
          "Production"
        ],
        "summary": "Add new picked materials onto a work number",
        "description": "Creates new material rows on the given work number from a picking operation. Use this when picking materials that were not originally on the work stage's structure.",
        "operationId": "Production_NewMaterialPicking",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "worknumber",
            "in": "path",
            "description": "Worknumber",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pickedStructures",
            "in": "body",
            "description": "Proxy list of picked structures",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.NewStructurePicking"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/production/machines/{code}": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get single machine",
        "operationId": "Production_GetMachine",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "description": "Machine code",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Machine]"
            }
          }
        }
      }
    },
    "/api/production/machines": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get a list of machines",
        "operationId": "Production_ListMachines",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.code",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.description",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.type",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.hour_price",
            "in": "query",
            "required": false,
            "type": "number",
            "format": "double"
          },
          {
            "name": "filter.capacity",
            "in": "query",
            "required": false,
            "type": "number",
            "format": "double"
          },
          {
            "name": "filter.is_disabled",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.group_id",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Machine]"
            }
          }
        }
      }
    },
    "/api/production/{main_id}/links": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get links for a production job based on main workstage id",
        "operationId": "Production_GetProductionLinks",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "main_id",
            "in": "path",
            "description": "Main workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Link]"
            }
          }
        }
      }
    },
    "/api/production/{worknumber}/related_worknumbers": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get related work numbers for a work number",
        "description": "Returns work numbers that are related to the given work number through structure references (e.g. compilation chains, sub-assemblies).",
        "operationId": "Production_GetRelatedWorkNumbers",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "worknumber",
            "in": "path",
            "description": "Work number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Collections.Generic.List[System.Int32]]"
            }
          }
        }
      }
    },
    "/api/production/{subworkstage_id}/material_standard_inspections": {
      "get": {
        "tags": [
          "Production"
        ],
        "summary": "Get material standard inspections for a sub work stage",
        "description": "Returns the quality control standards (laatustandardit) that must be inspected on a sub work stage. Use the result to populate inspection forms before submitting completion entries.",
        "operationId": "Production_GetMaterialStandardInspectionList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "subworkstage_id",
            "in": "path",
            "description": "Sub workstage id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "args.person_number",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "args.serial_number",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "args.batch_number",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.Collections.Generic.List[System.Int32]]"
            }
          }
        }
      }
    },
    "/api/projects": {
      "get": {
        "tags": [
          "Project"
        ],
        "summary": "Get a list of projects",
        "description": "Returns a paged list of projects matching the given filter.\r\n            \r\n**Sorting:** controlled by `sort_field` (database column name, default `project_id`) and `sort_desc`. Falls back to the default field if the column does not exist.\r\n            \r\n**Child collections (`get_lists`):** when true (default), each project is returned with its phases, contacts, and customers populated. Set to false for lighter, header-only responses.\r\n            \r\n**External links (`get_links`):** when true, the project's external links are fetched and attached to each project in the response. Defaults to false.\r\n            \r\n**Active-only (`only_actives`):** when true, only projects with state_number &lt; 90 are returned (filters out closed projects).\r\n            \r\n**Model projects (`show_models`):** when false, template/model projects (project_number = 0) are excluded.",
        "operationId": "Project_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.project_number",
            "in": "query",
            "description": "Filter by project numbers. Accepts a list of project numbers",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.project_type",
            "in": "query",
            "description": "Filter by project types. Accepts a list of project type ids. For possible values, refer to /api/codelist/description?filter.codeListFilter=PROJECT_TYPE\r\n[here](#tag/codelist/operation/Codelist_List)",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.project_state",
            "in": "query",
            "description": "Filter by a single project state. For possible values, refer to /api/settings/states/{state_source}\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "Filter by the project customer's number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.orderer_customer_number",
            "in": "query",
            "description": "Filter by the orderer customer's number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.invoicing_customer_id",
            "in": "query",
            "description": "Filter by the invoicing customer's internal id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.created_before",
            "in": "query",
            "description": "Filter projects created on or before this date (project_date)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.created_after",
            "in": "query",
            "description": "Filter projects created on or after this date (project_date)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter projects last edited on or before this date (edit_date)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter projects last edited on or after this date (edit_date)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.states",
            "in": "query",
            "description": "Filter by a list of project states (alternative to project_state for multi-state filtering)",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.contact_personnumber",
            "in": "query",
            "description": "Filter projects that have the given person number assigned as a project contact",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.show_models",
            "in": "query",
            "description": "When set to false, model/template projects (project_number = 0) are excluded from the result",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.only_actives",
            "in": "query",
            "description": "When set to true, only active projects are returned (state_number &lt; 90)",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.get_links",
            "in": "query",
            "description": "When set to true, external links are fetched and attached to each project in the response",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.costcenter",
            "in": "query",
            "description": "Filter by cost center code (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.get_lists",
            "in": "query",
            "description": "When set to true (default), child collections such as phases, contacts, and customers are included in each project",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "description": "Sort field (database column name). Default is \"project_id\". Common values: project_id, project_date, project_number, project_startdate.\r\nFalls back to default if column does not exist.",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Project]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Project"
        ],
        "summary": "Update an existing project",
        "description": "Update an existing project identified by `project_number`. The project header data, its phases, contacts, customer contacts, invoicing customers, worksite, and external links are all updated in a single call.\r\n            \r\nThis endpoint updates existing child objects only — it does not create new ones. To add new entries, use:\r\n- POST /api/projects/{projectNumber}/phase or POST /api/projects/{projectNumber}/phases for new phases\r\n- POST /api/projects/{number}/links for new links\r\n            \r\n**Phase updates:** each phase in the payload is matched by `project_phase_id`. Its skills are matched by `project_phase_skill_id`, contacts by `project_phase_contact_id`, and expenses by `expense_group_id`. State transitions on phases are applied if `project_phase_state` differs from the current state.\r\n            \r\n**Worksite (`site`):** only updated when either `site.site_key` or `site.site_number` is non-empty. The site is located by `site.site_id`.\r\n            \r\n**Project state:** if `project_state` differs from the current state, the state is transitioned automatically.\r\n            \r\n**Links:** each link in the payload is matched by `id` and updated. If a link does not exist, the request fails with code \"404\".",
        "operationId": "Project_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyProject",
            "in": "body",
            "description": "The project payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Project"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Project"
        ],
        "summary": "Create a new project",
        "description": "Create a new project with optional phases, contacts, customer contacts, invoicing customers, worksite, and external links in a single request.\r\n            \r\nIf `project_number` is provided and a project with that number already exists, the call fails with `project_does_exist`. Omit `project_number` (or set it to 0) to have the system allocate the next number from the project type's series — see /api/NumberSeries for the available series.\r\n            \r\n**Phases:** any `project_phases` entries in the payload are created together with the project. Their `project_phase_skills`, `project_phase_contacts`, and `expenses` are also created in the same call. If `project_phase_state` differs from the phase's initial state, the state is transitioned automatically.\r\n            \r\n**Worksite (`site`):** only created when either `site.site_key` or `site.site_number` is non-empty. The project's `project_worksitecode` and `project_worksitenumber` are filled from the created site.\r\n            \r\n**Project state:** if `project_state` differs from the initial state, the state is transitioned automatically.\r\n            \r\n**Expense entries:** locked expense rows (`expense_locked` = true) are skipped on update. For `expense_group_id` = 1 (salary), `expense_total` is computed from `expense_amount × expense_unitprice` if not provided.",
        "operationId": "Project_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyProject",
            "in": "body",
            "description": "The project payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Project"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/projects/{projectNumber}": {
      "get": {
        "tags": [
          "Project"
        ],
        "summary": "Get a single project",
        "description": "Returns the full project including phases, contacts, customers, and worksite based on the project number.",
        "operationId": "Project_Get",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "projectNumber",
            "in": "path",
            "description": "project number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Project]"
            }
          }
        }
      }
    },
    "/api/projects/{number}/links": {
      "post": {
        "tags": [
          "Project"
        ],
        "summary": "Create a project link",
        "description": "Attach a new external link to the project (file URL, document reference, etc.).",
        "operationId": "Project_CreateLink",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "description": "Project number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "link",
            "in": "body",
            "description": "Project link payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/projects/{number}/links/{link_id}": {
      "delete": {
        "tags": [
          "Project"
        ],
        "summary": "Delete a project link",
        "description": "Remove an external link from the project. The link is matched by both `link_id` and the project's internal id — a link from a different project cannot be deleted via this endpoint.",
        "operationId": "Project_DeleteLink",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "description": "Project number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "link_id",
            "in": "path",
            "description": "Link id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/projects/{id}/links": {
      "get": {
        "tags": [
          "Project"
        ],
        "summary": "Get project links",
        "description": "Returns a paged list of the project's external links. Note that the route parameter is the project's internal id (`project_id`), not the project number.\r\n            \r\n**Filters:** `updated_after` / `updated_before` filter by the link's last-modified date, and `description` filters by substring match on the link description. Invalid dates return code \"400\".",
        "operationId": "Project_GetLinks",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "project id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter links updated on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter links updated on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.description",
            "in": "query",
            "description": "Filter links whose description contains the given text",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Link]"
            }
          }
        }
      }
    },
    "/api/projects/{projectNumber}/phase": {
      "put": {
        "tags": [
          "Project"
        ],
        "summary": "Update a project phase",
        "description": "Update a single existing phase identified by `project_phase_id`. The phase header data, its skills, contacts, and expenses are updated in the same call.\r\n            \r\nThis endpoint updates existing skills, contacts, and expenses only — it does not create new ones. State transitions on the phase are applied if `project_phase_state` differs from the current state.",
        "operationId": "Project_UpdatePhase",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "projectNumber",
            "in": "path",
            "description": "Project number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPhase",
            "in": "body",
            "description": "The project phase payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectPhase"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Project"
        ],
        "summary": "Create a new project phase",
        "description": "Add a single new phase to an existing project. Skills, contacts, and expenses included in the payload are created together with the phase.\r\n            \r\nIf `project_phase_state` differs from the phase's initial state, the state is transitioned automatically.",
        "operationId": "Project_CreatePhase",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "projectNumber",
            "in": "path",
            "description": "Project number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPhase",
            "in": "body",
            "description": "The project phase payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectPhase"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Project"
        ],
        "summary": "Delete a project phase",
        "description": "Remove a phase from the project. The phase is identified by `project_phase_id` in the payload.",
        "operationId": "Project_DeletePhase",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "projectNumber",
            "in": "path",
            "description": "Project number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPhase",
            "in": "body",
            "description": "Phase payload containing project_phase_id",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectPhase"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/projects/phases": {
      "get": {
        "tags": [
          "Project"
        ],
        "summary": "Get project phases",
        "description": "Returns a paged list of project phases matching the given filter. Phases can be queried across projects, or scoped to a single project via `project_id` or `project_number`.",
        "operationId": "Project_GetPhases",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.project_id",
            "in": "query",
            "description": "Filter by the parent project's internal id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.project_number",
            "in": "query",
            "description": "Filter by the parent project's number (projektinumero). When set, the returned phases also have project_number populated with this value",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.state",
            "in": "query",
            "description": "Filter by phase state (vaiheen tila). For possible values, refer to /api/settings/states/{state_source}\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.type",
            "in": "query",
            "description": "Filter by phase type (vaiheen tyyppi). For possible values, refer to /api/codelist/description?filter.codeListFilter=PROJECTPHASES\r\n[here](#tag/codelist/operation/Codelist_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.id",
            "in": "query",
            "description": "Filter by phase id (project_phase_id)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.person_number",
            "in": "query",
            "description": "Filter by the responsible person's number. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.product_code",
            "in": "query",
            "description": "Filter by product code attached to the phase. For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.worknumber",
            "in": "query",
            "description": "Filter by work number (työnumero)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[Lemonsoft.ProjectManagementLibrary.ProjectPhase]"
            }
          }
        }
      }
    },
    "/api/projects/{projectNumber}/phases": {
      "put": {
        "tags": [
          "Project"
        ],
        "summary": "Update multiple project phases",
        "description": "Update several existing phases for the project in a single request. Each phase is matched by `project_phase_id`. Skills, contacts, and expenses are updated as in PUT /api/projects/{projectNumber}/phase.\r\n            \r\nIf any phase id in the payload is not found on the project, the request fails with code \"400\" and the list of missing ids. If the payload is empty, returns code \"400\". If the project is not found, returns code \"404\".",
        "operationId": "Project_UpdatePhases",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "projectNumber",
            "in": "path",
            "description": "Project number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPhases",
            "in": "body",
            "description": "List of project phases",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectPhase"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Project"
        ],
        "summary": "Create multiple project phases",
        "description": "Add several phases to an existing project in a single request. For each phase, its skills, contacts, and expenses are created and state transitions are applied — the same behavior as POST /api/projects/{projectNumber}/phase.\r\n            \r\nIf the payload is empty, returns code \"400\". If the project is not found, returns code \"404\".",
        "operationId": "Project_CreatePhases",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "projectNumber",
            "in": "path",
            "description": "Project number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPhases",
            "in": "body",
            "description": "List of project phases",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectPhase"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Project"
        ],
        "summary": "Delete multiple project phases",
        "description": "Remove several phases from the project in a single request. The payload is a list of phase ids.\r\n            \r\nIf the payload is empty, returns code \"400\". If the project is not found, returns code \"404\".",
        "operationId": "Project_DeletePhases",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "projectNumber",
            "in": "path",
            "description": "Project number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "projectPhaseIds",
            "in": "body",
            "description": "List of project phase Ids",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "format": "int32",
                "type": "integer"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/projects/phase/contact": {
      "post": {
        "tags": [
          "Project"
        ],
        "summary": "Create a new project phase contact",
        "description": "Attach a Lemonsoft person as a contact on the given project phase.",
        "operationId": "Project_CreatePhaseContact",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "projectPhaseId",
            "in": "query",
            "description": "The project phase id the contact is attached to",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "personNumber",
            "in": "query",
            "description": "The contact person's number. For possible values, refer to /api/persons [here](#tag/persons/operation/Person_GetPersons)",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/purchase-invoice": {
      "get": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Get a list of purchase invoices",
        "description": "Retrieve a paginated list of purchase invoices. The response includes full invoice details:\r\nheader data, all invoice rows, payment entries, and circulation information.\r\n            \r\nUse InvoiceFilter to narrow results by supplier, date range, state, or other criteria.\r\nThe default page size is 10 and can be adjusted with the page_size parameter (max 100).\r\n            \r\nSet the include_dimension_descriptions filter to true to populate dimension descriptions on each row:\r\nproject description (project_info.description), lta_description, and cost_center_description.\r\nThe project phase description is always available under project_phase.description regardless of the filter.\r\n            \r\nSet the include_order_targetings filter to true to populate order_targetings on every invoice row.\r\nThe list is populated only for rows whose targeting was recorded by the automatic invoice-targeting\r\nfeature or via the LemonOnline targeting view; it is empty for invoices that were never targeted\r\nthrough those mechanisms (desktop-client legacy targeting paths are not reflected).",
        "operationId": "PurchaseInvoice_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.numbers",
            "in": "query",
            "description": "Filter by invoice numbers. Accepts a list of invoice numbers",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.invoice_type",
            "in": "query",
            "description": "Filter by invoice type (ostolaskulaji). Default: -1 (all types)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.invoice_state",
            "in": "query",
            "description": "Filter by invoice state: 0 = Registered, 1 = Approved, 2 = In payment, 3 = Paid, 4 = In circulation, 5 = Rejected. Default: -1 (all states)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "Filter by supplier's customer number (toimittajan asiakasnumero). Default: -1 (all). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.exported_bit",
            "in": "query",
            "description": "Filter by exported status. When set, returns only invoices matching the exported state",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.description",
            "in": "query",
            "description": "Filter by invoice description. Performs a contains search",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.created_before",
            "in": "query",
            "description": "Filter invoices with invoice date before this date. Default: today + 5 years",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.created_after",
            "in": "query",
            "description": "Filter invoices with invoice date after this date. Default: 1970-01-01",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter invoices modified before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter invoices modified after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.has_external_id",
            "in": "query",
            "description": "When set to true, returns only invoices that have an external_id. When false, returns only invoices without external_id",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.external_id",
            "in": "query",
            "description": "Filter by exact external_id value",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.include_dimension_descriptions",
            "in": "query",
            "description": "When set to true, dimension descriptions (project, LTA, cost center, project phase) are included in the response for each invoice row",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.include_order_targetings",
            "in": "query",
            "description": "When true, populates order_targetings on every invoice row. The list is populated only for\r\nrows whose targeting was recorded by the automatic invoice-targeting feature or via the\r\nLemonOnline targeting view; it is empty for invoices that were never targeted through those\r\nmechanisms (desktop-client legacy targeting paths are not reflected). Default false.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.row_project_number",
            "in": "query",
            "description": "Filter by project number on invoice rows (projektinumero). Default: -1 (all). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_field",
            "in": "query",
            "description": "Sort field (database column name). Default is \"purchase_invoice_id\". Common values: purchase_invoice_id, purchase_invoice_date, purchase_invoice_number, purchase_invoice_duedate.\r\nFalls back to default if column does not exist.",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PurchaseInvoice]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Update an existing purchase invoice",
        "description": "Update a purchase invoice's header data, existing rows, payments, and circulation entries.\r\nThe invoice is identified by the number field in the request body.\r\n            \r\nThis endpoint updates only existing child objects (rows, payments, circulations) that match by id.\r\nTo add new rows, payments, or circulations, use the dedicated POST endpoints.\r\n            \r\nCirculation entries are validated before saving.\r\nAfter update, row totals and the invoice total are automatically recalculated.",
        "operationId": "PurchaseInvoice_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyInvoice",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoice"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Create a new purchase invoice",
        "description": "Create a new purchase invoice with optional rows, payments, and circulation entries in a single request.\r\nThe invoice number is always auto-assigned by the system.\r\n            \r\nCirculation entries are validated before saving: each circulation_person must have a valid person number\r\nthat exists in the system, and circulation_type must be 0–2.\r\n            \r\nAfter creation, row totals and the invoice total are automatically recalculated.",
        "operationId": "PurchaseInvoice_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyInvoice",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoice"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/{invoiceNumber}": {
      "get": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Get a single purchase invoice by number",
        "description": "Retrieve a single purchase invoice with all rows, payments, and circulation entries.\r\nThe online_url field provides a direct link for viewing the invoice in LemonOnline.",
        "operationId": "PurchaseInvoice_Get",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "invoiceNumber",
            "in": "path",
            "description": "The purchase invoice number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "include_order_targetings",
            "in": "query",
            "description": "When true, populates order_targetings on every invoice row. The list is populated only for\r\nrows whose targeting was recorded by the automatic invoice-targeting feature or via the\r\nLemonOnline targeting view; it is empty for invoices that were never targeted through those\r\nmechanisms (desktop-client legacy targeting paths are not reflected). Default false.",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PurchaseInvoice]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Delete a purchase invoice",
        "description": "Permanently delete a purchase invoice and all its related data (rows, payments, circulations).",
        "operationId": "PurchaseInvoice_Delete",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "invoiceNumber",
            "in": "path",
            "description": "The purchase invoice number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/{invoiceNumber}/orderrows": {
      "get": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Get purchase order rows related to the invoice",
        "description": "Retrieve the purchase order rows that are linked to the specified purchase invoice.",
        "operationId": "PurchaseInvoice_GetPurhaseOrderRows",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "invoiceNumber",
            "in": "path",
            "description": "The purchase invoice number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PurchaseOrderRow]"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/{invoiceNumber}/attachments": {
      "post": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Add image to purchase invoice",
        "description": "This endpoint accepts file uploads where the Content-type is set to multipart/form-data.\r\nFor example, use FormData when sending requests from JavaScript (https://developer.mozilla.org/en-US/docs/Web/API/FormData), or MultipartFormDataContent in C# (https://learn.microsoft.com/en-us/dotnet/api/system.net.http.multipartformdatacontent?view=net-7.0)\r\nSupported file types and their corresponding MIME content types:\r\n- PDF (application/pdf)\r\n- JPEG (image/jpeg)\r\n- PNG (image/png)\r\n- GIF (image/gif)\r\n- BMP (image/bmp)\r\n            \r\nRemember to set Content-type header when sending requests to this endpoint",
        "operationId": "PurchaseInvoice_CreateAttachment",
        "consumes": [
          "multipart/form-data"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "invoiceNumber",
            "in": "path",
            "description": "The number of the invoice",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "attachment",
            "in": "formData",
            "description": "Attachment to upload",
            "required": true,
            "type": "file"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/{invoiceNumber}/locked": {
      "get": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Get invoice's locked state",
        "description": "Use this endpoint to check if invoice has already been moved to accounting and has been locked.",
        "operationId": "PurchaseInvoice_GetReadOnlyState",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "invoiceNumber",
            "in": "path",
            "description": "Invoice's number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PurchaseInvoiceReadonly]"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/{invoiceNumber}/row": {
      "post": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Add a new row to a purchase invoice",
        "description": "Add a single row to an existing purchase invoice. The supplier's default purchase account\r\nis automatically applied if available.\r\n            \r\nAfter adding, row totals and the invoice total are automatically recalculated.",
        "operationId": "PurchaseInvoice_AddInvoiceRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "invoiceNumber",
            "in": "path",
            "description": "The purchase invoice number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyRow",
            "in": "body",
            "description": "The purchase invoice row payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Delete a purchase invoice row",
        "description": "Remove a row from an existing purchase invoice. The row is identified by the id field in the request body.\r\nAfter deletion, row totals and the invoice total are automatically recalculated.",
        "operationId": "PurchaseInvoice_DeleteInvoiceRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyRow",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceRow"
            }
          },
          {
            "name": "invoiceNumber",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/{invoiceNumber}/payment": {
      "post": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Add a new payment to a purchase invoice",
        "description": "Add a single payment entry to an existing purchase invoice.",
        "operationId": "PurchaseInvoice_AddInvoicePayment",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "invoiceNumber",
            "in": "path",
            "description": "The purchase invoice number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyPayment",
            "in": "body",
            "description": "The purchase invoice payment payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoicePayment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Delete a purchase invoice payment",
        "description": "Remove a payment entry from an existing purchase invoice. The payment is identified by the id\r\nand invoice_id fields in the request body.",
        "operationId": "PurchaseInvoice_DeletePaymentRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyPayment",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoicePayment"
            }
          },
          {
            "name": "invoiceNumber",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/{invoiceNumber}/circulation": {
      "post": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Add a new circulation entry to a purchase invoice",
        "description": "Add a single circulation entry to an existing purchase invoice.\r\n            \r\nThe circulation_person.number must be a valid person number that exists in the system.\r\nThe circulation_type.type must be 0 (Inspector), 1 (Approver), or 2 (Informative).\r\nThe circulation_state.state must be 0 (Waiting), 1 (Approved), or 2 (Rejected).",
        "operationId": "PurchaseInvoice_AddInvoiceCirculation",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "invoiceNumber",
            "in": "path",
            "description": "The purchase invoice number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyCirculation",
            "in": "body",
            "description": "The purchase invoice circulation payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceCirculation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Delete a purchase invoice circulation entry",
        "description": "Remove a circulation entry from an existing purchase invoice. The circulation is identified by the id\r\nand invoice_id fields in the request body.",
        "operationId": "PurchaseInvoice_DeleteCirculation",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyCirculation",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceCirculation"
            }
          },
          {
            "name": "invoiceNumber",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/attachments_paged": {
      "get": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Get attachments of multiple purchase invoices as a ZIP file",
        "description": "Retrieve attachments for multiple purchase invoices based on filters. Returns a ZIP file\r\ncontaining all matching attachments. Each file in the ZIP is named with the pattern:\r\n{invoice_id}_{invoice_number}_{description}{extension}.\r\n            \r\nUse the X-next-page response header to determine if more pages are available.\r\nReturns HTTP 204 No Content if no invoices or attachments match the filter.",
        "operationId": "PurchaseInvoice_GetInvoiceAttachmentsPaged",
        "consumes": [],
        "produces": [
          "application/octet-stream"
        ],
        "parameters": [
          {
            "name": "filter.numbers",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.invoice_type",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.invoice_state",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.exported_bit",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.description",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.created_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.created_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a ZIP file",
            "schema": {
              "format": "binary",
              "type": "file"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/attachments": {
      "get": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Get attachments of a single purchase invoice as a ZIP file",
        "description": "Retrieve all attachments for a single purchase invoice, identified by either id or invoiceNumber.\r\nReturns a ZIP file containing all attachments.\r\n            \r\nReturns HTTP 204 No Content if the invoice is not found or has no attachments.",
        "operationId": "PurchaseInvoice_GetInvoiceAttachments",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The purchase invoice id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "invoiceNumber",
            "in": "query",
            "description": "The purchase invoice number",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/System.Web.Http.Results.ResponseMessageResult"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/{invoiceNumber}/duplicate-check": {
      "get": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Check if a purchase invoice has potential duplicates",
        "description": "Returns previously recorded invoices from the same supplier whose supplier invoice number\r\nor reference matches the given invoice. The current invoice is excluded from the result;\r\nan unknown invoice number returns an empty result. The flags and total_match_count cover\r\nthe full match set; matching_invoices is a sample of at most 5 rows with\r\nsupplier-invoice-number matches first, then newest by invoice date.",
        "operationId": "PurchaseInvoice_GetDuplicateCheck",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "invoiceNumber",
            "in": "path",
            "description": "The purchase invoice number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PurchaseInvoiceDuplicateCheck]"
            }
          }
        }
      }
    },
    "/api/purchase-invoice/rows": {
      "get": {
        "tags": [
          "PurchaseInvoice"
        ],
        "summary": "Search purchase invoice rows",
        "description": "Retrieve purchase invoice rows across invoices, newest first. Rows use the same\r\nPurchaseInvoiceRow model as the other purchase invoice endpoints.\r\n            \r\nAll filters are optional and combine freely: a supplier number alone returns that supplier's\r\nmost recent rows; states narrows to invoices in the given PurchaseInvoice_State values;\r\ndescription narrows to rows whose description contains the given text.\r\n            \r\nRows are ordered by invoice date and row id descending, so paging is stable. The default page\r\nsize is 10 and can be adjusted with the page_size parameter (max 100).\r\n            \r\nComposite needs are served by repeated calls with different filters: for example a per-product\r\nprice sample is one call with the product_codes batch and a date range, sampled by the caller.\r\n            \r\nAmounts (unitprice, row_net, total) are in the invoice's own currency, which the row does not\r\ncarry. A price sample spanning several suppliers may therefore mix currencies; read the\r\ninvoices themselves via /api/purchase-invoice when the currency matters.",
        "operationId": "PurchaseInvoice_SearchRows",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.supplier_number",
            "in": "query",
            "description": "Filter by the supplier's customer number (toimittajan asiakasnumero).\r\nFor possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.product_codes",
            "in": "query",
            "description": "Filter by product codes. Without this filter rows are returned regardless of product code",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.date_from",
            "in": "query",
            "description": "Filter rows whose invoice date is on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.date_to",
            "in": "query",
            "description": "Filter rows whose invoice date is on or before this date. The whole day is included",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.states",
            "in": "query",
            "description": "Filter by invoice states (PurchaseInvoice_State values). Without this filter rows are\r\nreturned regardless of the invoice state. Values outside the enum are not an error, they\r\nsimply match nothing, so a mistyped state yields an empty result rather than a failure",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.description",
            "in": "query",
            "description": "Filter by row description. Matches rows whose description contains the given text",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PurchaseInvoiceRow]"
            }
          }
        }
      }
    },
    "/api/purchaseorders": {
      "get": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Get a paged list of purchase orders",
        "description": "Returns a filtered, paged list of purchase orders (ostotilaukset). Each order is returned with\r\nits order rows. For rows that are batch-follow-ups, the recorded batch numbers from the\r\ndelivery transactions are included in the response.\r\n            \r\nUse the filter parameters to narrow the result set by state, supplier customer, type,\r\norder date range, order numbers, or last-edited date range. Set `only_allowed_types` to limit\r\nthe result to purchase order types the user is currently allowed to use.",
        "operationId": "PurchaseOrder_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.state",
            "in": "query",
            "description": "Filter by purchase order state (tila). For possible values, refer to /api/settings/states/2\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.customer_number",
            "in": "query",
            "description": "Filter by supplier customer number (asiakasnumero). For possible values, refer to /api/customers. The customer_number's value corresponds to the number returned by /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.type",
            "in": "query",
            "description": "Filter by purchase order type (laji). For possible values, refer to /api/settings/purchaseorder_numberseries\r\n[here](#tag/Settings/operation/Settings_GetPurchaseOrderNumberseries)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.ordered_before",
            "in": "query",
            "description": "Filter purchase orders with order date before this date (päiväys)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.ordered_after",
            "in": "query",
            "description": "Filter purchase orders with order date after this date (päiväys)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.order_numbers",
            "in": "query",
            "description": "Filter by purchase order numbers. Accepts a list of order numbers",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter purchase orders with last-edited timestamp before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter purchase orders with last-edited timestamp after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.only_allowed_types",
            "in": "query",
            "description": "When set to true, limits the result to purchase order types the current user is allowed to use",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.skip_models",
            "in": "query",
            "description": "When set to true, excludes purchase order templates (negative or zero order numbers) from the result",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "When set to true, the result is sorted in descending order by purchase order id",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PurchaseOrder]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Update an existing purchase order",
        "description": "Updates an existing purchase order identified by `purchase_order_id`. Only rows whose\r\n`id` matches an existing row on the order are updated — this endpoint does not add new\r\nrows. To add a new row, use POST `/api/purchaseorders/{orderNumber}/orderrow`.\r\n            \r\n**Supplier data handling (customerdata_from_payload):**\r\n- When true (default): Supplier and delivery customer data from the request payload is used as-is.\r\n- When false: The system retrieves supplier data from the customer registry based on\r\n  `customer_number` (supplier) and `delivery_customer_number` (delivery customer).\r\n            \r\n**Row delivery handling:**\r\nWhen a row's `delivered` value increases, the system recalculates the row amount and writes\r\na delivery transaction. A new delivery info record is created automatically if any row has\r\n`delivered &gt; 0`. JT/post-delivery is forced to false when the company setting disallows it.\r\n            \r\n**autofill_product:** When true on a row, product-related fields (price, tax rate, account,\r\ncost center, LTA, discounts) are resolved from the customer/product registry and applied\r\nto the row. Non-empty fields from the payload still override the resolved values.\r\n            \r\nLinks provided in the payload update existing links by id; new links are not created.",
        "operationId": "PurchaseOrder_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order",
            "in": "body",
            "description": "The purchase order with updated values",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrder"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Create a new purchase order",
        "description": "Creates a new purchase order with optional rows, delivery info, and links in a single request.\r\n            \r\n**Supplier data handling (customerdata_from_payload):**\r\n- When true (default): Supplier and delivery customer data from the request payload is used as-is.\r\n- When false: The system retrieves supplier data from the customer registry based on\r\n  `customer_number` (supplier) and `delivery_customer_number` (delivery customer).\r\n            \r\n**Templated creation (copy_from_order):**\r\nSetting `copy_from_order` to an existing order number creates the new order from that\r\ntemplate — header data is copied from the source order before the payload is applied.\r\n            \r\n**Row delivery handling:**\r\nIf any row has `delivered &gt; 0`, a delivery info record is created automatically and a\r\ndelivery stock transaction is written. Rows with batch numbers or serial numbers have\r\ntheir shelf list rebuilt from the provided `shelf` field. JT/post-delivery is forced to\r\nfalse when the company setting disallows it.\r\n            \r\n**autofill_product:** When true on a row, product-related fields (price, tax rate, account,\r\ncost center, LTA, discounts) are resolved from the customer/product registry and applied\r\nto the row. Non-empty fields from the payload still override the resolved values.",
        "operationId": "PurchaseOrder_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order",
            "in": "body",
            "description": "The purchase order to create",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrder"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/purchaseorders/{orderNumber}": {
      "get": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Get a single purchase order",
        "description": "Returns a single purchase order by its order number, including its order rows with\r\nproduct-related data. The response shape uses ListResponse with a single result.",
        "operationId": "PurchaseOrder_GetOrder",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "description": "The purchase order number to fetch",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PurchaseOrder]"
            }
          }
        }
      }
    },
    "/api/purchaseorders/changed": {
      "get": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Get purchase orders changed after a given date",
        "description": "Returns all purchase orders whose last-modified timestamp is on or after the given date.\r\nUseful for incremental synchronization scenarios where the consumer needs only the\r\norders that have changed since a previous sync.",
        "operationId": "PurchaseOrder_GetChangedOrders",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "changedDate",
            "in": "query",
            "description": "Lower bound for the order's last-modified timestamp",
            "required": true,
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PurchaseOrder]"
            }
          }
        }
      }
    },
    "/api/purchaseorders/{orderNumber}/orderrow": {
      "post": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Add a new row to a purchase order",
        "description": "Appends a new order row to an existing purchase order identified by its order number.\r\n            \r\nIf the new row has `delivered &gt; 0`, a delivery info record is created and a delivery\r\nstock transaction is written. Rows with existing batch numbers or serials have their\r\nshelf list rebuilt from the provided `shelf` field.\r\n            \r\n**autofill_product:** When true, product-related fields (price, tax rate, account,\r\ncost center, LTA, discounts) are resolved from the customer/product registry and\r\napplied to the row. Non-empty fields from the payload still override the resolved values.",
        "operationId": "PurchaseOrder_AddOrderRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "description": "The purchase order number to add the row to",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyRow",
            "in": "body",
            "description": "The order row to add",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/purchaseorders/orderrow": {
      "delete": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Delete a purchase order row",
        "description": "Removes a row from an existing purchase order. The row is identified by its `id` and\r\nthe parent order is identified by `purchase_order_id` in the payload. The order totals\r\nare recalculated after the row is removed.",
        "operationId": "PurchaseOrder_DeleteRow",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyRow",
            "in": "body",
            "description": "The row to delete (id + purchase_order_id required)",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderRow"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/purchaseorders/pallet/{pallet_id}": {
      "get": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Get a single delivery pallet",
        "description": "Returns a delivery pallet (toimituslava) by its id, including its pallet rows.",
        "operationId": "PurchaseOrder_GetPallet",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "pallet_id",
            "in": "path",
            "description": "The id of the delivery pallet",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.OrderDeliveryPallet]"
            }
          }
        }
      }
    },
    "/api/purchaseorders/pallet": {
      "put": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Update an existing delivery pallet",
        "description": "Updates a delivery pallet identified by `order_delivery_pallet_id`. Pallet rows are\r\nmatched by `pallet_row_id`: existing rows are updated, and rows without a matching id\r\nare added as new rows on the pallet.",
        "operationId": "PurchaseOrder_UpdatePallet",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "pallet",
            "in": "body",
            "description": "The pallet with updated values and rows",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryPallet"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Create a new delivery pallet",
        "description": "Creates a new delivery pallet (toimituslava) along with its pallet rows. The\r\n`order_delivery_pallet_id` must not refer to an existing pallet; if it does, the\r\ncall returns an error.",
        "operationId": "PurchaseOrder_CreatePallet",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "pallet",
            "in": "body",
            "description": "The pallet to create, including its rows",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryPallet"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/purchaseorders/{order_id}/newdeliveryinfo": {
      "get": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Get a template body for a new delivery info on a purchase order",
        "description": "Creates and returns an initialized delivery info (toimitustiedot) object for the given\r\npurchase order. The returned object can be modified and POSTed back as part of a\r\npurchase order create or update request.",
        "operationId": "PurchaseOrder_GetNewDeliveryInfo",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "description": "The id of the purchase order",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.OrderDeliveryInfo]"
            }
          }
        }
      }
    },
    "/api/purchaseorders/delivery_rows": {
      "get": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Get a paged list of purchase order delivery rows",
        "description": "Returns the delivery rows (toimitusrivit) associated with purchase orders. Each delivery\r\nrow represents a single delivery transaction recorded against a purchase order row, with\r\nthe delivered amount, delivery date, consignment, reference, and related stock and\r\ninvoice ids.",
        "operationId": "PurchaseOrder_GetDeliveryRows",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.delivery_id",
            "in": "query",
            "description": "Filter by delivery row id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.orderrow_id",
            "in": "query",
            "description": "Filter by the id of the purchase order row the delivery row belongs to",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.order_number",
            "in": "query",
            "description": "Filter by purchase order number (ostotilausnumero)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_date_before",
            "in": "query",
            "description": "Filter delivery rows with delivery date before this date (toimituspäivä)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.delivery_date_after",
            "in": "query",
            "description": "Filter delivery rows with delivery date after this date (toimituspäivä)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.delivery_amount",
            "in": "query",
            "description": "Filter by delivered amount",
            "required": false,
            "type": "number",
            "format": "double"
          },
          {
            "name": "filter.delivery_consignment",
            "in": "query",
            "description": "Filter by delivery consignment / shipper (lähettäjä). Matches when the field contains the given value",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.delivery_reference",
            "in": "query",
            "description": "Filter by delivery reference (lähetyksen viite). Exact match",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.delivery_stock_id",
            "in": "query",
            "description": "Filter by the inward stock transaction id for the delivery row",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_invoice_id",
            "in": "query",
            "description": "Filter by the invoice id for the delivery row",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.deliveryinfo_id",
            "in": "query",
            "description": "Filter by the related delivery info id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_stock_id_out",
            "in": "query",
            "description": "Filter by the outward stock transaction id for the delivery row",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "When set to true, the result is sorted in descending order by purchase delivery id",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PurchaseDeliveryRow]"
            }
          }
        }
      }
    },
    "/api/purchaseorders/deliveryinfo": {
      "get": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Get a paged list of purchase order delivery info entries",
        "description": "Returns delivery info (toimitustiedot) records associated with purchase orders. Each\r\ndelivery info represents a delivery event with metadata such as delivery date, consignment,\r\ndescription, package count, forwarder, and instructions.",
        "operationId": "PurchaseOrder_GetDeliveryInfo",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.id",
            "in": "query",
            "description": "Filter by delivery info id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.order_number",
            "in": "query",
            "description": "Filter by purchase order number (ostotilausnumero)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.state",
            "in": "query",
            "description": "Filter by delivery info state (tila)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.deliveryinfo_date_before",
            "in": "query",
            "description": "Filter delivery info entries with delivery date before this date (toimituspäivä)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.deliveryinfo_date_after",
            "in": "query",
            "description": "Filter delivery info entries with delivery date after this date (toimituspäivä)",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.method",
            "in": "query",
            "description": "Filter by delivery method (toimitustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_METHODS\r\n[here](#tag/codelist/operation/Codelist_List)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.description",
            "in": "query",
            "description": "Filter by delivery description (sisältö). Matches when the field contains the given value",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.consignment",
            "in": "query",
            "description": "Filter by consignment number (rahtikirja). Matches when the field contains the given value",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.departure",
            "in": "query",
            "description": "Filter by departure location (lähtöpaikka). Matches when the field contains the given value",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.forwarder",
            "in": "query",
            "description": "Filter by forwarder (huolitsija). Matches when the field contains the given value",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.instructions",
            "in": "query",
            "description": "Filter by delivery instructions (kuljetusohjeet). Matches when the field contains the given value",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.info1",
            "in": "query",
            "description": "Filter by additional info field 1 (muut tiedot). Matches when the field contains the given value",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.info2",
            "in": "query",
            "description": "Filter by additional info field 2 (varauma). Matches when the field contains the given value",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.packages",
            "in": "query",
            "description": "Filter by number of shipment units (kollit)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "When set to true, the result is sorted in descending order by purchase delivery id",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.OrderDeliveryInfo]"
            }
          }
        }
      }
    },
    "/api/purchaseorders/orderrow/oldestopen": {
      "get": {
        "tags": [
          "PurchaseOrder"
        ],
        "summary": "Get the oldest open purchase order row for a product and supplier",
        "description": "Returns the oldest still-open purchase order row for the given product code and supplier\r\ncustomer number. The `skipCount` parameter can be used to skip the N oldest matching rows\r\n— useful when iterating multiple candidate rows. The response includes any associated\r\nserial numbers, batch numbers, and size amounts for the row.",
        "operationId": "PurchaseOrder_GetPurchaseOrderRowOldestOpen",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "productCode",
            "in": "query",
            "description": "The product code to search for",
            "required": true,
            "type": "string"
          },
          {
            "name": "supplierNumber",
            "in": "query",
            "description": "The supplier customer number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "skipCount",
            "in": "query",
            "description": "Number of oldest matching rows to skip",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PurchaseOrderRow]"
            }
          }
        }
      }
    },
    "/api/salary/project/{project_number}": {
      "get": {
        "tags": [
          "Salary"
        ],
        "summary": "Get a list of a project's salaries",
        "description": "Returns salary totals booked on a project (projektin palkat), aggregated by payment date and form of salary.\r\n            \r\nThe date range is optional:\r\n- **start_date** defaults to one year prior to the current date when omitted\r\n- **end_date** defaults to the current date when omitted\r\n            \r\nNote that **start_date** and **end_date** filter the results by the salaries' payment date, while\r\n**period_start_date** and **period_end_date** in the response describe the salary periods (palkkakausi)\r\nthe aggregated salaries are paid for. The period dates are only resolved when **include_period_dates**\r\nis set to true, because resolving them requires an additional query.\r\n            \r\nSince a single row aggregates several salaries (see **ids**), which may belong to different persons and\r\nperiods, **period_start_date** is the earliest start date and **period_end_date** the latest end date of\r\nthe aggregated salaries.",
        "operationId": "Salary_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "project_number",
            "in": "path",
            "description": "Requested project's number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "Start date for queried salaries. If a start date is not provided, it defaults to one year prior to the current date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "End date for queried salaries. If a date is not provided, the current date is used as the default",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "include_period_dates",
            "in": "query",
            "description": "When true, the salary period dates (period_start_date and period_end_date) are resolved for every returned row. Defaults to false, in which case the period dates are returned as null",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProjectSalaryProxy]"
            }
          }
        }
      }
    },
    "/api/salary/form_of_salary": {
      "get": {
        "tags": [
          "Salary"
        ],
        "summary": "Get a list of forms of salary",
        "description": "Returns the catalog of forms of salary (palkkalajit) configured in the system. Each form of salary defines how a salary row is taxed, accounted for, and calculated.\r\n            \r\nThe optional query parameters narrow the result set:\r\n- **id** matches a single form of salary by its internal ID\r\n- **number** matches by the form of salary number (palkkalajinumero)\r\n- **description** matches by a case-insensitive substring of the description",
        "operationId": "Salary_ListFormOfSalaries",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Filter forms of salary by id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "number",
            "in": "query",
            "description": "Filter forms of salary by number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "description",
            "in": "query",
            "description": "Filter forms of salary by description (case-insensitive substring match)",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.FormOfSalary]"
            }
          }
        }
      }
    },
    "/api/salary/salaries": {
      "get": {
        "tags": [
          "Salary"
        ],
        "summary": "Get a paged list of a person's salaries",
        "description": "Returns the salaries of the person specified by `filter.person_number`, including the salary rows.\r\n            \r\n**Access rules:**\r\n- A user can always fetch their own salaries.\r\n- Fetching another person's salaries requires both a WPL or OPL license and the Payroll role (palkanlaskija). Requests without these return a 403 error in the response body.\r\n            \r\nBy default only approved salaries are returned. Set `filter.only_approved` to false to include unapproved drafts.",
        "operationId": "Salary_GetSalaries",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.person_number",
            "in": "query",
            "description": "Filter salaries by person number (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.only_approved",
            "in": "query",
            "description": "When set to true (default), only approved salaries are returned. When false, all salaries (including unapproved drafts) are returned",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Salary]"
            }
          }
        }
      }
    },
    "/api/salary/cumulative": {
      "get": {
        "tags": [
          "Salary"
        ],
        "summary": "Get a person's cumulative salary totals from the start of the year",
        "description": "Returns the cumulative salary, benefits, compensations, taxes, and insurance contributions for a person, summed across all salaries from the beginning of the year up to (and including) `filter.before`.\r\n            \r\n**Access rules:**\r\n- A user can always fetch their own cumulative totals.\r\n- Fetching another person's cumulative totals requires a WPL or OPL license. Requests without it return a 403 error in the response body.\r\n            \r\nThe response is a single `Salary` object where only the cumulative summary fields are populated — the `rows` collection is not returned.",
        "operationId": "Salary_GetCumulativeSumSalary",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.person_number",
            "in": "query",
            "description": "The person number whose cumulative salary totals are queried (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.before",
            "in": "query",
            "description": "Cumulative totals are calculated for salaries with a payment date before this date (defaults to the current date)",
            "required": false,
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Salary]"
            }
          }
        }
      }
    },
    "/api/salary/form_of_salary_attributes": {
      "get": {
        "tags": [
          "Salary"
        ],
        "summary": "Get a list of all form of salary attributes",
        "description": "Returns all attributes that can be linked to a form of salary (palkkalajin attribuutit). Attributes are used to classify forms of salary for reporting and calculation purposes.",
        "operationId": "Salary_ListFormOfSalaryAttributes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.FormOfSalaryAttribute]"
            }
          }
        }
      }
    },
    "/api/settings/salaries/grades/vehicles": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get vehicle pay grades",
        "operationId": "Settings_GetVehicles",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PayGrade]"
            }
          }
        }
      }
    },
    "/api/settings/salaries/grades/{attribute_id}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get pay grades for grade attribute",
        "operationId": "Settings_GetFosList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "attribute_id",
            "in": "path",
            "description": "Pay grade attribute",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PayGrade]"
            }
          }
        }
      }
    },
    "/api/settings/functions/{id}/{name}/{personal}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get function setting",
        "operationId": "Settings_GetFunctionSetting",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Function ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "name",
            "in": "path",
            "description": "Function name",
            "required": true,
            "type": "string"
          },
          {
            "name": "personal",
            "in": "path",
            "description": "is personal setting",
            "required": true,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/settings/functions": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Get multiple function settings",
        "operationId": "Settings_GetFunctionSettingsList",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filters",
            "in": "body",
            "description": "Filter",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.QueryFilters.FunctionSettingFilter"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.FunctionSettingValue]"
            }
          }
        }
      }
    },
    "/api/settings/costcenters": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get costcenters",
        "operationId": "Settings_GetCostCenters",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.level",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.search",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.also_passives",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CostCenter]"
            }
          }
        }
      }
    },
    "/api/settings/costcenters/levels": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get costcenter levels",
        "operationId": "Settings_GetCostCenterLevels",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CostCenterLevel]"
            }
          }
        }
      }
    },
    "/api/settings/costcenters/suggestion": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get suggested costcenter",
        "operationId": "Settings_GetCostCenterSuggestion",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.formofsalary",
            "in": "query",
            "description": "Form of salary number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.person",
            "in": "query",
            "description": "Person number",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.customer",
            "in": "query",
            "description": "Customer number",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/settings/ltas": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get LTAs",
        "operationId": "Settings_GetLtas",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.also_passives",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.LtaDimension]"
            }
          }
        }
      }
    },
    "/api/settings/absence_reasons/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get absence reasons",
        "operationId": "Settings_GetPersonAbsenceReasons",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "FIN/ENG/SWE",
            "required": true,
            "type": "string"
          },
          {
            "name": "postingGroupNumber",
            "in": "query",
            "description": "Payroll posting group number from person, optional",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodeBase]"
            }
          }
        }
      }
    },
    "/api/settings/companylocations": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get company locations",
        "operationId": "Settings_GetCompanyLocationList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CompanyLocation]"
            }
          }
        }
      }
    },
    "/api/settings/departments": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get departments",
        "operationId": "Settings_GetDepartmentList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodeBase]"
            }
          }
        }
      }
    },
    "/api/settings/project_numberseries": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get project numberseries",
        "operationId": "Settings_GetProjectNumberseries",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.NumberSeriesProject]"
            }
          }
        }
      }
    },
    "/api/settings/salesorder_numberseries": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get all salesorder numberseries",
        "operationId": "Settings_GetSalesOrderNumberseries",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesOrderNumberseries]"
            }
          }
        }
      }
    },
    "/api/settings/salesorder_numberseries/allowed": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get salesorder numberseries that are allowed for user",
        "operationId": "Settings_GetSalesOrderNumberseriesAllowed",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesOrderNumberseries]"
            }
          }
        }
      }
    },
    "/api/settings/purchaseorder_numberseries": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get all purchase order numberseries",
        "operationId": "Settings_GetPurchaseOrderNumberseries",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PurchaseOrderNumberseries]"
            }
          }
        }
      }
    },
    "/api/settings/purchaseorder_numberseries/allowed": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get purchase order numberseries that are allowed to user",
        "operationId": "Settings_GetPurchaseOrderNumberseriesAllowed",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PurchaseOrderNumberseries]"
            }
          }
        }
      }
    },
    "/api/settings/states/{state_source}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get states",
        "description": "State source:\r\n0 = Project states,\r\n1 = Project phase states,\r\n2 = Sales order states,\r\n3 = Sales order row states",
        "operationId": "Settings_GetStateList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "state_source",
            "in": "path",
            "description": "State source",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.State]"
            }
          }
        }
      }
    },
    "/api/settings/purchaseorderstates": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get purchase order states",
        "operationId": "Settings_GetPurchaseOrderStateList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.State]"
            }
          }
        }
      }
    },
    "/api/settings/license/{license}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Check if current user has license",
        "operationId": "Settings_IsLicense",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "license",
            "in": "path",
            "description": "",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/settings/products/stocks": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get stocks",
        "operationId": "Settings_GetStocks",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Stock]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Update product stock",
        "operationId": "Settings_UpdateStock",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyStock",
            "in": "body",
            "description": "Stock payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Stock"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Create product stock",
        "operationId": "Settings_CreateStock",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyStock",
            "in": "body",
            "description": "Stock payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Stock"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/settings/products/stocks/{stock}/shelves": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get stock departments / product cells",
        "operationId": "Settings_GetShelves",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductCell]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Create product shelves",
        "operationId": "Settings_CreateShelves",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxyCells",
            "in": "body",
            "description": "Shelf payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.ProductCellList"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/settings/products/stocks/write": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get stocks which person has rights to write",
        "operationId": "Settings_GetStocksWrite",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Stock]"
            }
          }
        }
      }
    },
    "/api/settings/stocks/{stock}/shelves": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get all the shelves in the stock",
        "operationId": "Settings_GetStockShelves",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Shelf]"
            }
          }
        }
      }
    },
    "/api/settings/products/stocks/{stock}/{shelf}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get stock shelf",
        "operationId": "Settings_GetShelf",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "shelf",
            "in": "path",
            "description": "Shelf",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Shelf]"
            }
          }
        }
      }
    },
    "/api/settings/products/{product_code}/stocks/{stock}/shelves": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get list of product's shelves from selected stock",
        "operationId": "Settings_GetProductStockShelves",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "product_code",
            "in": "path",
            "description": "Product code",
            "required": true,
            "type": "string"
          },
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.StockShelfSearch]"
            }
          }
        }
      }
    },
    "/api/settings/products/stocks/{stock}": {
      "delete": {
        "tags": [
          "Settings"
        ],
        "summary": "Delete stock",
        "operationId": "Settings_DeleteStock",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "stock",
            "in": "path",
            "description": "Stock number",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/settings/produttexttypes/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get product text types",
        "operationId": "Settings_GetProductTextTypes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodeBase]"
            }
          }
        }
      }
    },
    "/api/settings/stocktransaction_numberseries/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get stock transaction numberseries",
        "operationId": "Settings_GetStockTransactionNumberseries",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.NumberSeriesStockTransaction]"
            }
          }
        }
      }
    },
    "/api/settings/languages": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Gets languages",
        "operationId": "Settings_GetLanguages",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Language]"
            }
          }
        }
      }
    },
    "/api/settings/production/fail_codes": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get production fail code list",
        "operationId": "Settings_GetProductionFailCodes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductionFailcode]"
            }
          }
        }
      }
    },
    "/api/settings/worktime/reason_codes/{regulationId}/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get worktime reason code list",
        "operationId": "Settings_GetWorkTimeReasonCodes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "regulationId",
            "in": "path",
            "description": "Worktime regulation ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "languageCode",
            "in": "path",
            "description": "FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorkTimeReason]"
            }
          }
        }
      }
    },
    "/api/settings/worktime/regulations": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get worktime regulations",
        "operationId": "Settings_GetWorkTimeRegulations",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorkTimeRegulation]"
            }
          }
        }
      }
    },
    "/api/settings/delivery_package_codes": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get delivery package type list",
        "operationId": "Settings_GetDeliveryPackageTypeList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.DeliveryPackageType]"
            }
          }
        }
      }
    },
    "/api/settings/mobileapp/{app_id}/settings": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get mobile app settings",
        "operationId": "Settings_GetMobileAppPageSettings",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "description": "Lemonsoft Mobile App ID",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.MobileAppPage]"
            }
          }
        }
      }
    },
    "/api/settings/deliverymethods": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get delivery methods",
        "operationId": "Settings_GetDeliveryMethods",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.DeliveryMethod]"
            }
          }
        }
      }
    },
    "/api/settings/currency/{code}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get single currency",
        "operationId": "Settings_GetCurrency",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "description": "",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Currency]"
            }
          }
        }
      }
    },
    "/api/settings/expense_types/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get expense types",
        "operationId": "Settings_GetExpenseTypes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "Language code FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ExpenseType]"
            }
          }
        }
      }
    },
    "/api/settings/payroll_tax_types/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get payroll tax types",
        "operationId": "Settings_GetPayrollTaxTypes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "Language code FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PayrollTaxType]"
            }
          }
        }
      }
    },
    "/api/settings/lemonhub/registered": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Check if company is registered to lemonhub",
        "operationId": "Settings_IsCompanyRegisteredLemonHub",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/settings/machine_groups/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get machine groups",
        "operationId": "Settings_GetMachineGroupList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "Language code FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodeBase]"
            }
          }
        }
      }
    },
    "/api/settings/standard_workphases/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get standard workphases",
        "operationId": "Settings_GetWorkstageList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "Language code FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.StandardWorkPhase]"
            }
          }
        }
      }
    },
    "/api/settings/complaint_types/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get complaint types",
        "operationId": "Settings_GetComplaintTypeList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "Language code FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.NumberseriesComplaint]"
            }
          }
        }
      }
    },
    "/api/settings/complaint_states/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get complaint states",
        "operationId": "Settings_GetComplaintStates",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodeBase]"
            }
          }
        }
      }
    },
    "/api/settings/attribute_complaints/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get attribute complaint list",
        "operationId": "Settings_GetComplaintAttributes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodeBase]"
            }
          }
        }
      }
    },
    "/api/settings/complaint_reasons/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get complaint reasons",
        "operationId": "Settings_GetComplaintReasons",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodeBase]"
            }
          }
        }
      }
    },
    "/api/settings/stock_units/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get stock units",
        "operationId": "Settings_GetUnits",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodeBase]"
            }
          }
        }
      }
    },
    "/api/settings/teams": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get teams",
        "operationId": "Settings_GetTeams",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Team]"
            }
          }
        }
      }
    },
    "/api/settings/lemonsoft_timespan/dates": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Get lemonsoft timespan dates",
        "operationId": "Settings_GetLemonsoftTimeSpanDates",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Lemonsoft time span proxy",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.LemonsoftTimeSpan"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[System.String]"
            }
          }
        }
      }
    },
    "/api/settings/payment_terms/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get payment terms",
        "operationId": "Settings_GetPaymentTerms",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PaymentTerm]"
            }
          }
        }
      }
    },
    "/api/settings/chart_of_accounts": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Returns a chart of accounts",
        "operationId": "Settings_ListAccounts",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ChartOfAccountsNode]"
            }
          }
        }
      }
    },
    "/api/settings/crm_types": {
      "get": {
        "tags": [
          "Settings"
        ],
        "operationId": "Settings_GetCrmTypes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CrmType]"
            }
          }
        }
      }
    },
    "/api/settings/shelf_stops/{languageCode}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get list of shelf stops based on given language code.",
        "operationId": "Settings_GetShelfStopList",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "languageCode",
            "in": "path",
            "description": "FIN/ENG/SWE",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ShelfStop]"
            }
          }
        }
      }
    },
    "/api/settings/attribute_customer_contacts": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get customer contact attributes list",
        "operationId": "Settings_GetCustomerContactAttributes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CustomerContactAttributeSetting]"
            }
          }
        }
      }
    },
    "/api/settings/attribute_customers": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get customer attributes list",
        "description": "Returns the master list of customer attribute codes.\r\nUse these values with the attribute_ids filter on GET /api/customers\r\nto find customers tagged with specific attributes.",
        "operationId": "Settings_GetCustomerAttributes",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CustomerAttributeSetting]"
            }
          }
        }
      }
    },
    "/api/settings/posting_matrix": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "This endpoint returns posting matrices based on the provided filters",
        "operationId": "Settings_GetPostingMatrix",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.search",
            "in": "query",
            "description": "The name of the posting matrix",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PostingMatrix]"
            }
          }
        }
      }
    },
    "/api/settings/posting_matrix_rows": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "This endpoint returns posting matrix rows based on the provided filters",
        "operationId": "Settings_GetPostingMatrixRows",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.id",
            "in": "query",
            "description": "The id of the posting matrix row.",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.posting_matrix_id",
            "in": "query",
            "description": "The id of the posting matrix the row belongs to. (Tiliöintimatriisi)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.product_group",
            "in": "query",
            "description": "The product group id (tuoteryhmä)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.account",
            "in": "query",
            "description": "The account number assigned to the posting matrix row. (Tili)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.vat_rate",
            "in": "query",
            "description": "VAT rate assigned to the posting matrix row. (ALV)",
            "required": false,
            "type": "number",
            "format": "double"
          },
          {
            "name": "filter.costcenter_code",
            "in": "query",
            "description": "The cost center assigned to the posting matrix row (kustannuspaikka)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "Sorting order by id. Default is ascending (false).",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PostingMatrixRow]"
            }
          }
        }
      }
    },
    "/api/settings/account_blockings": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get account blockings",
        "operationId": "Settings_GetAccountBlockings",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.AccountingBlocking]"
            }
          }
        }
      }
    },
    "/api/settings/tax_rates": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Returns the tax rates the organisation has configured",
        "description": "The set a row's tax rate has to belong to: a rate outside it cannot be posted, whatever the rate\r\nlegislation says. The list carries no validity dates — it accumulates as rates change and old\r\ndocuments keep referring to the rates they were entered with — so it answers whether a rate is\r\nknown, not whether it is current. For what an account expects, see chart_of_accounts",
        "operationId": "Settings_GetTaxRates",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.TaxRate]"
            }
          }
        }
      }
    },
    "/api/admin/statemachines": {
      "get": {
        "tags": [
          "StateMachine"
        ],
        "summary": "Lists state machine variants. Filter by program_id (e.g. 9 for Customer).",
        "operationId": "StateMachine_List",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "program_id",
            "in": "query",
            "description": "Optional ProgramId filter. Null returns all variants.",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.StateMachineVariant]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "StateMachine"
        ],
        "summary": "Creates a new state machine variant. Use PUT .../{id}/default to make it the default afterwards.",
        "operationId": "StateMachine_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Variant metadata and default state number.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.StateMachineVariant"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.StateMachineVariant]"
            }
          }
        }
      }
    },
    "/api/admin/statemachines/{id}": {
      "get": {
        "tags": [
          "StateMachine"
        ],
        "summary": "Returns a single state machine variant.",
        "operationId": "StateMachine_Get",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "State machine variant identifier.",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.StateMachineVariant]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "StateMachine"
        ],
        "summary": "Updates a state machine variant's metadata (key, name, default state number, NoTransitionCheck).\r\nUse PUT .../{id}/default to change which variant is the default; this endpoint ignores is_default.",
        "operationId": "StateMachine_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "State machine variant identifier.",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Updated variant metadata and default state number.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.StateMachineVariant"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.StateMachineVariant]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "StateMachine"
        ],
        "summary": "Deletes a state machine variant (and its cascade-owned children). The default variant for\r\na program cannot be deleted - promote another variant to default first.",
        "operationId": "StateMachine_Delete",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "State machine variant identifier.",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.StateMachineVariant]"
            }
          }
        }
      }
    },
    "/api/admin/statemachines/{id}/default": {
      "put": {
        "tags": [
          "StateMachine"
        ],
        "summary": "Promotes a variant to the default for its ProgramId. Demotes all other defaults atomically.",
        "operationId": "StateMachine_SetDefault",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "State machine variant identifier.",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.StateMachineVariant]"
            }
          }
        }
      }
    },
    "/api/stocks": {
      "get": {
        "tags": [
          "Stock"
        ],
        "summary": "List product stock balances that have changed within a time window",
        "description": "Returns the current stock status (in-stock amount, free balance, outward amount) for each product whose stock saldo has changed between modified_after and modified_before.\r\n            \r\n**Time window constraint:** The maximum allowed window is 10 minutes. If the requested window is longer, modified_after is automatically moved forward so that the window ends at modified_before and spans exactly 10 minutes. This makes the endpoint suitable for incremental polling from an external system.",
        "operationId": "Stock_Stocks",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.modified_before",
            "in": "query",
            "description": "End of the time window. Only stock balances whose last change is at or before this timestamp are returned. Defaults to the current server time.",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.modified_after",
            "in": "query",
            "description": "Start of the time window. Only stock balances whose last change is at or after this timestamp are returned. If the resulting window exceeds 10 minutes, this value is automatically moved forward so that the window ends at modified_before and spans exactly 10 minutes.",
            "required": false,
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductStockStatus]"
            }
          }
        }
      }
    },
    "/api/stocks/stock_deliveries": {
      "get": {
        "tags": [
          "Stock"
        ],
        "summary": "List product stock deliveries (incoming and outgoing) with paging and filtering",
        "description": "Returns a paged list of upcoming and historical stock deliveries (varastotapahtumat) — entries that move material into or out of a stock location. Each row represents a single delivery event such as a sales order shipment, a purchase order receipt, or a production reservation.\r\n            \r\n**Delivery type and source order number:** The delivery_type field determines which of three order-number fields on the row is populated:\r\n- delivery_type = 1 (sales order, myyntitilaus) → sales_order_number is set\r\n- delivery_type = 2 (purchase order, ostotilaus) → purchase_order_number is set\r\n- delivery_type = 3 (production, tuotanto) or 4 (production reservation, tuotantovaraus) → worknumber is set\r\n            \r\nThe other two order-number fields remain at their default for that row. Consumers should branch on delivery_type when displaying the source document reference.\r\n            \r\nResults are sorted by delivery_id (ascending by default; set sort_desc to true for descending).",
        "operationId": "Stock_GetStockDeliveries",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.delivery_type",
            "in": "query",
            "description": "Filter by delivery type. 1=sales order (myyntitilaus), 2=purchase order (ostotilaus), 3=production (tuotanto), 4=production reservation (tuotantovaraus).",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_stock_number",
            "in": "query",
            "description": "Filter by stock location number (varasto). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_product_code",
            "in": "query",
            "description": "Filter by product code (tuotekoodi). Matches deliveries whose delivery_product_code contains the given string. For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.job_id",
            "in": "query",
            "description": "Filter by job id (for production-related deliveries)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.forecast_type",
            "in": "query",
            "description": "Filter by forecast type",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_priority",
            "in": "query",
            "description": "Filter by delivery priority. 0=normal, 1=high, 2=critical",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.order_id",
            "in": "query",
            "description": "Filter by the id of the source order or work order the delivery is bound to",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_id",
            "in": "query",
            "description": "Filter by a specific delivery_id",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.delivery_date_before",
            "in": "query",
            "description": "Return only deliveries whose delivery_date is on or before this date. When a date with no time component is supplied, the filter automatically extends to the end of that day (23:59:59).",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.delivery_date_after",
            "in": "query",
            "description": "Return only deliveries whose delivery_date is on or after this date.",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "When true, results are sorted by delivery_id in descending order. Default is ascending.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.StockDelivery]"
            }
          }
        }
      }
    },
    "/api/substitutes": {
      "post": {
        "tags": [
          "Substitutes"
        ],
        "summary": "Creates a person substitute.",
        "operationId": "Substitutes_CreateSubstitute",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "The substitute to create.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Substitute"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Substitute"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/api/substitutes/{id}": {
      "put": {
        "tags": [
          "Substitutes"
        ],
        "summary": "Updates a person substitute by id.",
        "operationId": "Substitutes_UpdateSubstitute",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The identifier of the substitute to update.",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxy",
            "in": "body",
            "description": "The substitute values to save.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Substitute"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.Substitute"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Substitutes"
        ],
        "summary": "Deletes a person substitute by id.",
        "operationId": "Substitutes_DeleteSubstitute",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The identifier of the substitute to delete.",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "NotFound"
          }
        }
      }
    },
    "/api/travelexpenses": {
      "get": {
        "tags": [
          "TravelExpense"
        ],
        "summary": "Get a paged list of travel expenses",
        "description": "Retrieve travel expenses (matkalaskut) with optional filtering. Results are paged — use `page` and `page_size` to control pagination, and `sort_desc` to flip the sort order.\r\n            \r\nThe `created_after`/`created_before` filters bound the travel expense date. The `updated_after`/`updated_before` filters bound the row update timestamp.\r\n            \r\nEach result is returned in the raw form (`TravelExpenseMainRaw`) and includes all rows and their full set of calculated allowance and payroll-posting fields.",
        "operationId": "TravelExpense_TravelExpenses",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.type",
            "in": "query",
            "description": "Filter by travel expense type code (matkalaskun laji)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.state",
            "in": "query",
            "description": "Filter by one or more travel expense state codes (tila). For possible values, refer to /api/settings/states/{state_source}\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.number",
            "in": "query",
            "description": "Filter by travel expense running number (matkalaskunumero)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.created_after",
            "in": "query",
            "description": "Filter travel expenses created on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.created_before",
            "in": "query",
            "description": "Filter travel expenses created on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_after",
            "in": "query",
            "description": "Filter travel expenses updated on or after this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.updated_before",
            "in": "query",
            "description": "Filter travel expenses updated on or before this date",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "filter.company_account_row",
            "in": "query",
            "description": "Filter by the company bank account row used for payment. For possible values, refer to /api/company/accounts\r\n[here](#tag/company/operation/Company_GetAccounts)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.currency_code",
            "in": "query",
            "description": "Filter by currency code (valuuttakoodi). For possible values, refer to /api/settings/currency/{code}\r\n[here](#tag/Settings/operation/Settings_GetCurrency)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.person_number",
            "in": "query",
            "description": "Filter by the traveller's person number (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.circulation",
            "in": "query",
            "description": "Filter by the circulation/approval id (kierrätys)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.paid",
            "in": "query",
            "description": "Filter by paid status — true returns only paid travel expenses, false returns only unpaid",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.salary_id",
            "in": "query",
            "description": "Filter by the salary batch id the travel expense was transferred to payroll through (palkkaerä)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.circulation_ready_bit",
            "in": "query",
            "description": "Filter by circulation ready bit — true returns travel expenses that have been marked ready for circulation",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.sort_desc",
            "in": "query",
            "description": "When true, results are sorted by travel expense id in descending order (newest first). Defaults to ascending",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.TravelExpenseMainRaw]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "TravelExpense"
        ],
        "summary": "Create a travel expense from one or more trip rows",
        "description": "Create a new travel expense (matkalasku) from a list of trip rows. All rows in the list must belong to the same person.\r\nThe earliest start_date in the list is used as the travel expense header date, and the first non-empty description on a row is used as the header description.\r\n            \r\nWhen `calculate_allowance` is true on a row, daily allowances, kilometer compensation and passenger compensation are calculated automatically based on the row's travel times, country, kilometers and the company's travel regulations.\r\n            \r\nIf the company setting `AUTO_CIRCULATION` is enabled, the created travel expense is automatically marked ready for circulation.",
        "operationId": "TravelExpense_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxyExpenses",
            "in": "body",
            "description": "List of travel expense rows. All rows must belong to the same person and contain id = 0",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.GlobalTravelExpense"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/travelexpenses/summary": {
      "post": {
        "tags": [
          "TravelExpense"
        ],
        "summary": "Create a travel expense from a summary payload",
        "description": "Create a new travel expense (matkalasku) from a summary payload that wraps the person, date and description for the header together with a list of trip rows.\r\n            \r\nThe `id` on the summary must be 0 — this endpoint only creates new travel expenses, it does not update existing ones. The `person` must be set, and all rows must belong to that same person.\r\n            \r\nAllowance calculation and AUTO_CIRCULATION behavior are identical to POST /api/travelexpenses.",
        "operationId": "TravelExpense_CreateSummary",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Travel expense summary payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.GlobalTravelExpenseSummary"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/travelexpenses/raw": {
      "post": {
        "tags": [
          "TravelExpense"
        ],
        "summary": "Create a travel expense from raw data",
        "description": "Create a new travel expense (matkalasku) from a raw payload that mirrors the underlying database fields. Use this endpoint when the caller has already computed allowances, payroll posting codes and other low-level fields and wants to write them verbatim — no automatic allowance calculation is performed here.\r\n            \r\nThe `person_number` on the payload must reference an existing person. All row-level fields, including passenger lists, are written as provided.",
        "operationId": "TravelExpense_CreateRaw",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Raw travel expense payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.TravelExpenseMainRaw"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/travelexpenses/travels": {
      "get": {
        "tags": [
          "TravelExpense"
        ],
        "summary": "Get a paged list of mobile travels for the logged-in user",
        "description": "Retrieve mobile travels (mobiilimatkat) — trips recorded via the Lemonsoft mobile app, optionally with GPS-tracked routes. Results are paged.\r\n            \r\nThe `person_number` on the filter must match the logged-in user. If no filter is supplied, it defaults to the logged-in user's person number.",
        "operationId": "TravelExpense_GetMobileTravels",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "filter.states",
            "in": "query",
            "description": "Filter by one or more mobile travel state codes (tila)",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.person_number",
            "in": "query",
            "description": "Filter by the traveller's person number. Must match the logged-in user (henkilönumero)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.person_job_id",
            "in": "query",
            "description": "Filter by the person job (work assignment) id the trip relates to (henkilön työtehtävä)",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.person_job_type",
            "in": "query",
            "description": "Filter by the person job type code the trip relates to",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.object_ids",
            "in": "query",
            "description": "Filter by a list of object ids. Returns only objects with matching ids",
            "required": false,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "filter.search",
            "in": "query",
            "description": "Free text search across relevant fields (e.g., description, reference)",
            "required": false,
            "type": "string"
          },
          {
            "name": "filter.page",
            "in": "query",
            "description": "If not defined, using default value of 1",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "filter.page_size",
            "in": "query",
            "description": "If not defined, using default value of 10",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.MobileTravel]"
            }
          }
        }
      },
      "put": {
        "tags": [
          "TravelExpense"
        ],
        "summary": "Update an existing mobile travel",
        "description": "Update an existing mobile travel (mobiilimatka). The `id` must be greater than 0, the `person_number` must match both the logged-in user and the person already stored on the mobile travel.\r\n            \r\nThe trip start/end times and each route leg's start/end times are converted to the server's local time zone before being stored.",
        "operationId": "TravelExpense_UpdateMobileTravel",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Mobile travel payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.MobileTravel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "TravelExpense"
        ],
        "summary": "Create a mobile travel for the logged-in user",
        "description": "Create a new mobile travel (mobiilimatka), optionally with one or more route legs. The `id` must be 0, the `person_number` must be non-zero and must match the logged-in user.\r\n            \r\nThe trip start/end times and each route leg's start/end times are converted to the server's local time zone before being stored.",
        "operationId": "TravelExpense_CreateMobileTravel",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "description": "Mobile travel payload",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.MobileTravel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.CreateUpdateResponse"
            }
          }
        }
      }
    },
    "/api/travelexpenses/travels/{id}": {
      "get": {
        "tags": [
          "TravelExpense"
        ],
        "summary": "Get a single mobile travel by id",
        "description": "Retrieve a single mobile travel (mobiilimatka) by id. The mobile travel must belong to the logged-in user.",
        "operationId": "TravelExpense_GetMobileTravel",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Mobile travel id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.MobileTravel]"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "TravelExpense"
        ],
        "summary": "Delete a mobile travel",
        "description": "Delete a mobile travel (mobiilimatka) that belongs to the logged-in user. A user can only delete their own mobile travels.",
        "operationId": "TravelExpense_DeleteMobileTravel",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Mobile travel id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/travelexpenses/travels/{travelId}/routes/{routeId}": {
      "delete": {
        "tags": [
          "TravelExpense"
        ],
        "summary": "Delete a single route leg from a mobile travel",
        "description": "Remove a single GPS route leg from a mobile travel without deleting the travel itself. The route must belong to the given mobile travel, and the mobile travel must belong to the logged-in user.",
        "operationId": "TravelExpense_DeleteMobileTravelRoute",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "travelId",
            "in": "path",
            "description": "Mobile travel id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "routeId",
            "in": "path",
            "description": "Route leg id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.TrueFalseResponse"
            }
          }
        }
      }
    },
    "/api/uicontrolcustomizations": {
      "post": {
        "tags": [
          "UiControlCustomizations"
        ],
        "summary": "Creates or updates a UI control customization for the current user, or company-wide when requested\r\n(company-wide requires an administrator).",
        "operationId": "UiControlCustomizations_Save",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "record",
            "in": "body",
            "description": "The UI control customization to save.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.UiControlCustomization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.StatusResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "UiControlCustomizations"
        ],
        "summary": "Deletes the current user's UI control customization, or the company-wide one when requested\r\n(company-wide requires an administrator).",
        "operationId": "UiControlCustomizations_Delete",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "guid",
            "in": "query",
            "description": "The view GUID the customization applies to.",
            "required": true,
            "type": "string"
          },
          {
            "name": "uiControlKey",
            "in": "query",
            "description": "The UI control key to delete.",
            "required": true,
            "type": "string"
          },
          {
            "name": "companyWide",
            "in": "query",
            "description": "When true, deletes the company-wide customization instead of the current user's.",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.StatusResponse"
            }
          }
        }
      }
    },
    "/api/v1/auth/login/refreshlicenses": {
      "post": {
        "tags": [
          "V1Authentication"
        ],
        "summary": "Refresh licenses from UM",
        "operationId": "V1Authentication_RefreshLicenses",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "login_token",
            "in": "body",
            "description": "LoginToken object",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.LogInTokenInstanceDatabase"
            }
          },
          {
            "name": "useUserFlow",
            "in": "query",
            "description": "True for userflow login, false for customflow login",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.AuthenticationResponse"
            }
          }
        }
      }
    },
    "/api/v1/auth/login/token": {
      "post": {
        "tags": [
          "V1Authentication"
        ],
        "summary": "Perform a login to the API",
        "operationId": "V1Authentication_LogInToken",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "login_token",
            "in": "body",
            "description": "A data payload with your login information",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.LogInTokenInstanceDatabase"
            }
          },
          {
            "name": "useUserFlow",
            "in": "query",
            "description": "True for userflow login, false for customflow login",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.AuthenticationResponse"
            }
          }
        }
      }
    },
    "/api/v1/auth/login/restuser": {
      "get": {
        "tags": [
          "V1Authentication"
        ],
        "summary": "ROPC-user login to the API",
        "operationId": "V1Authentication_LogInROPCToken",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "ropcstring",
            "in": "query",
            "description": "encrypted string containing the login info",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.AuthenticationResponse"
            }
          }
        }
      }
    },
    "/api/worktimeregulations": {
      "post": {
        "tags": [
          "WorktimeRegulations"
        ],
        "summary": "Creates a worktime regulation (work shift).",
        "operationId": "WorktimeRegulations_CreateRegulation",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "proxy",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeRegulation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeRegulation"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/api/worktimeregulations/{id}": {
      "put": {
        "tags": [
          "WorktimeRegulations"
        ],
        "summary": "Updates a worktime regulation by id. The current entity is loaded and the request contract is\r\nmapped onto it, so fields the worktime-regulation REST contract does not manage (e.g. the payroll\r\nform-of-salary fields) are not written here and keep their current value.",
        "operationId": "WorktimeRegulations_UpdateRegulation",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "proxy",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeRegulation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeRegulation"
            }
          },
          "400": {
            "description": "BadRequest"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "WorktimeRegulations"
        ],
        "summary": "Deletes a worktime regulation by id.",
        "operationId": "WorktimeRegulations_DeleteRegulation",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "NotFound"
          }
        }
      }
    },
    "/api/worktimes": {
      "put": {
        "tags": [
          "Worktimes"
        ],
        "summary": "Update worktime entries.",
        "operationId": "Worktimes_Update",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "records",
            "in": "body",
            "description": "Worktime rows to update. Each entry must include a valid worktime_id.",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.WorktimeRecord"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorktimeRecord]"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Worktimes"
        ],
        "summary": "Create worktime entries.",
        "operationId": "Worktimes_Create",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "records",
            "in": "body",
            "description": "Worktime rows to create. Each entry must have worktime_id 0.",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LemonRest.Models.Proxy.WorktimeRecord"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorktimeRecord]"
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Worktimes"
        ],
        "summary": "Partially update worktime entries (only non-null payload fields are applied).",
        "operationId": "Worktimes_Patch",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "records",
            "in": "body",
            "required": true,
            "schema": {
              "title": "JsonPatchDocument",
              "type": "array",
              "items": {
                "$ref": "#/definitions/Microsoft.AspNetCore.JsonPatch.Operations.Operation[LemonRest.Models.Proxy.Product]"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorktimeRecord]"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "LemonRest.Models.QueryFilters.VoucherFilter": {
      "type": "object",
      "properties": {
        "voucher_date_before": {
          "format": "date-time",
          "type": "string"
        },
        "voucher_date_after": {
          "format": "date-time",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "1 = Normaali\r\n2 = Alkusaldot\r\n3 = Alv-kirjaus\r\n4 = Tilinpäätös",
          "type": "integer"
        },
        "state": {
          "format": "int32",
          "description": "0 = kirjattu\r\n1 = kierrossa\r\n2 = hylätty\r\n3 = hyväksytty",
          "type": "integer"
        },
        "period_id": {
          "format": "int32",
          "description": "Tilikauden tunniste",
          "type": "integer"
        },
        "voucher_class": {
          "format": "int32",
          "description": "Tilikauden tositelaji",
          "type": "integer"
        },
        "sort_field": {
          "description": "Sort field (database column name). Default is \"accounting_id\". Common values: accounting_id, accounting_date, accounting_vouchernumber.\r\nFalls back to default if column does not exist.",
          "type": "string"
        },
        "sort_desc": {
          "description": "Sorting order. Default is ascending (false).",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Accounting]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Accounting"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Accounting": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "period_id": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_class": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_type": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_number": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_description": {
          "type": "string"
        },
        "voucher_state": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_state_description": {
          "type": "string"
        },
        "voucher_date": {
          "format": "date-time",
          "type": "string"
        },
        "debit": {
          "format": "double",
          "type": "number"
        },
        "credit": {
          "format": "double",
          "type": "number"
        },
        "is_checked": {
          "type": "boolean"
        },
        "is_locked": {
          "type": "boolean"
        },
        "rows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.AccountingRow"
          }
        }
      }
    },
    "LemonRest.Models.Error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "code": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.AccountingRow": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_id": {
          "format": "int32",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "type": "string"
        },
        "account": {
          "type": "string"
        },
        "debit": {
          "format": "double",
          "type": "number"
        },
        "credit": {
          "format": "double",
          "type": "number"
        },
        "description": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "cost_center": {
          "type": "string"
        },
        "project": {
          "type": "string"
        },
        "row_number": {
          "format": "int32",
          "type": "integer"
        },
        "tax": {
          "format": "double",
          "type": "number"
        },
        "without_tax": {
          "format": "double",
          "type": "number"
        },
        "tax_rate": {
          "format": "double",
          "type": "number"
        },
        "customer": {
          "type": "string"
        },
        "invoice": {
          "type": "string"
        },
        "blocking": {
          "format": "int32",
          "type": "integer"
        },
        "blocking_id": {
          "format": "int32",
          "type": "integer"
        },
        "blocking_pcs": {
          "format": "int32",
          "type": "integer"
        },
        "blocking_start": {
          "format": "date-time",
          "type": "string"
        },
        "entry": {
          "format": "int32",
          "type": "integer"
        },
        "entry_id": {
          "format": "int32",
          "type": "integer"
        },
        "lta": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.AccountingCombined]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.AccountingCombined"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.AccountingCombined": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "period_id": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_class": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_type": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_number": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_description": {
          "type": "string"
        },
        "voucher_state": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_state_description": {
          "type": "string"
        },
        "voucher_date": {
          "format": "date-time",
          "type": "string"
        },
        "debit": {
          "format": "double",
          "type": "number"
        },
        "credit": {
          "format": "double",
          "type": "number"
        },
        "is_checked": {
          "type": "boolean"
        },
        "is_locked": {
          "type": "boolean"
        },
        "row_id": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_id": {
          "format": "int32",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "type": "string"
        },
        "account": {
          "type": "string"
        },
        "row_debit": {
          "format": "double",
          "type": "number"
        },
        "row_credit": {
          "format": "double",
          "type": "number"
        },
        "description": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "cost_center": {
          "type": "string"
        },
        "project": {
          "type": "string"
        },
        "row_number": {
          "format": "int32",
          "type": "integer"
        },
        "tax": {
          "format": "double",
          "type": "number"
        },
        "without_tax": {
          "format": "double",
          "type": "number"
        },
        "tax_rate": {
          "format": "double",
          "type": "number"
        },
        "customer": {
          "type": "string"
        },
        "invoice": {
          "type": "string"
        },
        "blocking": {
          "format": "int32",
          "type": "integer"
        },
        "blocking_id": {
          "format": "int32",
          "type": "integer"
        },
        "blocking_pcs": {
          "format": "int32",
          "type": "integer"
        },
        "blocking_start": {
          "format": "date-time",
          "type": "string"
        },
        "entry": {
          "format": "int32",
          "type": "integer"
        },
        "entry_id": {
          "format": "int32",
          "type": "integer"
        },
        "lta": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.VoucherUpComingFilter": {
      "type": "object",
      "properties": {
        "voucher_date_before": {
          "format": "date-time",
          "description": "Date to",
          "type": "string"
        },
        "voucher_date_after": {
          "format": "date-time",
          "description": "Date from",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.AccountingPeriodFilter": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.AccountingPeriod]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.AccountingPeriod"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.AccountingPeriod": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "start_date": {
          "format": "date-time",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "is_locked": {
          "type": "boolean"
        },
        "locked_date": {
          "format": "date-time",
          "type": "string"
        },
        "is_default": {
          "type": "boolean"
        },
        "number_series": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.NumberseriesAccounting"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.NumberseriesAccounting": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "voucher_class": {
          "format": "int32",
          "type": "integer"
        },
        "period_id": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        },
        "cost_center": {
          "type": "string"
        },
        "company": {
          "format": "int32",
          "type": "integer"
        },
        "classes": {
          "type": "string"
        },
        "lta": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.AccountingPeriod]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.AccountingPeriod"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "Lemonsoft.AgentLibrary.Dto.AgentReportDTO": {
      "type": "object",
      "properties": {
        "overall_risk_level": {
          "type": "string"
        },
        "suggested_action": {
          "type": "string"
        },
        "llm_summary": {
          "type": "string"
        },
        "processed_at": {
          "format": "date-time",
          "type": "string"
        },
        "target_object_id": {
          "format": "int32",
          "type": "integer"
        },
        "external_ref": {
          "type": "string"
        },
        "checks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Lemonsoft.AgentLibrary.Dto.AgentReportCheckDTO"
          }
        }
      }
    },
    "Lemonsoft.AgentLibrary.Dto.AgentReportCheckDTO": {
      "type": "object",
      "properties": {
        "check_id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "severity": {
          "type": "string"
        },
        "is_llm": {
          "type": "boolean"
        },
        "title": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "display_order": {
          "format": "int32",
          "type": "integer"
        },
        "suggestions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Lemonsoft.AgentLibrary.Dto.AgentReportSuggestionDTO"
          }
        }
      }
    },
    "Lemonsoft.AgentLibrary.Dto.AgentReportSuggestionDTO": {
      "type": "object",
      "properties": {
        "target_resource": {
          "type": "string"
        },
        "target_id": {
          "format": "int32",
          "type": "integer"
        },
        "target_field": {
          "type": "string"
        },
        "current_value": {
          "type": "string"
        },
        "proposed_value": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "action_type": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[Lemonsoft.AgentLibrary.Dto.AgentReportResultDTO]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/Lemonsoft.AgentLibrary.Dto.AgentReportResultDTO"
        }
      }
    },
    "Lemonsoft.AgentLibrary.Dto.AgentReportResultDTO": {
      "type": "object",
      "properties": {
        "agent_report_id": {
          "format": "int64",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.TaskResultResponse": {
      "description": "Represents the response for a task result in an asynchronous operation.",
      "type": "object",
      "properties": {
        "task_id": {
          "format": "uuid",
          "description": "The unique identifier for the task",
          "type": "string",
          "example": "00000000-0000-0000-0000-000000000000"
        },
        "completed": {
          "description": "Indicates whether the task has been completed.",
          "type": "boolean"
        },
        "result": {
          "description": "The result of the task if it has been completed successfully.",
          "type": "object"
        },
        "errors": {
          "description": "A list of detailed errors that occurred during the task execution.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.DetailedError"
          }
        }
      }
    },
    "LemonRest.Models.DetailedError": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderRow": {
      "description": "Proxy class for sales order row (tilausrivi)",
      "required": [
        "total",
        "unit_price",
        "quantity"
      ],
      "type": "object",
      "properties": {
        "order_id": {
          "format": "int32",
          "description": "The id of the sales order the row is part of",
          "type": "integer"
        },
        "original_amount": {
          "format": "double",
          "description": "The original amount of product in the sales order row (Alkup. määrä)",
          "type": "number"
        },
        "delivery_datetime": {
          "format": "date-time",
          "description": "The estimated delivery date for the sales order row (toimituspvm)",
          "type": "string"
        },
        "shipment_datetime": {
          "format": "date-time",
          "description": "The date and time when the sales order row was shipped. If set, the value provided in shipment_datetime is assigned to orderDeliveryInfo's Deliveryinfo_date (pvm) and order's DeliveryDate.",
          "type": "string"
        },
        "delivered_amount": {
          "format": "double",
          "description": "The amount of product delivered in the sales order row (toimitettu). If set, delivery will be created for the sales order row with the given amount",
          "type": "number"
        },
        "is_backorder": {
          "description": "Indicates if the sales order row is backorder (jälkitoimitus)",
          "type": "boolean"
        },
        "order_number": {
          "format": "int32",
          "description": "The order's number the sales order row is part of (tilausnumero)",
          "type": "integer"
        },
        "seller_number": {
          "format": "int32",
          "description": "The seller number for the sales order row (myyjänumero)",
          "type": "integer"
        },
        "delivery_text": {
          "description": "The text for the delivery of the sales order row (toimitustieto). Free text field",
          "type": "string"
        },
        "person_number": {
          "format": "int32",
          "description": "The person number for the sales order row (tekijä)",
          "type": "integer"
        },
        "previous_delivery": {
          "format": "double",
          "description": "The amount of product that has been delivered in the sales order row (toimitettu)",
          "type": "number"
        },
        "previous_delivery_datetime": {
          "format": "date-time",
          "description": "The date and time when the previous delivery was made for the sales order row",
          "type": "string"
        },
        "reference_number": {
          "description": "The reference number for the sales order row",
          "type": "string"
        },
        "state": {
          "format": "int32",
          "description": "The current state for sales order row (tila). For possible values and descriptions, see /api/settings/states/2\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "total_delivery": {
          "format": "double",
          "description": "The total amount of product delivered for the sales order row",
          "type": "number"
        },
        "sizes": {
          "description": "The size amounts for the sales order row",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SizeAmount"
          }
        },
        "returned_amount": {
          "format": "double",
          "description": "The amount of product that has been returned for the sales order row (palautettu)",
          "type": "number"
        },
        "returned_datetime": {
          "format": "date-time",
          "description": "The date and time when the sales order row's product was returned (palautettu pvm)",
          "type": "string"
        },
        "end_datetime": {
          "format": "date-time",
          "description": "The end date and time for the sales order row's product's return period (palautus pvm)",
          "type": "string"
        },
        "volume": {
          "format": "double",
          "description": "The volume per unit of the product (tilavuus)",
          "type": "number"
        },
        "delivery_estimate": {
          "format": "double",
          "description": "The date and time when the sales order row's delivery is estimated to be made delivered",
          "type": "number"
        },
        "product_is_serialnumber_followup": {
          "description": "Indicates if the product is a serial number follow-up product (sarjanumeroseuranta)",
          "type": "boolean"
        },
        "product_is_batchfollowup": {
          "description": "Indicates if the product is a batch follow-up product (eränumeroseuranta)",
          "type": "boolean"
        },
        "autofill_product": {
          "description": "If set to true, the system autofills the product information based on the product code provided in the request",
          "default": false,
          "type": "boolean"
        },
        "row_product_batch_id": {
          "format": "int32",
          "description": "If the row was created from a product batch proposal, this is the id of the product batch (eränumerot painike)",
          "type": "integer"
        },
        "stock_unit": {
          "description": "The stock unit of the product (varastoyksikkö). For example: \"kpl\", \"kg\", \"m\". The available stock units are controlled via product stock units in codelists (varastoyksikkö). See /api/settings/stock_units/{languageCode}\r\nUsed for intrastat and unit conversions.\r\n[here](#tag/Settings/operation/Settings_GetUnits)",
          "type": "string"
        },
        "collected_amount": {
          "format": "double",
          "description": "The collected amount of product for the sales order row",
          "type": "number"
        },
        "shelf": {
          "description": "The shelf for the sales order row (hylly)",
          "type": "string"
        },
        "row_net": {
          "format": "double",
          "description": "The taxless net price of the row (nettohinta)",
          "type": "number"
        },
        "is_production_ready": {
          "description": "Indicates if the production job related to the sales order row is completed",
          "type": "boolean"
        },
        "product_batchnr_suppliercode": {
          "description": "The supplier code for the product batchnumber proposal",
          "type": "string"
        },
        "work_number": {
          "format": "int32",
          "description": "The work number related to the sales order row (työnumero)",
          "type": "integer"
        },
        "stock_balance": {
          "format": "double",
          "description": "Stock balance for the row's product and stock. Informative value.",
          "type": "number"
        },
        "serials": {
          "description": "List of serial numbers for the sales order row",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRowSerialNumber"
          }
        },
        "shelves": {
          "description": "The shelves for the sales order row",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionShelf"
          }
        },
        "batches": {
          "description": "Batches of the sales order row",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRowBatchNumber"
          }
        },
        "stock_order_status": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.StockOrderStatus",
          "description": "Stock status of sales order row"
        },
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "type": "integer"
        },
        "account": {
          "type": "string"
        },
        "cost_center": {
          "type": "string"
        },
        "project_code": {
          "type": "string"
        },
        "project_number": {
          "format": "int32",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "type": "integer"
        },
        "discount": {
          "format": "double",
          "type": "number"
        },
        "discount2": {
          "format": "double",
          "type": "number"
        },
        "discount3": {
          "format": "double",
          "type": "number"
        },
        "per": {
          "format": "double",
          "type": "number"
        },
        "sales_price": {
          "format": "double",
          "type": "number"
        },
        "total": {
          "format": "double",
          "type": "number"
        },
        "unit_price": {
          "format": "double",
          "type": "number"
        },
        "quantity": {
          "format": "double",
          "type": "number"
        },
        "quantity2": {
          "format": "double",
          "type": "number"
        },
        "color": {
          "type": "string"
        },
        "customer_discount_percentage": {
          "format": "double",
          "type": "number"
        },
        "dimension": {
          "type": "string"
        },
        "inner_note": {
          "type": "string"
        },
        "net_price": {
          "format": "double",
          "type": "number"
        },
        "no_stock_update": {
          "type": "boolean"
        },
        "note": {
          "type": "string"
        },
        "number": {
          "format": "int32",
          "type": "integer"
        },
        "position": {
          "type": "string"
        },
        "product_code": {
          "type": "string"
        },
        "product_name": {
          "type": "string"
        },
        "product_extra_name": {
          "type": "string"
        },
        "tax_amount": {
          "format": "double",
          "type": "number"
        },
        "tax_rate": {
          "format": "double",
          "type": "number"
        },
        "unit": {
          "type": "string"
        },
        "unit_net_price": {
          "format": "double",
          "type": "number"
        },
        "unit_net_price_currency": {
          "format": "double",
          "type": "number"
        },
        "unit_net_currency": {
          "type": "string"
        },
        "product_stock": {
          "format": "int32",
          "type": "integer"
        },
        "lta": {
          "type": "string"
        },
        "weight": {
          "format": "double",
          "type": "number"
        },
        "supplier_id": {
          "format": "int32",
          "type": "integer"
        },
        "row_serial": {
          "type": "string"
        },
        "is_serial_follow_up": {
          "type": "boolean"
        },
        "serialnumber_type": {
          "format": "int32",
          "type": "integer"
        },
        "is_batch_follow_up": {
          "type": "boolean"
        },
        "handedness": {
          "type": "string"
        },
        "price_info": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.SizeAmount": {
      "description": "The size amount for product (kokolajitelmat)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the size amount",
          "type": "integer"
        },
        "row_id": {
          "format": "int32",
          "description": "The id of the row the size amount is part of",
          "type": "integer"
        },
        "size": {
          "description": "The size of the product in row. For example: \"M\", \"L\", \"XL\". The available sizes are controlled via product sizes in codelists (kokolajitelmat)",
          "type": "string"
        },
        "ean": {
          "description": "The GTIN code of the product in the row (ean)",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount for the product size",
          "type": "number"
        },
        "dlvr_amount": {
          "format": "double",
          "description": "The delivery amount of product size in the row (määrä). Must be equal to delivered_amount",
          "type": "number"
        },
        "total_dlvr_amount": {
          "format": "double",
          "description": "The total delivered amount of product size in the row",
          "type": "number"
        },
        "sort_order": {
          "format": "int32",
          "description": "The sorting order number for the size amount (järjestysnumero)",
          "type": "integer"
        },
        "in_stock": {
          "format": "double",
          "description": "Informative value for current stock balance.",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderRowSerialNumber": {
      "description": "The serial number model for sales order row",
      "required": [
        "sales_orderrow_id",
        "product_code",
        "serialnr_code"
      ],
      "type": "object",
      "properties": {
        "sales_orderrow_serial_id": {
          "format": "int32",
          "description": "The id for the serial number in the sales order row",
          "type": "integer"
        },
        "sales_orderrow_id": {
          "format": "int32",
          "description": "The id of the sales order row the serial is part of",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code for the product the serial number is assigned for",
          "type": "string"
        },
        "serialnr_code": {
          "description": "The serial number code",
          "type": "string"
        },
        "serialnr_description": {
          "description": "The description for the serial number",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.StockTransactionShelf": {
      "description": "The shelf of the stock transaction",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the StockTransactionShelf",
          "type": "integer"
        },
        "stock_transaction_id": {
          "format": "int32",
          "description": "The id of the stock transaction",
          "type": "integer"
        },
        "shelf": {
          "description": "The shelf code",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount of product in the shelf",
          "type": "number"
        },
        "shelf_and_saldo": {
          "description": "The shelf code and the amount of product in the shelf",
          "type": "string"
        },
        "is_inventory": {
          "description": "Indicates if the shelf has been inventoried (inventoitu). True if it has been inventoried, false if it has not been inventoried.",
          "type": "boolean"
        },
        "stock_instock": {
          "format": "double",
          "description": "The amount of product in stock shelf",
          "type": "number"
        },
        "stop_number": {
          "format": "int32",
          "description": "The stop number/picking area that is set to the shelf",
          "type": "integer"
        },
        "collect_order": {
          "format": "int32",
          "description": "The picking order that is set to the shelf",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderRowBatchNumber": {
      "description": "The batch number model for sales order row",
      "required": [
        "sales_orderrow_id",
        "batchnr_id",
        "batchnr_suppliercode",
        "batchnr_amount"
      ],
      "type": "object",
      "properties": {
        "sales_orderrow_batch_id": {
          "format": "int32",
          "description": "The id for the batch stock transaction (stock_transactions_batchnr.batchnr_id, tuotekeskus -&gt; varastotapahtumat -&gt; eränumerot -&gt; eränro)",
          "type": "integer"
        },
        "sales_orderrow_id": {
          "format": "int32",
          "description": "The id of the sales order row the batch is part of",
          "type": "integer"
        },
        "batchnr_id": {
          "format": "int32",
          "description": "The id of the batch (stock_transactions_batchnr.batchnr_original_id, logistiikka -&gt; varastotapahtumat -&gt; eränumerot -&gt; eränro)",
          "type": "integer"
        },
        "batchnr_suppliercode": {
          "description": "The supplier code for the batch",
          "type": "string"
        },
        "batchnr_amount": {
          "format": "double",
          "description": "The amount for the batch when making deliveries via PUT (Batchnumber_amount)",
          "type": "number"
        },
        "batch_previous_dlvr_amount": {
          "format": "double",
          "description": "The amount delivered in previous batches",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.StockOrderStatus": {
      "description": "Stock status of sales order row",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "value": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.TaskStartResponse": {
      "description": "Represents the response for starting a task in the system.",
      "type": "object",
      "properties": {
        "ok": {
          "description": "Indicates whether the task was started successfully.",
          "type": "boolean"
        },
        "task_id": {
          "format": "uuid",
          "description": "The unique identifier for the task that was started.",
          "type": "string",
          "example": "00000000-0000-0000-0000-000000000000"
        },
        "errors": {
          "description": "A list of detailed errors that occurred during the task start process.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.DetailedError"
          }
        }
      }
    },
    "LemonRest.Models.Response.AliveResponse": {
      "description": "Response indicating whether the current session is valid, with optional expiration time",
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "expire_time": {
          "format": "date-time",
          "description": "The time when the current session will expire in UTC time. Null if the session is not valid",
          "type": "string"
        },
        "ok": {
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.LogInInfo": {
      "description": "Login credentials for username/password authentication. Used by POST /api/auth/login and POST /api/auth/renew",
      "required": [
        "UserName",
        "Password",
        "Database",
        "ApiKey"
      ],
      "type": "object",
      "properties": {
        "UserName": {
          "description": "The username (email address) of the user",
          "type": "string"
        },
        "Password": {
          "description": "The user's password",
          "type": "string"
        },
        "Database": {
          "description": "The Lemonsoft database identifier to connect to",
          "type": "string"
        },
        "ApiKey": {
          "description": "The API key provided by Lemonsoft for your integration",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.AuthenticationResponse": {
      "description": "Response returned by the login, renew, and token authentication endpoints",
      "type": "object",
      "properties": {
        "message": {
          "description": "A status message. Returns \"ok\" on successful authentication, or an error description on failure",
          "type": "string"
        },
        "code": {
          "description": "The HTTP status code of the authentication result",
          "enum": [
            "Continue",
            "SwitchingProtocols",
            "OK",
            "Created",
            "Accepted",
            "NonAuthoritativeInformation",
            "NoContent",
            "ResetContent",
            "PartialContent",
            "MultipleChoices",
            "Ambiguous",
            "MovedPermanently",
            "Moved",
            "Found",
            "Redirect",
            "SeeOther",
            "RedirectMethod",
            "NotModified",
            "UseProxy",
            "Unused",
            "TemporaryRedirect",
            "RedirectKeepVerb",
            "BadRequest",
            "Unauthorized",
            "PaymentRequired",
            "Forbidden",
            "NotFound",
            "MethodNotAllowed",
            "NotAcceptable",
            "ProxyAuthenticationRequired",
            "RequestTimeout",
            "Conflict",
            "Gone",
            "LengthRequired",
            "PreconditionFailed",
            "RequestEntityTooLarge",
            "RequestUriTooLong",
            "UnsupportedMediaType",
            "RequestedRangeNotSatisfiable",
            "ExpectationFailed",
            "UpgradeRequired",
            "InternalServerError",
            "NotImplemented",
            "BadGateway",
            "ServiceUnavailable",
            "GatewayTimeout",
            "HttpVersionNotSupported"
          ],
          "type": "string"
        },
        "session_id": {
          "description": "The session identifier. Pass this value in the Session-Id header for all subsequent API requests.\r\nEmpty string on authentication failure",
          "type": "string"
        },
        "version": {
          "description": "The REST API version",
          "type": "string"
        },
        "build_version": {
          "description": "The build version of the LemonRest application",
          "type": "string"
        },
        "expire_time": {
          "format": "date-time",
          "description": "The time when the session_id will expire in UTC time. After this time, you must re-authenticate",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.LogInToken": {
      "description": "Token-based login credentials. Used by POST /api/auth/login/token when authenticating with a pre-existing token instead of username/password",
      "required": [
        "Token",
        "Database",
        "ApiKey"
      ],
      "type": "object",
      "properties": {
        "Token": {
          "description": "A valid authentication token (e.g., Azure AD B2C token)",
          "type": "string"
        },
        "Database": {
          "description": "The Lemonsoft database identifier to connect to",
          "type": "string"
        },
        "ApiKey": {
          "description": "The API key provided by Lemonsoft for your integration",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.Automation": {
      "description": "A scheduled automation (automaatio). Defines when a recurring task runs and which transfer filters\r\nare applied when it executes. All date and time values are in UTC.",
      "type": "object",
      "properties": {
        "Automation_id": {
          "format": "int32",
          "description": "The unique identifier of the automation.",
          "type": "integer"
        },
        "Automation_header": {
          "description": "The name (header) of the automation.",
          "type": "string"
        },
        "Automation_description": {
          "description": "The free text description of the automation.",
          "type": "string"
        },
        "Automation_execution_time": {
          "format": "date-time",
          "description": "The time of day the automation is executed (UTC).",
          "type": "string"
        },
        "Automation_weekday": {
          "format": "int32",
          "description": "The weekdays on which the automation runs, encoded as a bitmask (bit 0 = Monday).",
          "type": "integer"
        },
        "Automation_month": {
          "format": "int32",
          "description": "The months in which the automation runs, encoded as a bitmask (bit 0 = January).",
          "type": "integer"
        },
        "Automation_begin": {
          "format": "date-time",
          "description": "The date from which the automation is active (UTC).",
          "type": "string"
        },
        "Automation_end": {
          "format": "date-time",
          "description": "The date after which the automation stops running (UTC), or null when it has no end date.",
          "type": "string"
        },
        "Automation_recurrent_type": {
          "format": "int32",
          "description": "The recurrence type of the schedule.",
          "type": "integer"
        },
        "Automation_recurrent_value": {
          "format": "int32",
          "description": "The recurrence interval value for the selected recurrence type.",
          "type": "integer"
        },
        "Automation_on": {
          "description": "Indicates whether the automation is enabled.",
          "type": "boolean"
        },
        "Automation_type": {
          "format": "int32",
          "description": "The automation type.",
          "type": "integer"
        },
        "Automation_subtype": {
          "format": "int32",
          "description": "The automation subtype.",
          "type": "integer"
        },
        "Automation_calendardays": {
          "description": "The calendar days configuration for the schedule.",
          "type": "string"
        },
        "Automation_group_id": {
          "format": "int32",
          "description": "The identifier of the worktime group the automation targets.",
          "type": "integer"
        },
        "AutomationTransferFilters": {
          "description": "The transfer filters applied when the automation runs.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.AutomationTransferFilter"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.AutomationTransferFilter": {
      "description": "A transfer filter applied by an automation when it runs.",
      "type": "object",
      "properties": {
        "AutomationID": {
          "format": "int32",
          "description": "The identifier of the automation this filter belongs to.",
          "type": "integer"
        },
        "FilterNumber": {
          "format": "int32",
          "description": "The filter slot number.",
          "type": "integer"
        },
        "FilterValue": {
          "description": "The value configured for the filter slot.",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.CampaignFilter": {
      "description": "Filter for querying campaigns. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter",
      "type": "object",
      "properties": {
        "campaign_type": {
          "format": "int32",
          "description": "Filter by campaign type. For possible values, refer to /api/settings/crm_types\r\n[here](#tag/Settings/operation/Settings_GetCrmTypes)",
          "type": "integer"
        },
        "campaign_state": {
          "format": "int32",
          "description": "Filter by campaign state",
          "type": "integer"
        },
        "responsible_person": {
          "format": "int32",
          "description": "Filter by responsible person number. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "campaign_created_before": {
          "format": "date-time",
          "description": "Filter campaigns created before this date",
          "type": "string"
        },
        "campaign_created_after": {
          "format": "date-time",
          "description": "Filter campaigns created after this date",
          "type": "string"
        },
        "campaign_description": {
          "description": "Filter by campaign description (partial match)",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Filter campaigns updated before this date",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "description": "Filter campaigns updated after this date",
          "type": "string"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Campaign]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Campaign"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Campaign": {
      "description": "A campaign with contacts, products, and attributes (kohderyhmä)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The internal database ID of the campaign",
          "type": "integer"
        },
        "campaign_number": {
          "format": "int32",
          "description": "The unique campaign number",
          "type": "integer"
        },
        "campaign_type": {
          "format": "int32",
          "description": "The campaign type. For possible values, refer to /api/settings/crm_types\r\n[here](#tag/Settings/operation/Settings_GetCrmTypes)",
          "type": "integer"
        },
        "campaign_type_text": {
          "description": "The campaign type description (read-only, resolved from campaign_type)",
          "type": "string"
        },
        "campaign_date": {
          "format": "date-time",
          "description": "The creation date of the campaign",
          "type": "string"
        },
        "campaign_startdate": {
          "format": "date-time",
          "description": "The start date of the campaign",
          "type": "string"
        },
        "campaign_enddate": {
          "format": "date-time",
          "description": "The end date of the campaign",
          "type": "string"
        },
        "campaign_description": {
          "description": "The campaign description or name",
          "type": "string"
        },
        "responsible_person": {
          "format": "int32",
          "description": "The responsible person number (vastuuhenkilö). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "campaign_project_number_list": {
          "description": "List of project numbers linked to this campaign. For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_GetProjects)",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "campaign_note": {
          "description": "Free-text notes for the campaign",
          "type": "string"
        },
        "campaign_maxamount": {
          "format": "int32",
          "description": "The maximum number of participants for the campaign",
          "type": "integer"
        },
        "campaign_location": {
          "description": "The location of the campaign event",
          "type": "string"
        },
        "campaign_time": {
          "description": "The time of the campaign event",
          "type": "string"
        },
        "campaign_registration": {
          "description": "Registration information for the campaign",
          "type": "string"
        },
        "campaign_instructor": {
          "description": "The instructor or presenter for the campaign",
          "type": "string"
        },
        "campaign_invoicing_customer": {
          "format": "int32",
          "description": "The invoicing customer number for the campaign. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_GetCustomers)",
          "type": "integer"
        },
        "campaign_contacts": {
          "description": "The contacts associated with this campaign",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CampaignContact"
          }
        },
        "campaign_products": {
          "description": "The products associated with this campaign",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CampaignProduct"
          }
        },
        "campaign_attributes": {
          "description": "The custom attributes for this campaign",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CampaignAttribute"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CampaignContact": {
      "description": "A contact entry in a campaign, tracking customer interactions and outcomes (kampanjan kontakti)",
      "type": "object",
      "properties": {
        "campaign_contact_id": {
          "format": "int32",
          "description": "The unique ID of this campaign contact entry",
          "type": "integer"
        },
        "campaign_id": {
          "format": "int32",
          "description": "The internal database ID of the campaign this contact belongs to",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_GetCustomers)",
          "type": "integer"
        },
        "campaign_customer_name": {
          "description": "The customer name",
          "type": "string"
        },
        "customer_contact_id": {
          "format": "int32",
          "description": "The contact person ID within the customer",
          "type": "integer"
        },
        "campaign_contact_name": {
          "description": "The contact person name",
          "type": "string"
        },
        "campaign_contacted_bit": {
          "description": "Indicates if the contact has been reached",
          "type": "boolean"
        },
        "campaign_deal_bit": {
          "description": "Indicates if a deal was made with this contact",
          "type": "boolean"
        },
        "campaign_invoice_bit": {
          "description": "Indicates if the contact has been invoiced",
          "type": "boolean"
        },
        "campaign_contact_group": {
          "description": "The contact group classification",
          "type": "string"
        },
        "campaign_contact_called": {
          "description": "Indicates if the contact has been called",
          "type": "boolean"
        },
        "campaign_contact_date": {
          "format": "date-time",
          "description": "The date when the contact was reached",
          "type": "string"
        },
        "campaign_contact_time": {
          "description": "The time when the contact was reached",
          "type": "string"
        },
        "campaign_contacted_info": {
          "description": "Additional information about the contact interaction",
          "type": "string"
        },
        "campaign_contact_product_code": {
          "description": "The product code offered to this contact. For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_GetProducts)",
          "type": "string"
        },
        "campaign_contact_discount": {
          "format": "double",
          "description": "The discount percentage offered to this contact",
          "type": "number"
        },
        "cost_centre": {
          "description": "The cost center code (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.CampaignProduct": {
      "description": "A product associated with a campaign (kampanjan tuote)",
      "type": "object",
      "properties": {
        "campaign_product_id": {
          "format": "int32",
          "description": "The unique ID of this campaign product entry",
          "type": "integer"
        },
        "campaign_id": {
          "format": "int32",
          "description": "The internal database ID of the campaign this product belongs to",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code. For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_GetProducts)",
          "type": "string"
        },
        "campaign_product_price": {
          "format": "double",
          "description": "The campaign-specific price for this product",
          "type": "number"
        },
        "campaign_product_amount": {
          "format": "double",
          "description": "The quantity of this product in the campaign",
          "type": "number"
        },
        "campaign_product_default": {
          "description": "Indicates if this is the default product for the campaign",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.CampaignAttribute": {
      "description": "A custom attribute for a campaign (kampanjan attribuutti)",
      "type": "object",
      "properties": {
        "attribute_code": {
          "format": "int32",
          "description": "The attribute code identifier",
          "type": "integer"
        },
        "is_checked": {
          "description": "Indicates if this attribute is enabled for the campaign",
          "type": "boolean"
        },
        "attribute_description": {
          "description": "The description of the attribute",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.CreateUpdateResponse": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "id": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Campaign]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Campaign"
        }
      }
    },
    "LemonRest.Models.QueryFilters.CodelistFilter": {
      "description": "Filter for querying codelist entries. The CodeListFilter parameter is required and determines which codelist type to retrieve",
      "required": [
        "CodeListFilter"
      ],
      "type": "object",
      "properties": {
        "Name": {
          "description": "Filter by codelist entry description (partial match)",
          "type": "string"
        },
        "CodeListFilter": {
          "description": "The codelist type to retrieve (required). See the CodeList enum for available values (0–35)",
          "enum": [
            "CODELISTS",
            "ABC_GROUPS",
            "AREAS",
            "BUSINESS_ACTIVITY_AREACODES",
            "BUSINESSCODES",
            "CHAINS",
            "COMPANY_GROUPS",
            "CUSTOMER_CLASSES",
            "CUSTOMER_SEGMENT_CODES",
            "EMPLOYER_QUANTITY_CODES",
            "MAINBUSINESS_CODES",
            "TURNOVER_CODES",
            "DELIVERY_METHODS",
            "DELIVERYPACKAGE_TYPES",
            "PRODUCT_COLORS",
            "DRIVERS",
            "COUNTRIES",
            "DELIVERY_TERMS",
            "INVOICE_METHODS",
            "EXPENSE_GROUPS",
            "ACCOUNT_TYPES",
            "TAXTREATMENT_CODES",
            "PRODUCT_SHELF",
            "PRODUCT_MARKS",
            "ROUTES",
            "INVOICING_TYPE",
            "PRODUCT_LINES",
            "PRODUCTFAMILY",
            "PROJECT_CONTRACT_TYPES",
            "PROJECT_ENTERPRISE",
            "PROJECT_TYPE",
            "PROJECTPHASES",
            "TITLE_NUMBERS",
            "PERSON_ABSENCE_REASONS",
            "SALESCHANNEL",
            "PRODUCT_MATERIAL"
          ],
          "type": "string"
        },
        "Object_ids": {
          "description": "Filter by specific codelist entry IDs",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodelistBase]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CodelistBase"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CodelistBase": {
      "description": "Base codelist entry with an ID and description. All codelist types inherit from this class",
      "type": "object",
      "properties": {
        "Id": {
          "format": "int32",
          "description": "The unique identifier of the codelist entry",
          "type": "integer"
        },
        "Description": {
          "description": "The description of the codelist entry",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PaymentTerm]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PaymentTerm"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PaymentTerm": {
      "description": "A payment term definition with discount and cash flow tiers (maksuehto)",
      "type": "object",
      "properties": {
        "number": {
          "format": "int32",
          "description": "The payment term number",
          "type": "integer"
        },
        "description": {
          "description": "The payment term description",
          "type": "string"
        },
        "netto_days": {
          "format": "int32",
          "description": "The number of net days until the invoice is due",
          "type": "integer"
        },
        "discount_days1": {
          "format": "int32",
          "description": "The number of days for the first cash discount tier (käteisalennus)",
          "type": "integer"
        },
        "discount1": {
          "format": "double",
          "description": "The first cash discount percentage",
          "type": "number"
        },
        "discount_days2": {
          "format": "int32",
          "description": "The number of days for the second cash discount tier",
          "type": "integer"
        },
        "discount2": {
          "format": "double",
          "description": "The second cash discount percentage",
          "type": "number"
        },
        "discount_days3": {
          "format": "int32",
          "description": "The number of days for the third cash discount tier",
          "type": "integer"
        },
        "discount3": {
          "format": "double",
          "description": "The third cash discount percentage",
          "type": "number"
        },
        "language_code": {
          "description": "The language code for the payment term description. For possible values, refer to /api/settings/languages\r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
          "type": "string"
        },
        "cashflow_days1": {
          "format": "int32",
          "description": "The number of days for the first cash flow tier",
          "type": "integer"
        },
        "cashflow_days2": {
          "format": "int32",
          "description": "The number of days for the second cash flow tier",
          "type": "integer"
        },
        "cashflow_days3": {
          "format": "int32",
          "description": "The number of days for the third cash flow tier",
          "type": "integer"
        },
        "cashflow1": {
          "format": "double",
          "description": "The first cash flow percentage",
          "type": "number"
        },
        "cashflow2": {
          "format": "double",
          "description": "The second cash flow percentage",
          "type": "number"
        },
        "cashflow3": {
          "format": "double",
          "description": "The third cash flow percentage",
          "type": "number"
        },
        "id": {
          "format": "int32",
          "description": "The unique identifier of the payment term",
          "type": "integer"
        },
        "eom": {
          "description": "Indicates if the payment term uses end-of-month calculation for the net period",
          "type": "boolean"
        },
        "duedate_eom": {
          "description": "Indicates if the due date is moved to the end of the month",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Currency]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Currency"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Currency": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "rate": {
          "format": "double",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.ExpenseGroup": {
      "description": "An expense group definition (kululaji)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique identifier of the expense group",
          "type": "integer"
        },
        "description": {
          "description": "The description of the expense group",
          "type": "string"
        },
        "budget": {
          "description": "Indicates if this expense group is included in budgeting",
          "type": "boolean"
        },
        "report_group": {
          "format": "int32",
          "description": "The report group number for grouping expense groups in reports",
          "type": "integer"
        },
        "product_attribute_code": {
          "format": "int32",
          "description": "The product attribute code linked to this expense group",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.CodeBase": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.TrueFalseResponse": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.LtaDimension": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "code": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "is_passive": {
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductMaterial": {
      "description": "A product material definition (tuotemateriaali)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique identifier of the product material",
          "type": "integer"
        },
        "description": {
          "description": "The description of the product material",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Company]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Company"
        }
      }
    },
    "LemonRest.Models.Proxy.Company": {
      "description": "The company model with basic information and locations",
      "type": "object",
      "properties": {
        "vat": {
          "description": "The company VAT number (Y-tunnus / ALV-numero)",
          "type": "string"
        },
        "unit": {
          "description": "The company unit",
          "type": "string"
        },
        "name": {
          "description": "The company name",
          "type": "string"
        },
        "ovt": {
          "description": "The EDI code used for electronic invoicing (OVT-tunnus)",
          "type": "string"
        },
        "gln": {
          "description": "The Global Location Number (GLN)",
          "type": "string"
        },
        "locations": {
          "description": "The company locations (toimipaikat)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Location"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Location": {
      "description": "A company location (toimipaikka)",
      "type": "object",
      "properties": {
        "location_id": {
          "format": "int32",
          "description": "The location id",
          "type": "integer"
        },
        "location": {
          "description": "The location name (toimipaikka)",
          "type": "string"
        },
        "additional_name": {
          "description": "The additional name for the location",
          "type": "string"
        },
        "street": {
          "description": "The street address of the location",
          "type": "string"
        },
        "city": {
          "description": "The city of the location",
          "type": "string"
        },
        "postal_code": {
          "description": "The postal code of the location",
          "type": "string"
        },
        "country": {
          "description": "The country code of the location. For possible values, refer to /api/codelist/description?filter.codeListFilter=COUNTRIES. The country's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "remarktime": {
          "description": "The dispute period in days (huomautusaika)",
          "type": "string"
        },
        "interest": {
          "format": "double",
          "description": "The late payment interest percentage (viivästyskorko)",
          "type": "number"
        },
        "costcenter": {
          "description": "The cost center for the location (kustannuspaikka). For possible values, refer to /api/settings/costcenters. The costcenter's value corresponds to the number returned by /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "lta": {
          "description": "The LTA code for the location. For possible values, refer to /api/settings/ltas. The lta's value corresponds to the number returned by /api/settings/ltas\r\n[here](#tag/Settings/operation/Settings_GetLtas)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.CompanyLocationLanguage": {
      "description": "Company location language row (companylocations table).",
      "type": "object",
      "properties": {
        "companylocation_id": {
          "format": "int32",
          "type": "integer"
        },
        "location_id": {
          "format": "int32",
          "type": "integer"
        },
        "company_location": {
          "type": "string"
        },
        "companylocation_address": {
          "type": "string"
        },
        "companylocation_postaladdress": {
          "type": "string"
        },
        "companylocation_countrycode": {
          "type": "string"
        },
        "company_language": {
          "type": "string"
        },
        "company_id": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.BankAccountFilter": {
      "description": "Filter for querying company bank accounts",
      "required": [
        "account_type"
      ],
      "type": "object",
      "properties": {
        "account_type": {
          "description": "The bank account type to retrieve. Required. 0 = Invoicing (default), 1 = ElectronicInvoicing, 2 = Payments",
          "enum": [
            "Invoicing",
            "ElectronicInvoicing",
            "Payments"
          ],
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CompanyAccount]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CompanyAccount"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CompanyAccount": {
      "description": "A company bank account (pankkitili)",
      "type": "object",
      "properties": {
        "id": {
          "description": "The bank account id (pankkikoodi). For possible values, refer to /api/company/accounts\r\n[here](#tag/company/operation/Company_GetAccounts)",
          "type": "string"
        },
        "name": {
          "description": "The bank account name",
          "type": "string"
        },
        "iban": {
          "description": "The IBAN number of the bank account",
          "type": "string"
        },
        "bic": {
          "description": "The BIC/SWIFT code of the bank account",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ContactFilter": {
      "description": "Filter for querying customer contacts. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Filter by contact name. Uses a contains match against the contact's name",
          "type": "string"
        },
        "email": {
          "description": "Filter by contact email. Uses a contains match against the contact's email address",
          "type": "string"
        },
        "modified_before": {
          "format": "date-time",
          "description": "Return only contacts modified before this date/time (default: tomorrow)",
          "type": "string"
        },
        "modified_after": {
          "format": "date-time",
          "description": "Return only contacts modified after this date/time (default: 1970-01-01)",
          "type": "string"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CustomerContact]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerContact"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerContact": {
      "description": "A contact person (yhteyshenkilö) for a customer",
      "required": [
        "customer_id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the contact",
          "type": "integer"
        },
        "customer_id": {
          "format": "int32",
          "description": "The customer id this contact belongs to (required)",
          "type": "integer"
        },
        "name": {
          "description": "The contact person's name",
          "type": "string"
        },
        "attributes": {
          "description": "The contact person's attributes",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerContactAttribute"
          }
        },
        "street": {
          "description": "The contact person's street address",
          "type": "string"
        },
        "street2": {
          "description": "The contact person's additional street address line",
          "type": "string"
        },
        "department": {
          "description": "The contact person's department (osasto)",
          "type": "string"
        },
        "email": {
          "description": "The contact person's email address",
          "type": "string"
        },
        "fax": {
          "description": "The contact person's fax number",
          "type": "string"
        },
        "gsm": {
          "description": "The contact person's mobile phone number",
          "type": "string"
        },
        "note": {
          "description": "A note about the contact person",
          "type": "string"
        },
        "phone": {
          "description": "The contact person's phone number",
          "type": "string"
        },
        "postal_city": {
          "description": "The contact person's postal city",
          "type": "string"
        },
        "postal_code": {
          "description": "The contact person's postal code",
          "type": "string"
        },
        "city": {
          "description": "The contact person's city",
          "type": "string"
        },
        "title": {
          "description": "The contact person's job title",
          "type": "string"
        },
        "title_number": {
          "format": "int32",
          "description": "The formal title number",
          "type": "integer"
        },
        "language": {
          "description": "The language of the contact. For possible values, refer to /api/settings/languages\r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
          "type": "string"
        },
        "culture": {
          "description": "The culture code of the contact (e.g. \"fi-FI\"). For possible values, refer to /api/settings/languages",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerContactAttribute": {
      "description": "An attribute associated with a customer contact person",
      "required": [
        "id",
        "selected"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The attribute id (required)",
          "type": "integer"
        },
        "name": {
          "description": "The attribute name/description",
          "type": "string"
        },
        "selected": {
          "description": "Indicates if the attribute is selected for this contact (required)",
          "type": "boolean"
        },
        "contact_id": {
          "format": "int32",
          "description": "The contact id this attribute belongs to",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.CustomerFilter": {
      "description": "Filter for querying customers. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter",
      "type": "object",
      "properties": {
        "name": {
          "description": "Filter by customer name. Performs a contains search",
          "type": "string"
        },
        "search_name": {
          "description": "Filter by customer search name (hakutermi). Performs a contains search",
          "type": "string"
        },
        "email": {
          "description": "Filter by customer email. Performs a contains search",
          "type": "string"
        },
        "phone": {
          "description": "Filter by customer phone number. Performs a contains search",
          "type": "string"
        },
        "contact_email": {
          "description": "Filter by contact person's email. Performs a contains search",
          "type": "string"
        },
        "contact_phone": {
          "description": "Filter by contact person's phone. Performs a contains search",
          "type": "string"
        },
        "vat": {
          "description": "Filter by VAT number (Y-tunnus). Performs a contains search",
          "type": "string"
        },
        "city": {
          "description": "Filter by city. Performs a contains search",
          "type": "string"
        },
        "postal_code": {
          "description": "Filter by postal code. Performs a contains search",
          "type": "string"
        },
        "agreement_product": {
          "description": "Filter by agreement product code. Performs a contains search",
          "type": "string"
        },
        "modified_before": {
          "format": "date-time",
          "description": "Filter customers modified before this date",
          "type": "string"
        },
        "modified_after": {
          "format": "date-time",
          "description": "Filter customers modified after this date",
          "type": "string"
        },
        "has_email": {
          "format": "int32",
          "description": "Filter by email existence. 1 = has email, 0 = no email",
          "type": "integer"
        },
        "is_customer": {
          "format": "int32",
          "description": "Filter by customer flag. 1 = is customer, 0 = not customer",
          "type": "integer"
        },
        "is_supplier": {
          "format": "int32",
          "description": "Filter by supplier flag. 1 = is supplier, 0 = not supplier",
          "type": "integer"
        },
        "seller_number": {
          "format": "int32",
          "description": "Filter by seller person number (myyjänumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "customer_number": {
          "description": "Filter by customer numbers. Accepts a list of customer numbers",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "group": {
          "format": "int32",
          "description": "Filter by customer group number",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "Filter by customer type",
          "type": "integer"
        },
        "skip_passive": {
          "description": "When true, excludes non-active customers from results",
          "type": "boolean"
        },
        "is_prospect": {
          "description": "Filter by prospect flag. When set, returns only matching prospect status",
          "type": "boolean"
        },
        "is_nonactive": {
          "description": "Filter by non-active flag. When set, returns only matching non-active status",
          "type": "boolean"
        },
        "created_before": {
          "format": "date-time",
          "description": "Filter customers created before this date",
          "type": "string"
        },
        "created_after": {
          "format": "date-time",
          "description": "Filter customers created after this date",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Filter customers updated (edit_date) before this date",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "description": "Filter customers updated (edit_date) after this date",
          "type": "string"
        },
        "attribute_ids": {
          "description": "Filter by customer attribute ids. Returns only customers that have all specified attributes selected",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "hide_models": {
          "description": "When true, hides model customers (customer_number = 0) from results",
          "type": "boolean"
        },
        "sort_desc": {
          "description": "Sorting order by id. Default is ascending (false).",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Customer]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Customer"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Customer": {
      "description": "A customer (asiakas) with full details including agreements, contacts, accounts, texts, and circulations",
      "required": [
        "name"
      ],
      "type": "object",
      "properties": {
        "searchname": {
          "description": "The customer's search name (hakutermi)",
          "type": "string"
        },
        "email": {
          "description": "The customer's email address",
          "type": "string"
        },
        "currency_code": {
          "description": "The customer's currency code, ISO 4217 (valuuttakoodi). For possible values, refer to /api/settings/currency/{code}\r\n[here](#tag/Settings/operation/Settings_GetCurrency)",
          "type": "string"
        },
        "attributes": {
          "description": "The customer's attributes (ominaisuudet)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerAttribute"
          }
        },
        "contacts": {
          "description": "The customer's contact persons (yhteyshenkilöt)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerContact"
          }
        },
        "texts": {
          "description": "The customer's text entries (tekstit)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerText"
          }
        },
        "costcenter": {
          "description": "The cost center code (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "delivery_code": {
          "description": "The delivery code (toimituskoodi)",
          "type": "string"
        },
        "invoicing_customer_number": {
          "format": "int32",
          "description": "The invoicing customer number (laskutusasiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "orderer_customer_number": {
          "format": "int32",
          "description": "The orderer customer number (tilaaja-asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "is_customer": {
          "description": "Indicates if the record is marked as a customer",
          "type": "boolean"
        },
        "is_nonactive": {
          "description": "Indicates if the customer is non-active (passiivinen)",
          "type": "boolean"
        },
        "is_prospect": {
          "description": "Indicates if the record is a prospect (liidi)",
          "type": "boolean"
        },
        "is_supplier": {
          "description": "Indicates if the record is marked as a supplier (toimittaja)",
          "type": "boolean"
        },
        "customer_state_number": {
          "format": "int32",
          "description": "Customer lifecycle state number. Managed by state machine (ProgramId=9). States are database-configured.",
          "type": "integer"
        },
        "created": {
          "format": "date-time",
          "description": "The creation timestamp",
          "type": "string"
        },
        "modified": {
          "format": "date-time",
          "description": "The last modification timestamp",
          "type": "string"
        },
        "delivery_method_number": {
          "format": "int32",
          "description": "The delivery method number (toimitustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_METHODS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "delivery_term": {
          "format": "int32",
          "description": "The delivery term (toimitusehto). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_TERMS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "payment_term_number": {
          "format": "int32",
          "description": "The payment term number (maksuehto). For possible values, refer to /api/codelist/payment_term\r\n[here](#tag/codelist/operation/Codelist_ListPaymentTerms)",
          "type": "integer"
        },
        "interest": {
          "format": "double",
          "description": "The interest percentage for overdue invoices (viivästyskorko)",
          "type": "number"
        },
        "sales_account": {
          "description": "The sales accounting account (myyntitili). For possible values, refer to /api/settings/chart_of_accounts\r\n[here](#tag/Settings/operation/Settings_GetChartOfAccounts)",
          "type": "string"
        },
        "purchase_account": {
          "description": "The purchase accounting account (ostotili). For possible values, refer to /api/settings/chart_of_accounts\r\n[here](#tag/Settings/operation/Settings_GetChartOfAccounts)",
          "type": "string"
        },
        "receivables_account": {
          "description": "The accounts receivable account (myyntisaamiset). For possible values, refer to /api/settings/chart_of_accounts\r\n[here](#tag/Settings/operation/Settings_GetChartOfAccounts)",
          "type": "string"
        },
        "accountspayable_account": {
          "description": "The accounts payable account (ostovelat). For possible values, refer to /api/settings/chart_of_accounts\r\n[here](#tag/Settings/operation/Settings_GetChartOfAccounts)",
          "type": "string"
        },
        "customer_edi": {
          "description": "The customer's EDI identifier",
          "type": "string"
        },
        "invoice_method_id": {
          "format": "int32",
          "description": "The invoice method id (laskutustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=INVOICE_METHODS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "invoice_code": {
          "description": "The e-invoice operator code (verkkolaskuoperaattori)",
          "type": "string"
        },
        "finvoice_address": {
          "description": "The e-invoice (Finvoice) address (verkkolaskuosoite)",
          "type": "string"
        },
        "reference": {
          "description": "The customer's reference (viite)",
          "type": "string"
        },
        "creditlimit": {
          "format": "double",
          "description": "The credit limit (luottoraja)",
          "type": "number"
        },
        "deny_credit": {
          "description": "Indicates if credit is denied for this customer (luottokielto)",
          "type": "boolean"
        },
        "reseller": {
          "format": "int32",
          "description": "The reseller customer number (jälleenmyyjä)",
          "type": "integer"
        },
        "default_reference": {
          "description": "The default reference text (oletusviite)",
          "type": "string"
        },
        "prevent_delivery": {
          "description": "Indicates if delivery is prevented for this customer (toimituskielto)",
          "type": "boolean"
        },
        "partial_delivery_disabled": {
          "description": "Indicates if partial delivery is disabled (osatoimitus estetty)",
          "type": "boolean"
        },
        "invoiceperiod": {
          "format": "int32",
          "description": "The invoicing period",
          "type": "integer"
        },
        "invoicedates": {
          "description": "The invoicing dates pattern",
          "type": "string"
        },
        "due_invoice_sum": {
          "format": "double",
          "description": "The total sum of overdue invoices (erääntyneet laskut)",
          "type": "number"
        },
        "open_invoice_sum": {
          "format": "double",
          "description": "The total sum of open (unpaid) invoices (avoimet laskut)",
          "type": "number"
        },
        "sales_posting_matrix": {
          "format": "int32",
          "description": "The sales posting matrix number (myynnin tiliöintimatriisi). See /api/settings/posting_matrix for available values.",
          "type": "integer"
        },
        "purchase_posting_matrix": {
          "format": "int32",
          "description": "The purchase posting matrix number (ostojen tiliöintimatriisi). See /api/settings/posting_matrix for available values.",
          "type": "integer"
        },
        "agreements": {
          "description": "The customer's service agreements (sopimukset)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerAgreement"
          }
        },
        "accounts": {
          "description": "The customer's bank accounts (pankkitilit)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerAccount"
          }
        },
        "circulations": {
          "description": "The customer's circulation entries (kierrot)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerCirculation"
          }
        },
        "dimension": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerDimension",
          "description": "The customer's dimension/classification data (luokittelutiedot)"
        },
        "person_responsible_number": {
          "format": "int32",
          "description": "The responsible person number (vastuuhenkilö). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "customer_discount": {
          "format": "double",
          "description": "The default customer discount percentage (asiakasalennus)",
          "type": "number"
        },
        "stock_number": {
          "format": "int32",
          "description": "The default stock/warehouse number (varastonumero). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "driver": {
          "format": "int32",
          "description": "The driver number (kuljettaja). For possible values, refer to /api/codelist/description?filter.codeListFilter=DRIVERS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "route": {
          "format": "int32",
          "description": "The route code (reitti). For possible values, refer to /api/codelist/description?filter.codeListFilter=ROUTES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "order_collect": {
          "format": "int32",
          "description": "Indicates whether the customer is set to have automatic collection of orders (automaattinen keräyslupa). 0 = manual, 1 = automatic.",
          "maximum": 1,
          "minimum": 0,
          "type": "integer"
        },
        "id": {
          "format": "int32",
          "description": "The unique id of the customer",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The customer number (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "name": {
          "description": "The customer name (required)",
          "type": "string"
        },
        "name2": {
          "description": "The customer's additional name line",
          "type": "string"
        },
        "phone": {
          "description": "The customer's phone number",
          "type": "string"
        },
        "vat": {
          "description": "The customer's VAT number (Y-tunnus)",
          "type": "string"
        },
        "vatunit": {
          "description": "The department code qualifying the VAT number (y-tunnuksen osastotunnus).\r\nSeveral customers can share one VAT number and are told apart by this code,\r\nso a lookup by VAT alone is not guaranteed to identify a single customer.",
          "type": "string"
        },
        "street": {
          "description": "The customer's street address",
          "type": "string"
        },
        "street2": {
          "description": "The customer's additional street address line",
          "type": "string"
        },
        "city": {
          "description": "The customer's city",
          "type": "string"
        },
        "postal_code": {
          "description": "The customer's postal code",
          "type": "string"
        },
        "country": {
          "description": "The customer's country code (maakoodi). For possible values, refer to /api/codelist/description?filter.codeListFilter=COUNTRIES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "www": {
          "description": "The customer's website URL",
          "type": "string"
        },
        "language_code": {
          "description": "The customer's language code (kielikoodi). For possible values, refer to /api/settings/languages\r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
          "type": "string"
        },
        "group": {
          "format": "int32",
          "description": "The customer group number (asiakasryhmä)",
          "type": "integer"
        },
        "customer_group_id": {
          "format": "int32",
          "description": "The customer group id. For possible values, refer to GET /api/customers/groups",
          "type": "integer"
        },
        "invoicing_name": {
          "description": "The invoicing customer name",
          "type": "string"
        },
        "invoicing_name2": {
          "description": "The invoicing customer additional name",
          "type": "string"
        },
        "invoicing_address": {
          "description": "The invoicing address",
          "type": "string"
        },
        "invoicing_postaladdress": {
          "description": "The invoicing postal address",
          "type": "string"
        },
        "invoicing_postal_code": {
          "description": "The invoicing postal code",
          "type": "string"
        },
        "invoicing_city": {
          "description": "The invoicing city",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The customer type",
          "type": "integer"
        },
        "seller_number": {
          "format": "int32",
          "description": "The seller person number (myyjänumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "fax": {
          "description": "The customer's fax number",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerAttribute": {
      "description": "A customer attribute (ominaisuus) that can be toggled on or off",
      "required": [
        "id",
        "selected"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The attribute id (required)",
          "type": "integer"
        },
        "name": {
          "description": "The attribute name/description",
          "type": "string"
        },
        "selected": {
          "description": "Indicates if the attribute is selected for this customer (required)",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerText": {
      "description": "A text entry associated with a customer",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the text entry",
          "type": "integer"
        },
        "header_number": {
          "format": "int32",
          "description": "The text header number (1–10). Each number can only be used once per customer",
          "type": "integer"
        },
        "note": {
          "description": "The text content",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerAgreement": {
      "description": "A service agreement (sopimus) associated with a customer",
      "type": "object",
      "properties": {
        "products": {
          "description": "The agreement's products",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerAgreementProduct"
          }
        },
        "id": {
          "format": "int32",
          "description": "The unique id of the agreement",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The agreement type",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The agreement date",
          "type": "string"
        },
        "invoicing_customer": {
          "format": "int32",
          "description": "The invoicing customer number for this agreement. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "notes": {
          "description": "Notes for the agreement",
          "type": "string"
        },
        "period_length": {
          "format": "int32",
          "description": "The agreement period length in months",
          "type": "integer"
        },
        "description": {
          "description": "The agreement description",
          "type": "string"
        },
        "startdate": {
          "format": "date-time",
          "description": "The agreement start date",
          "type": "string"
        },
        "enddate": {
          "format": "date-time",
          "description": "The agreement end date",
          "type": "string"
        },
        "checkdate": {
          "format": "date-time",
          "description": "The next check/review date (tarkistuspäivä)",
          "type": "string"
        },
        "install_date": {
          "format": "date-time",
          "description": "The installation date",
          "type": "string"
        },
        "invoiced_date": {
          "format": "date-time",
          "description": "The last invoicing date for this agreement",
          "type": "string"
        },
        "mark": {
          "description": "The agreement mark/reference",
          "type": "string"
        },
        "invoice_text": {
          "description": "The text that appears on generated invoices",
          "type": "string"
        },
        "order_number": {
          "description": "The related order number",
          "type": "string"
        },
        "blocking": {
          "format": "int32",
          "description": "The blocking mode. 0 = not blocked",
          "type": "integer"
        },
        "responsible_person": {
          "format": "int32",
          "description": "The responsible person number (vastuuhenkilö). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "invoice_travelling_bit": {
          "description": "Indicates if travel costs should be invoiced",
          "type": "boolean"
        },
        "auto_renew_bit": {
          "description": "Indicates if the agreement should auto-renew at the end date",
          "type": "boolean"
        },
        "service_person_number": {
          "format": "int32",
          "description": "The service person number (huoltohenkilö). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "backup_service_person_number": {
          "format": "int32",
          "description": "The backup service person number (varahuoltohenkilö). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "response_time": {
          "format": "double",
          "description": "The guaranteed response time in hours",
          "type": "number"
        },
        "leasing_number": {
          "description": "The leasing contract number",
          "type": "string"
        },
        "leasing_start_date": {
          "format": "date-time",
          "description": "The leasing start date",
          "type": "string"
        },
        "leasing_end_date": {
          "format": "date-time",
          "description": "The leasing end date",
          "type": "string"
        },
        "leasing_value": {
          "format": "double",
          "description": "The leasing value",
          "type": "number"
        },
        "leasing_end_value": {
          "format": "double",
          "description": "The leasing end/residual value",
          "type": "number"
        },
        "automation_weekday": {
          "format": "int32",
          "description": "The automation weekday for recurring invoicing (1=Mon, 7=Sun)",
          "type": "integer"
        },
        "automation_month": {
          "format": "int32",
          "description": "The automation month for recurring invoicing",
          "type": "integer"
        },
        "automation_markdate": {
          "format": "date-time",
          "description": "The automation mark date for recurring invoicing",
          "type": "string"
        },
        "location": {
          "description": "The agreement location/site",
          "type": "string"
        },
        "email": {
          "description": "The agreement contact email",
          "type": "string"
        },
        "phone": {
          "description": "The agreement contact phone",
          "type": "string"
        },
        "no_charges": {
          "description": "Indicates if the agreement has no charges",
          "type": "boolean"
        },
        "travel_time_percent": {
          "format": "int32",
          "description": "The travel time percentage to be invoiced",
          "type": "integer"
        },
        "master": {
          "format": "int32",
          "description": "The master agreement id",
          "type": "integer"
        },
        "balancing_period": {
          "format": "int32",
          "description": "The balancing period in months",
          "type": "integer"
        },
        "balanced_date": {
          "format": "date-time",
          "description": "The last balancing date (tasauspäivä)",
          "type": "string"
        },
        "payment_term": {
          "format": "int32",
          "description": "The payment term for this agreement (maksuehto). For possible values, refer to /api/codelist/payment_term\r\n[here](#tag/codelist/operation/Codelist_ListPaymentTerms)",
          "type": "integer"
        },
        "based_charges": {
          "description": "Indicates if based charges are used",
          "type": "boolean"
        },
        "no_crediting": {
          "description": "Indicates if crediting is disabled for this agreement",
          "type": "boolean"
        },
        "pricelist": {
          "format": "int32",
          "description": "The pricelist number for this agreement",
          "type": "integer"
        },
        "show_included_amount": {
          "description": "Indicates if included amount should be shown on invoices",
          "type": "boolean"
        },
        "recurrence": {
          "description": "The recurrence pattern as a serialized string. Use the dedicated PUT recurrence endpoint to update",
          "type": "string"
        },
        "lemonsoftTimeSpan": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.LemonsoftTimeSpan",
          "description": "The recurrence time span object (read-only, deserialized from recurrence). Use the dedicated PUT recurrence endpoint to update"
        },
        "codelist_costcenter": {
          "description": "The cost center code for this agreement (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "invoice_type": {
          "format": "int32",
          "description": "The invoice type for this agreement",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerAccount": {
      "description": "A bank account associated with a customer",
      "type": "object",
      "properties": {
        "account_id": {
          "format": "int32",
          "description": "The unique id of the bank account",
          "type": "integer"
        },
        "customer_id": {
          "format": "int32",
          "description": "The customer id this account belongs to",
          "type": "integer"
        },
        "account_number": {
          "description": "The bank account number",
          "type": "string"
        },
        "bank_name": {
          "description": "The bank name",
          "type": "string"
        },
        "bank_address": {
          "description": "The bank street address",
          "type": "string"
        },
        "bank_address2": {
          "description": "The bank additional address line",
          "type": "string"
        },
        "bank_country_code": {
          "description": "The bank country code",
          "type": "string"
        },
        "bank_info": {
          "description": "Additional bank information",
          "type": "string"
        },
        "bic": {
          "description": "The bank's BIC/SWIFT code",
          "type": "string"
        },
        "iban": {
          "description": "The IBAN account number",
          "type": "string"
        },
        "foreign_type": {
          "description": "The foreign payment type",
          "type": "string"
        },
        "foreign_share": {
          "description": "The foreign payment share type",
          "type": "string"
        },
        "clearing": {
          "description": "The clearing code",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerCirculation": {
      "description": "A circulation entry for a customer, used for approval workflows",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the circulation entry",
          "type": "integer"
        },
        "customer_id": {
          "format": "int32",
          "description": "The customer id this circulation belongs to",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The person number assigned to the circulation. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "circulation_type": {
          "format": "int32",
          "description": "The circulation type. 0 = Inspector, 1 = Approver",
          "maximum": 1,
          "minimum": 0,
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerDimension": {
      "description": "Customer classification and dimension data (luokittelutiedot)",
      "type": "object",
      "properties": {
        "Area_code": {
          "format": "int32",
          "description": "The area code (alue). For possible values, refer to /api/codelist/description?filter.codeListFilter=AREAS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "Chain_code": {
          "format": "int32",
          "description": "The chain code (ketju). For possible values, refer to /api/codelist/description?filter.codeListFilter=CHAINS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "Turnover_code": {
          "format": "int32",
          "description": "The turnover class code (liikevaihto)",
          "type": "integer"
        },
        "Employer_quantity_code": {
          "format": "int32",
          "description": "The employer quantity class code (henkilöstömäärä)",
          "type": "integer"
        },
        "Customer_segment_code": {
          "format": "int32",
          "description": "The customer segment code (asiakassegmentti). For possible values, refer to /api/codelist/description?filter.codeListFilter=CUSTOMER_SEGMENT_CODES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "Customer_abc": {
          "format": "int32",
          "description": "The customer ABC group (ABC-luokka). For possible values, refer to /api/codelist/description?filter.codeListFilter=ABC_GROUPS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "Mainbusiness_code": {
          "format": "int32",
          "description": "The main business code (päätoimiala)",
          "type": "integer"
        },
        "Branch_classification1": {
          "description": "The first branch classification (TOL 1)",
          "type": "string"
        },
        "Branch_classification2": {
          "description": "The second branch classification (TOL 2)",
          "type": "string"
        },
        "Branch_classification3": {
          "description": "The third branch classification (TOL 3)",
          "type": "string"
        },
        "Customergroup_id": {
          "format": "int32",
          "description": "The customer group id (asiakasryhmä)",
          "type": "integer"
        },
        "Business_activity_areacode": {
          "format": "int32",
          "description": "The business activity area code (liiketoiminta-alue)",
          "type": "integer"
        },
        "Customer_class_id": {
          "format": "int32",
          "description": "The customer class id (asiakasluokka). For possible values, refer to /api/codelist/description?filter.codeListFilter=CUSTOMER_CLASSES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "Customer_quality_system_bit": {
          "description": "Indicates if the customer has a quality system (laatujärjestelmä)",
          "type": "boolean"
        },
        "Customer_reference_bit": {
          "description": "Indicates if the customer has a reference status",
          "type": "boolean"
        },
        "Customer_dimension_started": {
          "format": "date-time",
          "description": "The date when the customer dimension was started",
          "type": "string"
        },
        "Customer_dimension_turnover": {
          "format": "int32",
          "description": "The customer's turnover value (liikevaihto)",
          "type": "integer"
        },
        "Customer_costcenter": {
          "description": "The customer's cost center (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "Customer_lta": {
          "description": "The customer's business area (liiketoiminta-alue). For possible values, refer to /api/settings/ltas\r\n[here](#tag/Settings/operation/Settings_GetLtas)",
          "type": "string"
        },
        "Customer_quality_system_name": {
          "description": "The name of the customer's quality system",
          "type": "string"
        },
        "Customer_reference_note": {
          "description": "A note about the customer's reference status",
          "type": "string"
        },
        "Transaction_type": {
          "format": "int32",
          "description": "The CRM transaction type for the customer. For possible values, refer to /api/settings/crm_types\r\n[here](#tag/Settings/operation/Settings_GetCrmTypes)",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerAgreementProduct": {
      "description": "A product line in a customer service agreement",
      "type": "object",
      "properties": {
        "agreement_product_id": {
          "format": "int32",
          "description": "The unique id of the agreement product",
          "type": "integer"
        },
        "agreement_id": {
          "format": "int32",
          "description": "The agreement id this product belongs to",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "product_description": {
          "description": "The product description",
          "type": "string"
        },
        "product_description2": {
          "description": "The second product description line",
          "type": "string"
        },
        "product_serialnumber": {
          "description": "The product serial number",
          "type": "string"
        },
        "product_amount": {
          "format": "double",
          "description": "The product quantity",
          "type": "number"
        },
        "product_unit": {
          "description": "The product unit (e.g., pcs, kg)",
          "type": "string"
        },
        "product_price": {
          "format": "double",
          "description": "The total price for this product line",
          "type": "number"
        },
        "product_type": {
          "format": "int32",
          "description": "The product type",
          "type": "integer"
        },
        "product_unitprice": {
          "format": "double",
          "description": "The unit price",
          "type": "number"
        },
        "product_discount": {
          "format": "double",
          "description": "The discount percentage",
          "type": "number"
        },
        "product_amount2": {
          "format": "double",
          "description": "The secondary quantity",
          "type": "number"
        },
        "product_blocking": {
          "format": "int32",
          "description": "The blocking mode. 0 = not blocked",
          "type": "integer"
        },
        "product_notes": {
          "description": "Notes for the agreement product",
          "type": "string"
        },
        "warranty_ends": {
          "format": "date-time",
          "description": "The warranty end date",
          "type": "string"
        },
        "product_sales_price": {
          "format": "double",
          "description": "The product sales price",
          "type": "number"
        },
        "service_interval": {
          "format": "int32",
          "description": "The service interval in days",
          "type": "integer"
        },
        "calibration_interval": {
          "format": "int32",
          "description": "The calibration interval in days",
          "type": "integer"
        },
        "product_project_id": {
          "format": "int32",
          "description": "The project id for this product. For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "product_project_phase_id": {
          "format": "int32",
          "description": "The project phase id for this product. For possible values, refer to /api/projects/{number}/phase\r\n[here](#tag/projects/operation/Project_GetPhases)",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.LemonsoftTimeSpan": {
      "type": "object",
      "properties": {
        "recurrence_type": {
          "format": "int32",
          "type": "integer"
        },
        "is_monday": {
          "type": "boolean"
        },
        "is_tuesday": {
          "type": "boolean"
        },
        "is_wednesday": {
          "type": "boolean"
        },
        "is_thursday": {
          "type": "boolean"
        },
        "is_friday": {
          "type": "boolean"
        },
        "is_saturday": {
          "type": "boolean",
          "readOnly": true
        },
        "is_sunday": {
          "type": "boolean"
        },
        "recurrence_step": {
          "format": "int32",
          "type": "integer"
        },
        "day": {
          "format": "int32",
          "type": "integer"
        },
        "month": {
          "format": "int32",
          "type": "integer"
        },
        "every_weekday": {
          "type": "boolean"
        },
        "week_of_month": {
          "format": "int32",
          "type": "integer"
        },
        "start_date": {
          "format": "date-time",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "type": "string"
        },
        "end_after_count": {
          "format": "int32",
          "type": "integer"
        },
        "recurrence_end": {
          "format": "int32",
          "type": "integer"
        },
        "start_time": {
          "format": "date-time",
          "type": "string"
        },
        "end_time": {
          "format": "date-time",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Customer]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Customer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.CustomerTransactionFilter": {
      "description": "Filter for querying CRM transactions. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter",
      "type": "object",
      "properties": {
        "type": {
          "format": "int32",
          "description": "Filter by transaction type. For possible values, refer to /api/settings/crm_types\r\n[here](#tag/Settings/operation/Settings_GetCrmTypes)",
          "type": "integer"
        },
        "state": {
          "format": "int32",
          "description": "Filter by transaction state. For possible values, refer to /api/settings/states/2\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "Filter by customer number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "transaction_date_before": {
          "format": "date-time",
          "description": "Filter transactions with date before this date",
          "type": "string"
        },
        "transaction_date_after": {
          "format": "date-time",
          "description": "Filter transactions with date after this date",
          "type": "string"
        },
        "person_number": {
          "format": "int32",
          "description": "Filter by creator person number. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "todo_person_number": {
          "format": "int32",
          "description": "Filter by todo assignee person number. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "description": "Filter by project number. For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "customer_contact_id": {
          "format": "int32",
          "description": "Filter by customer contact id",
          "type": "integer"
        },
        "sort_field": {
          "description": "Sort field (database column name). Default is \"transaction_id\". Common values: transaction_id, transaction_date.\r\nFalls back to default if column does not exist.",
          "type": "string"
        },
        "sort_desc": {
          "description": "Sorting order. Default is ascending (false).",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CustomerTransaction]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerTransaction"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerTransaction": {
      "description": "A CRM transaction/activity (tapahtuma) associated with a customer",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the transaction",
          "type": "integer"
        },
        "subject": {
          "description": "The transaction subject line",
          "type": "string"
        },
        "todo_enddate": {
          "format": "date-time",
          "description": "The todo end date",
          "type": "string"
        },
        "todo_person_number": {
          "format": "int32",
          "description": "The person number assigned to the todo (tehtävän vastuuhenkilö). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The person number who created the transaction (tekijä). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "todo_startdate": {
          "format": "date-time",
          "description": "The todo start date",
          "type": "string"
        },
        "header": {
          "description": "The transaction header text",
          "type": "string"
        },
        "appointment_type": {
          "format": "int32",
          "description": "The appointment type",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The CRM transaction type. For possible values, refer to /api/settings/crm_types\r\n[here](#tag/Settings/operation/Settings_GetCrmTypes)",
          "type": "integer"
        },
        "sec_type": {
          "format": "int32",
          "description": "The CRM transaction secondary type",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The transaction date",
          "type": "string"
        },
        "person_name": {
          "description": "The name of the person who created the transaction",
          "type": "string"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number for this transaction. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_contact_id": {
          "format": "int32",
          "description": "The customer contact id for this transaction",
          "type": "integer"
        },
        "todo_description": {
          "description": "The todo description text",
          "type": "string"
        },
        "duration": {
          "format": "int32",
          "description": "The duration in minutes",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "The project phase id (projektivaihe). For possible values, refer to /api/projects/{number}/phase\r\n[here](#tag/projects/operation/Project_GetPhases)",
          "type": "integer"
        },
        "orderer_customer_number": {
          "format": "int32",
          "description": "The orderer customer number (tilaaja). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "invoice_bit": {
          "description": "Indicates if this transaction should be invoiced",
          "type": "boolean"
        },
        "hours": {
          "format": "double",
          "description": "The number of hours for this transaction",
          "type": "number"
        },
        "invoiced_bit": {
          "description": "Indicates if this transaction has been invoiced",
          "type": "boolean"
        },
        "state": {
          "format": "int32",
          "description": "The transaction state. For possible values, refer to /api/settings/states/2\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "crm_type_attribute_id": {
          "format": "int32",
          "description": "The CRM type attribute id for this transaction",
          "type": "integer"
        },
        "priority": {
          "format": "int32",
          "description": "The priority level",
          "type": "integer"
        },
        "attributes": {
          "description": "The transaction's attributes",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerTransactionAttribute"
          }
        },
        "participates": {
          "description": "The transaction's participants",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerTransactionParticipate"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerTransactionAttribute": {
      "description": "An attribute associated with a CRM transaction",
      "required": [
        "code"
      ],
      "type": "object",
      "properties": {
        "code": {
          "format": "int32",
          "description": "The attribute code (required)",
          "type": "integer"
        },
        "description": {
          "description": "The attribute description",
          "type": "string"
        },
        "info": {
          "description": "Additional information about the attribute",
          "type": "string"
        },
        "group_description": {
          "description": "The attribute group description",
          "type": "string"
        },
        "is_checked": {
          "description": "Indicates if this attribute is selected for the transaction",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerTransactionParticipate": {
      "description": "A participant in a CRM transaction",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the participation entry",
          "type": "integer"
        },
        "participate_number": {
          "format": "int32",
          "description": "The participant's person or customer number",
          "type": "integer"
        },
        "participate_type": {
          "format": "int32",
          "description": "The participant type (e.g., person, customer)",
          "type": "integer"
        },
        "participate_contact_name": {
          "description": "The participant's contact name",
          "type": "string"
        },
        "participate_customer_contact_id": {
          "format": "int32",
          "description": "The participant's customer contact id",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.CustomerGroupFilter": {
      "description": "Filter for querying customer groups. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter",
      "type": "object",
      "properties": {
        "name": {
          "description": "Filter by group name. Performs a contains search",
          "type": "string"
        },
        "parent_id": {
          "format": "int32",
          "description": "Filter by parent group id. Use 0 to get only top-level groups",
          "type": "integer"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CustomerGroup]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerGroup"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerGroup": {
      "description": "A customer group (asiakasryhmä) for organizing customers hierarchically",
      "required": [
        "name"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the group",
          "type": "integer"
        },
        "parent_id": {
          "format": "int32",
          "description": "The parent group id. 0 = top-level group",
          "type": "integer"
        },
        "name": {
          "description": "The group name (required)",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The group type",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CustomerTransactionAttribute]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerTransactionAttribute"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CustomerIbanChange]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerIbanChange"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerIbanChange": {
      "description": "One IBAN change entry recorded for a customer. Returned as a list by\r\n/api/customers/{customerId}/iban-change-history for a given date range.",
      "type": "object",
      "properties": {
        "changed_at": {
          "format": "date-time",
          "description": "When the change was recorded",
          "type": "string"
        },
        "from_iban": {
          "description": "The previous IBAN value",
          "type": "string"
        },
        "to_iban": {
          "description": "The new IBAN value",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.CustomerYtjStatus]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerYtjStatus"
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerYtjStatus": {
      "description": "YTJ/PRH status for a VAT (Y-tunnus). Returned by /api/customers/ytj-status/{vat}.\r\nMirrors the fields produced by Lemonsoft.YtjLibrary.YtjMapper.MapToDataProviderCustomer.",
      "type": "object",
      "properties": {
        "vat": {
          "description": "The VAT the lookup was performed for",
          "type": "string"
        },
        "business_id_found": {
          "description": "True if YTJ recognised the VAT",
          "type": "boolean"
        },
        "business_id_active": {
          "description": "True if the business is currently active in YTJ",
          "type": "boolean"
        },
        "business_id_status": {
          "description": "Raw YTJ business-id status string (e.g. \"2\" = registered/in force), as returned by YTJ.\r\nA company that has ceased operations keeps \"2\"; the ended state is signalled by valid_until\r\nand the business_id_active flag, not by this code.",
          "type": "string"
        },
        "valid_until": {
          "format": "date-time",
          "description": "Business-id validity end date from YTJ, if any",
          "type": "string"
        },
        "in_bankruptcy": {
          "description": "True if YTJ reports an active bankruptcy for the business",
          "type": "boolean"
        },
        "name": {
          "description": "Registered business name from YTJ",
          "type": "string"
        },
        "preliminary_tax_register": {
          "description": "True if the business is in the Finnish preliminary tax register (ennakkoperintärekisteri)",
          "type": "boolean"
        },
        "preliminary_tax_register_since": {
          "format": "date-time",
          "description": "Start date of the preliminary tax register entry, if any",
          "type": "string"
        },
        "branch_classification": {
          "description": "TOL industry classification code",
          "type": "string"
        },
        "branch_classification_description": {
          "description": "Human-readable TOL industry classification description",
          "type": "string"
        },
        "auxiliary_business_names": {
          "description": "Auxiliary business names (aputoiminimet)",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "parallel_business_names": {
          "description": "Parallel business names (rinnakkaistoiminimet)",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseOrderConfirmation": {
      "type": "object",
      "properties": {
        "purchase_order_number": {
          "format": "int32",
          "type": "integer"
        },
        "purchase_order_customer_order_number": {
          "format": "int32",
          "type": "integer"
        },
        "purchase_order_rows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderRowConfirmation"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseOrderRowConfirmation": {
      "type": "object",
      "properties": {
        "row_product_code": {
          "type": "string"
        },
        "row_supplier_product_code": {
          "type": "string"
        },
        "row_ean_code": {
          "type": "string"
        },
        "row_amount": {
          "format": "double",
          "type": "number"
        },
        "row_sizes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.EdiStockTransactionSize"
          }
        },
        "row_supplier_deliverydate": {
          "format": "date-time",
          "type": "string"
        },
        "row_supplier_sentdate": {
          "format": "date-time",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.EdiStockTransactionSize": {
      "type": "object",
      "properties": {
        "size_amount_id": {
          "format": "int32",
          "type": "integer"
        },
        "row_id": {
          "format": "int32",
          "type": "integer"
        },
        "program_id": {
          "format": "int32",
          "type": "integer"
        },
        "size": {
          "type": "string"
        },
        "stock_size_ean": {
          "type": "string"
        },
        "size_amount": {
          "format": "double",
          "type": "number"
        },
        "size_dlvr_amount": {
          "format": "double",
          "type": "number"
        },
        "size_sort_order": {
          "format": "int32",
          "type": "integer"
        },
        "delivery": {
          "type": "boolean"
        },
        "size_totaldlvr_amount": {
          "format": "double",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.EdiReturnCode]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.EdiReturnCode"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.EdiReturnCode": {
      "type": "object",
      "properties": {
        "return_code": {
          "format": "int32",
          "type": "integer"
        },
        "identifier": {
          "type": "string"
        },
        "identifier2": {
          "type": "string"
        },
        "identifier3": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.EDI_ArrayofOrder": {
      "type": "object",
      "properties": {
        "Order": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.EdiOrder"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.EdiOrder": {
      "type": "object",
      "properties": {
        "stock_ovt": {
          "type": "string"
        },
        "stock_gln": {
          "type": "string"
        },
        "delivery_customer_ovt": {
          "type": "string"
        },
        "delivery_customer_gln": {
          "type": "string"
        },
        "delivery_customer_other_code": {
          "type": "string"
        },
        "delivery_customer_name1": {
          "type": "string"
        },
        "delivery_customer_name2": {
          "type": "string"
        },
        "delivery_customer_address1": {
          "type": "string"
        },
        "delivery_customer_address2": {
          "type": "string"
        },
        "delivery_customer_address3": {
          "type": "string"
        },
        "delivery_customer_country": {
          "type": "string"
        },
        "delivery_customer_contact": {
          "type": "string"
        },
        "delivery_customer_contact_email": {
          "type": "string"
        },
        "delivery_customer_contact_phone": {
          "type": "string"
        },
        "invoice_customer_ovt": {
          "type": "string"
        },
        "invoice_customer_gln": {
          "type": "string"
        },
        "invoice_customer_other_code": {
          "type": "string"
        },
        "invoice_customer_name1": {
          "type": "string"
        },
        "invoice_customer_name2": {
          "type": "string"
        },
        "invoice_customer_address1": {
          "type": "string"
        },
        "invoice_customer_address2": {
          "type": "string"
        },
        "invoice_customer_address3": {
          "type": "string"
        },
        "invoice_customer_country": {
          "type": "string"
        },
        "invoice_customer_contact": {
          "type": "string"
        },
        "invoice_customer_contact_email": {
          "type": "string"
        },
        "invoice_customer_contact_phone": {
          "type": "string"
        },
        "orderer_customer_ovt": {
          "type": "string"
        },
        "orderer_customer_gln": {
          "type": "string"
        },
        "orderer_customer_other_code": {
          "type": "string"
        },
        "orderer_customer_name1": {
          "type": "string"
        },
        "orderer_customer_name2": {
          "type": "string"
        },
        "orderer_customer_address1": {
          "type": "string"
        },
        "orderer_customer_address2": {
          "type": "string"
        },
        "orderer_customer_address3": {
          "type": "string"
        },
        "orderer_customer_country": {
          "type": "string"
        },
        "orderer_customer_contact": {
          "type": "string"
        },
        "orderer_customer_contact_email": {
          "type": "string"
        },
        "orderer_customer_contact_phone": {
          "type": "string"
        },
        "consignee_customer_ovt": {
          "type": "string"
        },
        "consignee_customer_gln": {
          "type": "string"
        },
        "consignee_customer_other_code": {
          "type": "string"
        },
        "consignee_customer_name1": {
          "type": "string"
        },
        "consignee_customer_name2": {
          "type": "string"
        },
        "consignee_customer_address1": {
          "type": "string"
        },
        "consignee_customer_address2": {
          "type": "string"
        },
        "consignee_customer_address3": {
          "type": "string"
        },
        "consignee_customer_country": {
          "type": "string"
        },
        "consignee_customer_contact": {
          "type": "string"
        },
        "consignee_customer_contact_email": {
          "type": "string"
        },
        "consignee_customer_contact_phone": {
          "type": "string"
        },
        "order_date": {
          "format": "date-time",
          "type": "string"
        },
        "planned_delivery_date": {
          "format": "date-time",
          "type": "string"
        },
        "order_description": {
          "type": "string"
        },
        "ordermark": {
          "type": "string"
        },
        "customer_reference": {
          "type": "string"
        },
        "our_reference": {
          "type": "string"
        },
        "customer_ordernumber": {
          "type": "string"
        },
        "delivery_text": {
          "type": "string"
        },
        "order_note": {
          "type": "string"
        },
        "order_delivery_code": {
          "type": "string"
        },
        "order_totalsum": {
          "format": "double",
          "type": "number"
        },
        "taxtype_bit": {
          "type": "boolean"
        },
        "Rows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.EdiOrderRow"
          }
        },
        "realised_delivery_date": {
          "format": "date-time",
          "type": "string"
        },
        "delivery_consignment": {
          "type": "string"
        },
        "currency_code": {
          "type": "string"
        },
        "currency_rate": {
          "format": "double",
          "type": "number"
        },
        "currency_date": {
          "format": "date-time",
          "type": "string"
        },
        "order_number": {
          "type": "string"
        },
        "Payment_term": {
          "format": "int32",
          "type": "integer"
        },
        "driver": {
          "format": "int32",
          "type": "integer"
        },
        "order_delivery_term": {
          "type": "string"
        },
        "order_delivery_term_info": {
          "type": "string"
        },
        "Delivery_method": {
          "format": "int32",
          "type": "integer"
        },
        "order_duedate": {
          "format": "date-time",
          "type": "string"
        },
        "order_cashdate": {
          "format": "date-time",
          "type": "string"
        },
        "project_number": {
          "type": "string"
        },
        "deliverypreinfo": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.EdiDeliveryPreInfo"
          }
        },
        "Company_location_id": {
          "format": "int32",
          "type": "integer"
        },
        "order_type": {
          "format": "int32",
          "description": "Sets the type for the individual order. Leave unset or -1 for order type to be set by function setting SALESORDERTYPE (toimintokeskus, SALESORDERTYPE). If each order has the same type as SALESORDERTYPE, set the order_type to equal SALESORDERTYPE for each order to skip unneccessary DB reads.",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.EdiOrderRow": {
      "type": "object",
      "properties": {
        "Row_product_code": {
          "type": "string"
        },
        "Row_ean_code": {
          "type": "string"
        },
        "Row_other_code": {
          "type": "string"
        },
        "Row_orderer_customer_ovt": {
          "type": "string"
        },
        "Row_orderer_customer_gln": {
          "type": "string"
        },
        "Row_orderer_customer_other_code": {
          "type": "string"
        },
        "Row_orderer_customer_name1": {
          "type": "string"
        },
        "Row_orderer_customer_name2": {
          "type": "string"
        },
        "Row_orderer_customer_address1": {
          "type": "string"
        },
        "Row_orderer_customer_address2": {
          "type": "string"
        },
        "Row_orderer_customer_address3": {
          "type": "string"
        },
        "Row_orderer_customer_country": {
          "type": "string"
        },
        "Row_orderer_customer_contact": {
          "type": "string"
        },
        "Row_amount": {
          "format": "double",
          "type": "number"
        },
        "Row_amount2": {
          "format": "double",
          "type": "number"
        },
        "Row_unit": {
          "type": "string"
        },
        "Row_Unitprice": {
          "format": "double",
          "type": "number"
        },
        "Row_Per": {
          "format": "double",
          "type": "number"
        },
        "Row_Total": {
          "format": "double",
          "type": "number"
        },
        "Row_Discount": {
          "format": "double",
          "type": "number"
        },
        "Row_Discount2": {
          "format": "double",
          "type": "number"
        },
        "Row_taxrate": {
          "format": "double",
          "type": "number"
        },
        "Row_taxamount": {
          "format": "double",
          "type": "number"
        },
        "Row_net": {
          "format": "double",
          "type": "number"
        },
        "Row_position": {
          "type": "string"
        },
        "Row_planned_delivery_date": {
          "format": "date-time",
          "type": "string"
        },
        "Row_delivery_text": {
          "type": "string"
        },
        "Row_productdescription": {
          "type": "string"
        },
        "Row_productdescription2": {
          "type": "string"
        },
        "Row_note": {
          "type": "string"
        },
        "Row_innernote": {
          "type": "string"
        },
        "Project_number": {
          "type": "string"
        },
        "Project_phase_number": {
          "type": "string"
        },
        "Row_configurenote": {
          "type": "string"
        },
        "account": {
          "type": "string"
        },
        "Weight": {
          "format": "double",
          "type": "number"
        },
        "M2": {
          "format": "double",
          "type": "number"
        },
        "M3": {
          "format": "double",
          "type": "number"
        },
        "Row_dimension": {
          "type": "string"
        },
        "Circle": {
          "format": "double",
          "type": "number"
        },
        "Row_color": {
          "type": "string"
        },
        "Row_dlvr_code": {
          "type": "string"
        },
        "row_volyme": {
          "format": "double",
          "type": "number"
        },
        "row_reference": {
          "type": "string"
        },
        "no_stock_update": {
          "description": "Sets the no stock update (Ei varastopäiv.)",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.EdiDeliveryPreInfo": {
      "type": "object",
      "properties": {
        "pre_deliveryinfo_method": {
          "format": "int32",
          "type": "integer"
        },
        "pre_deliveryinfo_description": {
          "type": "string"
        },
        "Pre_Deliveryinfo_forwarder": {
          "type": "string"
        },
        "pre_deliveryinfo_instructions": {
          "type": "string"
        },
        "Pre_Deliveryinfo_departure": {
          "type": "string"
        },
        "Pre_Deliveryinfo_destination": {
          "type": "string"
        },
        "pre_deliveryinfo_info1": {
          "type": "string"
        },
        "pre_deliveryinfo_info2": {
          "type": "string"
        },
        "pre_deliveryinfo_packages": {
          "format": "int32",
          "type": "integer"
        },
        "pre_deliveryinfo_weight": {
          "format": "double",
          "type": "number"
        },
        "pre_deliveryinfo_m3": {
          "format": "double",
          "type": "number"
        },
        "pre_deliveryinfo_m2": {
          "format": "double",
          "type": "number"
        },
        "pre_deliveryinfo_m": {
          "format": "double",
          "type": "number"
        },
        "Pre_Deliveryinfo_departure_door": {
          "type": "string"
        },
        "Pre_Deliveryinfo_destination_door": {
          "type": "string"
        },
        "pre_deliveryinfo_route": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.EDI_ArrayOfSalesOrder": {
      "type": "object",
      "properties": {
        "Items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.EDI_SalesOrderDelivery"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.EDI_SalesOrderDelivery": {
      "type": "object",
      "properties": {
        "consignment_description": {
          "type": "string"
        },
        "consignment_delivery_date": {
          "format": "date-time",
          "description": "Not implemented — use order_delivery_date instead; value is ignored.",
          "type": "string"
        },
        "consignment_departure": {
          "type": "string"
        },
        "consignment_destination": {
          "type": "string"
        },
        "consignment_forwarder": {
          "type": "string"
        },
        "consignment_instructions": {
          "type": "string"
        },
        "consignment_info1": {
          "type": "string"
        },
        "consignment_info2": {
          "type": "string"
        },
        "consignment_weight": {
          "format": "double",
          "type": "number"
        },
        "consignment_m": {
          "format": "double",
          "description": "Not implemented — no corresponding database column; value is ignored.",
          "type": "number"
        },
        "consignment_m2": {
          "format": "double",
          "type": "number"
        },
        "consignment_m3": {
          "format": "double",
          "type": "number"
        },
        "consignment_packages": {
          "format": "int32",
          "type": "integer"
        },
        "delivery_customer_ovt": {
          "type": "string"
        },
        "delivery_customer_gln": {
          "type": "string"
        },
        "delivery_customer_other_code1": {
          "type": "string"
        },
        "delivery_customer_other_code2": {
          "type": "string"
        },
        "delivery_customer_other_code3": {
          "type": "string"
        },
        "delivery_customer_name1": {
          "type": "string"
        },
        "delivery_customer_name2": {
          "type": "string"
        },
        "delivery_customer_address1": {
          "type": "string"
        },
        "delivery_customer_address2": {
          "type": "string"
        },
        "delivery_customer_address3": {
          "type": "string"
        },
        "delivery_customer_country": {
          "type": "string"
        },
        "delivery_customer_contact": {
          "type": "string"
        },
        "delivery_customer_contact_email": {
          "type": "string"
        },
        "delivery_customer_contact_phone": {
          "type": "string"
        },
        "invoice_customer_ovt": {
          "type": "string"
        },
        "invoice_customer_gln": {
          "type": "string"
        },
        "invoice_customer_other_code1": {
          "type": "string"
        },
        "invoice_customer_other_code2": {
          "type": "string"
        },
        "invoice_customer_other_code3": {
          "type": "string"
        },
        "invoice_customer_name1": {
          "type": "string"
        },
        "invoice_customer_name2": {
          "type": "string"
        },
        "invoice_customer_address1": {
          "type": "string"
        },
        "invoice_customer_address2": {
          "type": "string"
        },
        "invoice_customer_address3": {
          "type": "string"
        },
        "invoice_customer_country": {
          "type": "string"
        },
        "invoice_customer_contact": {
          "type": "string"
        },
        "orderer_customer_ovt": {
          "type": "string"
        },
        "orderer_customer_gln": {
          "type": "string"
        },
        "orderer_customer_other_code1": {
          "type": "string"
        },
        "orderer_customer_other_code2": {
          "type": "string"
        },
        "orderer_customer_other_code3": {
          "type": "string"
        },
        "orderer_customer_name1": {
          "type": "string"
        },
        "orderer_customer_name2": {
          "type": "string"
        },
        "orderer_customer_address1": {
          "type": "string"
        },
        "orderer_customer_address2": {
          "type": "string"
        },
        "orderer_customer_address3": {
          "type": "string"
        },
        "orderer_customer_country": {
          "type": "string"
        },
        "orderer_customer_contact": {
          "type": "string"
        },
        "consignee_customer_ovt": {
          "type": "string"
        },
        "consignee_customer_gln": {
          "type": "string"
        },
        "consignee_customer_other_code1": {
          "type": "string"
        },
        "consignee_customer_other_code2": {
          "type": "string"
        },
        "consignee_customer_other_code3": {
          "type": "string"
        },
        "consignee_customer_name1": {
          "type": "string"
        },
        "consignee_customer_name2": {
          "type": "string"
        },
        "consignee_customer_address1": {
          "type": "string"
        },
        "consignee_customer_address2": {
          "type": "string"
        },
        "consignee_customer_address3": {
          "type": "string"
        },
        "consignee_customer_country": {
          "type": "string"
        },
        "consignee_customer_contact": {
          "type": "string"
        },
        "order_number": {
          "format": "int32",
          "type": "integer"
        },
        "order_type": {
          "format": "int32",
          "type": "integer"
        },
        "order_description": {
          "type": "string"
        },
        "order_date": {
          "format": "date-time",
          "type": "string"
        },
        "order_delivery_date": {
          "type": "string"
        },
        "order_delivery_text": {
          "type": "string"
        },
        "order_ordermark": {
          "type": "string"
        },
        "order_our_reference": {
          "type": "string"
        },
        "order_customer_reference": {
          "type": "string"
        },
        "order_customer_ordernumber": {
          "type": "string"
        },
        "order_note": {
          "type": "string"
        },
        "order_delivery_code": {
          "type": "string"
        },
        "order_taxbit": {
          "type": "boolean"
        },
        "order_totalsum": {
          "format": "double",
          "type": "number"
        },
        "Payment_term": {
          "format": "int32",
          "type": "integer"
        },
        "Pallets": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ArrayOfSalesOrderDeliveryPallets"
          }
        },
        "Company_location_id": {
          "format": "int32",
          "type": "integer"
        },
        "Deliveryinfo_outer_delivery_id": {
          "type": "string"
        },
        "Deliveryinfo_consignment": {
          "type": "string"
        },
        "Tracking_Code": {
          "type": "string"
        },
        "shipping_cost_products": {
          "description": "The shipping cost products associated with this sales order delivery",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ShippingCostProductEDI"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ArrayOfSalesOrderDeliveryPallets": {
      "type": "object",
      "properties": {
        "pallet_name": {
          "type": "string"
        },
        "pallet_weight": {
          "format": "double",
          "type": "number"
        },
        "pallet_type": {
          "type": "string"
        },
        "orderRows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ArrayOfSalesOrderPalletsOrderRowsRow"
          }
        },
        "SSCC_code": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ShippingCostProductEDI": {
      "description": "The shipping cost product in the sales order delivery",
      "type": "object",
      "properties": {
        "product_code": {
          "description": "Product code of the shipping cost product",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "Amount of the shipping cost product",
          "type": "number"
        },
        "unit_price": {
          "format": "double",
          "description": "Unit price of the shipping cost product",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.ArrayOfSalesOrderPalletsOrderRowsRow": {
      "type": "object",
      "properties": {
        "row_weight": {
          "format": "double",
          "type": "number"
        },
        "row_m": {
          "format": "double",
          "type": "number"
        },
        "row_m2": {
          "format": "double",
          "type": "number"
        },
        "row_m3": {
          "format": "double",
          "type": "number"
        },
        "row_circle": {
          "format": "double",
          "type": "number"
        },
        "row_id": {
          "format": "int32",
          "type": "integer"
        },
        "row_number": {
          "format": "int32",
          "type": "integer"
        },
        "row_type": {
          "format": "int32",
          "type": "integer"
        },
        "row_position": {
          "type": "string"
        },
        "row_productcode": {
          "type": "string"
        },
        "row_eancode": {
          "type": "string"
        },
        "row_product_stock": {
          "format": "int32",
          "type": "integer"
        },
        "row_productdescription": {
          "type": "string"
        },
        "row_productdescription2": {
          "type": "string"
        },
        "row_amount": {
          "format": "double",
          "type": "number"
        },
        "row_amount2": {
          "format": "double",
          "type": "number"
        },
        "row_unitprice": {
          "format": "double",
          "type": "number"
        },
        "row_total": {
          "format": "double",
          "type": "number"
        },
        "row_per": {
          "format": "double",
          "type": "number"
        },
        "row_unit": {
          "type": "string"
        },
        "row_Discount": {
          "format": "double",
          "type": "number"
        },
        "row_Discount2": {
          "format": "double",
          "type": "number"
        },
        "row_dimension": {
          "type": "string"
        },
        "row_color": {
          "type": "string"
        },
        "row_netcurrency": {
          "format": "double",
          "type": "number"
        },
        "row_taxrate": {
          "format": "double",
          "type": "number"
        },
        "row_taxamount": {
          "format": "double",
          "type": "number"
        },
        "row_net": {
          "format": "double",
          "type": "number"
        },
        "row_project_number": {
          "type": "string"
        },
        "row_note": {
          "type": "string"
        },
        "row_configurenote": {
          "type": "string"
        },
        "row_innernote": {
          "type": "string"
        },
        "row_serial": {
          "type": "string"
        },
        "row_handedness": {
          "type": "string"
        },
        "row_total_amount": {
          "format": "double",
          "type": "number"
        },
        "row_amount_left": {
          "format": "double",
          "type": "number"
        },
        "row_backorder": {
          "type": "boolean"
        },
        "row_reference": {
          "type": "string"
        },
        "row_delivery_text": {
          "type": "string"
        },
        "row_orderercustomer_number": {
          "type": "string"
        },
        "row_batch_suppliercode": {
          "type": "string"
        },
        "row_batchnumbers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.RowBatchNumber"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.RowBatchNumber": {
      "type": "object",
      "properties": {
        "batch_suppliercode": {
          "type": "string"
        },
        "batch_amount": {
          "format": "double",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseOrderDeliveries": {
      "type": "object",
      "properties": {
        "Purchase_Order_Number": {
          "format": "int32",
          "type": "integer"
        },
        "Delivery_Rows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderDeliveryRow"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseOrderDeliveryRow": {
      "type": "object",
      "properties": {
        "Row_Id": {
          "format": "int32",
          "type": "integer"
        },
        "Product_Code": {
          "type": "string"
        },
        "Position": {
          "type": "string"
        },
        "Stock_number": {
          "format": "int32",
          "type": "integer"
        },
        "Delivery_Amount": {
          "format": "double",
          "type": "number"
        },
        "Best_Before": {
          "format": "date-time",
          "type": "string"
        },
        "Supplier_Code": {
          "type": "string"
        },
        "dd_statement": {
          "description": "Due diligence statement",
          "type": "string"
        },
        "dd_statement_ref": {
          "description": "Due diligence statement refence number",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PurchaseOrderDeliveryResponse]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderDeliveryResponse"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseOrderDeliveryResponse": {
      "type": "object",
      "properties": {
        "Response_Code": {
          "format": "int32",
          "type": "integer"
        },
        "Response_Text": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ExceptionDay": {
      "description": "An exception day in the company calendar (poikkeuspäivä).",
      "type": "object",
      "properties": {
        "exceptionday_id": {
          "format": "int32",
          "description": "The unique identifier of the exception day.",
          "type": "integer"
        },
        "exceptionday_date": {
          "format": "date-time",
          "description": "The date of the exception day.",
          "type": "string"
        },
        "exceptionday_description": {
          "description": "The description of the exception day.",
          "type": "string"
        },
        "exceptionday_type": {
          "format": "int32",
          "description": "The type of the exception day.",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.LemonFilesFilter": {
      "description": "Filter for querying LemonFiles blob items",
      "type": "object",
      "properties": {
        "application_id": {
          "format": "int32",
          "description": "The LemonSoft application context for the file search (e.g. 1=Customer, 2=Product, 8=SalesOrder — see /api/files for the full list of supported values)",
          "type": "integer"
        },
        "search": {
          "description": "The identifier of the source record within the application context, such as a sales order number, purchase order number, product code, or offer number",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.AzureBlobItem]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.AzureBlobItem"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.AzureBlobItem": {
      "description": "A file stored in LemonFiles (Azure Blob Storage)",
      "type": "object",
      "properties": {
        "itemtype": {
          "format": "int32",
          "description": "The item type (file or folder)",
          "type": "integer"
        },
        "name": {
          "description": "The Azure blob name. This value must be Base64-encoded before being used as the route parameter in /api/files/azure/url/{azure_blob_name}",
          "type": "string"
        },
        "filename": {
          "description": "The display file name",
          "type": "string"
        },
        "description": {
          "description": "The file description",
          "type": "string"
        },
        "size": {
          "description": "The file size (formatted string)",
          "type": "string"
        },
        "lastaccessdate": {
          "format": "date-time",
          "description": "The date when the file was last accessed",
          "type": "string"
        },
        "modifiedby": {
          "description": "The username of the person who last modified the file",
          "type": "string"
        },
        "lockedby": {
          "description": "The username of the person who has the file locked, if any",
          "type": "string"
        },
        "lockedbyname": {
          "description": "The display name of the person who has the file locked",
          "type": "string"
        },
        "filestate": {
          "description": "The file state",
          "type": "string"
        },
        "fileuri": {
          "description": "The URI of the file in Azure blob storage",
          "type": "string"
        },
        "documentype": {
          "description": "The document type",
          "type": "string"
        },
        "metadata": {
          "description": "The metadata entries attached to the file",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.AzureBlobItemMetadata"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.AzureBlobItemMetadata": {
      "description": "A metadata entry for a LemonFiles blob item",
      "type": "object",
      "properties": {
        "metadatakey": {
          "format": "int32",
          "description": "The metadata key type (LemonSoft application context, e.g. 1=Customer, 2=Product — see /api/files for the full list)",
          "type": "integer"
        },
        "key": {
          "description": "The metadata key name",
          "type": "string"
        },
        "value": {
          "description": "The metadata value",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.AzureBlobItemUpload": {
      "description": "Payload for uploading a file to LemonFiles via /api/files (POST)",
      "required": [
        "filename",
        "filepath",
        "metadata",
        "bytes"
      ],
      "type": "object",
      "properties": {
        "filename": {
          "description": "The name of the file to upload, including extension (required)",
          "type": "string"
        },
        "filepath": {
          "description": "The folder path inside the LemonFiles container where the file is stored (required). Missing folders are created automatically",
          "type": "string"
        },
        "metadata": {
          "description": "The metadata entries attached to the file (required, at least one entry)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.AzureBlobItemMetadata"
          }
        },
        "bytes": {
          "description": "The file contents as a Base64-encoded string (required)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[System.String]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.UploadUrl": {
      "description": "Payload for the Azure direct-upload flow (/api/files/azure/uploadurl and /api/files/azure/uploadurl/complete)",
      "type": "object",
      "properties": {
        "fileName": {
          "description": "The full path and filename of the file to upload, e.g. \"directory/document.jpg\"",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.JobImage]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.JobImage"
        }
      }
    },
    "LemonRest.Models.Proxy.JobImage": {
      "description": "An image attached to a job (työn kuvaliite)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The job image id. Set by the server on create; must be 0 in upload payloads",
          "type": "integer"
        },
        "object_id": {
          "format": "int32",
          "description": "The LemonSoft application id identifying the source entity type (e.g. 1=Customer, 2=Product, 8=SalesOrder — see /api/files for the full list)",
          "type": "integer"
        },
        "data_id": {
          "format": "int32",
          "description": "The id of the source record within the application context (e.g. the sales order number when object_id = 8)",
          "type": "integer"
        },
        "description": {
          "description": "The image description",
          "type": "string"
        },
        "prefix": {
          "description": "The image filename prefix",
          "type": "string"
        },
        "bytes": {
          "format": "byte",
          "description": "The image contents as raw bytes",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The job image type",
          "type": "integer"
        },
        "printname": {
          "description": "The name used when the image is printed or exported",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ProgramImage": {
      "description": "An image attached to a program record (ohjelman kuva)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The program image id. Set by the server on create; must be 0 in upload payloads",
          "type": "integer"
        },
        "object_id": {
          "format": "int32",
          "description": "The LemonSoft application id identifying the source entity type (e.g. 1=Customer, 2=Product — see /api/files for the full list)",
          "type": "integer"
        },
        "data_id": {
          "format": "int32",
          "description": "The id of the source record within the application context",
          "type": "integer"
        },
        "description": {
          "description": "The image description",
          "type": "string"
        },
        "prefix": {
          "description": "The image filename prefix",
          "type": "string"
        },
        "bytes": {
          "format": "byte",
          "description": "The image contents as raw bytes",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The program image type",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.Holiday": {
      "description": "Public holiday (company calendar) row. Mirrors the CodeLibrary Holiday entity fields.",
      "type": "object",
      "properties": {
        "holiday_id": {
          "format": "int32",
          "type": "integer"
        },
        "holiday_date": {
          "format": "date-time",
          "type": "string"
        },
        "holiday_description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.SalesInvoiceFilter": {
      "description": "Filter for querying sales invoices. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "numbers": {
          "description": "Filter by invoice numbers. Accepts a list of invoice numbers",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "customer_number": {
          "format": "int32",
          "description": "Filter by the invoicing customer's number",
          "type": "integer"
        },
        "delivery_customer_number": {
          "format": "int32",
          "description": "Filter by the delivery customer's number",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "Filter by the invoice type code",
          "type": "integer"
        },
        "invoice_date_before": {
          "format": "date-time",
          "description": "Filter invoices with invoice date before this date",
          "type": "string"
        },
        "invoice_date_after": {
          "format": "date-time",
          "description": "Filter invoices with invoice date after this date",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Filter invoices updated before this date",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "description": "Filter invoices updated after this date",
          "type": "string"
        },
        "has_external_id": {
          "description": "Filter by whether the invoice has an external id. True = only with external id, false = only without",
          "type": "boolean"
        },
        "external_id": {
          "format": "int32",
          "description": "Filter by exact external id value",
          "type": "integer"
        },
        "include_dimension_descriptions": {
          "description": "When set to true, dimension descriptions (project, LTA, cost center, project phase) are included in the response for each invoice row",
          "type": "boolean"
        },
        "row_project_number": {
          "format": "int32",
          "description": "Filter by the invoice row's project number",
          "type": "integer"
        },
        "sort_field": {
          "description": "Sort field (database column name). Default is \"invoice_id\". Common values: invoice_id, invoice_date, invoice_number, invoice_duedate.\r\nFalls back to default if column does not exist.",
          "type": "string"
        },
        "sort_desc": {
          "description": "Sorting order. Default is ascending (false).",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Invoice]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Invoice"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Invoice": {
      "description": "The invoice model with full details including rows, payments, and links",
      "required": [
        "date"
      ],
      "type": "object",
      "properties": {
        "company_location_id": {
          "format": "int32",
          "description": "The company location id for the invoice (toimipaikka). For possible values, refer to /api/settings/companylocations. The company_location_id's value corresponds to the id returned by /api/settings/companylocations\r\n[here](#tag/Settings/operation/Settings_GetCompanyLocations)",
          "type": "integer"
        },
        "currency_code": {
          "description": "The currency code for the invoice (valuuttakoodi) in ISO 4217 format. For example: \"EUR\", \"USD\" or \"SEK\". The current rate for a currency can be retrieved via /api/settings/currency/{code}\r\n[here](#tag/Settings/operation/Settings_GetCurrency)",
          "type": "string"
        },
        "delivery_method": {
          "format": "int32",
          "description": "The delivery method for the invoice (toimitustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_METHODS. The delivery method's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "bank_code": {
          "description": "The bank code used for the invoice (pankkikoodi). For possible values, refer to /api/company/accounts. The bank_code's value corresponds to the bank_code returned by /api/company/accounts\r\n[here](#tag/company/operation/Company_GetAccounts)",
          "type": "string"
        },
        "rf_reference": {
          "description": "The RF reference number for the invoice",
          "type": "string"
        },
        "agreed_due_date": {
          "format": "date-time",
          "description": "The agreed due date for the invoice",
          "type": "string"
        },
        "cash_amount": {
          "format": "double",
          "description": "The first cash discount amount",
          "type": "number"
        },
        "cash_amount2": {
          "format": "double",
          "description": "The second cash discount amount",
          "type": "number"
        },
        "cash_amount3": {
          "format": "double",
          "description": "The third cash discount amount",
          "type": "number"
        },
        "cash_date": {
          "format": "date-time",
          "description": "The first cash discount date",
          "type": "string"
        },
        "cash_date2": {
          "format": "date-time",
          "description": "The second cash discount date",
          "type": "string"
        },
        "cash_date3": {
          "format": "date-time",
          "description": "The third cash discount date",
          "type": "string"
        },
        "customer_order_number": {
          "description": "The customer's own order number",
          "type": "string"
        },
        "delivery_code": {
          "description": "The delivery code",
          "type": "string"
        },
        "delivery_customer_address": {
          "description": "The delivery customer's street address",
          "type": "string"
        },
        "delivery_customer_address2": {
          "description": "The delivery customer's additional address line",
          "type": "string"
        },
        "delivery_customer_address3": {
          "description": "The delivery customer's postal code and city",
          "type": "string"
        },
        "delivery_customer_contact": {
          "description": "The delivery customer's contact person name",
          "type": "string"
        },
        "delivery_customer_country": {
          "description": "The delivery customer's country code. For possible values, refer to /api/codelist/description?filter.codeListFilter=COUNTRIES. The country's value corresponds to the Description returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "delivery_customer_name": {
          "description": "The delivery customer's name",
          "type": "string"
        },
        "delivery_customer_additional_name": {
          "description": "The delivery customer's additional name",
          "type": "string"
        },
        "delivery_customer_number": {
          "format": "int32",
          "description": "The delivery customer's number. For possible values, refer to /api/customers. The delivery_customer_number's value corresponds to the number returned by /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "delivery_customer_contact_phone": {
          "description": "The delivery customer's contact phone number",
          "type": "string"
        },
        "delivery_customer_contact_email": {
          "description": "The delivery customer's contact email address",
          "type": "string"
        },
        "delivery_term": {
          "format": "int32",
          "description": "The delivery term for the invoice (toimitusehto). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_TERMS. The delivery term's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "delivery_term_info": {
          "description": "The delivery term description",
          "type": "string"
        },
        "note": {
          "description": "Additional notes for the invoice",
          "type": "string"
        },
        "orderer_customer_address": {
          "description": "The orderer customer's street address",
          "type": "string"
        },
        "orderer_customer_address2": {
          "description": "The orderer customer's additional address line",
          "type": "string"
        },
        "orderer_customer_address3": {
          "description": "The orderer customer's postal code and city",
          "type": "string"
        },
        "orderer_customer_contact": {
          "description": "The orderer customer's contact person name",
          "type": "string"
        },
        "orderer_customer_country": {
          "description": "The orderer customer's country code. For possible values, refer to /api/codelist/description?filter.codeListFilter=COUNTRIES. The country's value corresponds to the Description returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "orderer_customer_name": {
          "description": "The orderer customer's name",
          "type": "string"
        },
        "orderer_customer_additional_name": {
          "description": "The orderer customer's additional name",
          "type": "string"
        },
        "orderer_customer_number": {
          "format": "int32",
          "description": "The orderer customer's number. For possible values, refer to /api/customers. The orderer_customer_number's value corresponds to the number returned by /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "orderer_customer_contact_phone": {
          "description": "The orderer customer's contact phone number",
          "type": "string"
        },
        "orderer_customer_contact_email": {
          "description": "The orderer customer's contact email address",
          "type": "string"
        },
        "order_mark": {
          "description": "The order mark / reference text",
          "type": "string"
        },
        "our_reference": {
          "description": "Our reference person for the invoice",
          "type": "string"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number associated with the invoice (projektinumero). For possible values, refer to /api/projects. The project_number's value corresponds to the number returned by /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "reference": {
          "description": "The invoice reference number",
          "type": "string"
        },
        "tax_type": {
          "description": "Indicates if the invoice uses reverse charge tax handling",
          "type": "boolean"
        },
        "tax_treatment": {
          "format": "int32",
          "description": "The tax treatment type for the invoice (verokäsittely). For possible values, refer to /api/codelist/description?filter.codeListFilter=TAXTREATMENT_CODES. The tax treatment's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "total_sum": {
          "format": "double",
          "description": "The total sum of the invoice",
          "type": "number"
        },
        "type": {
          "format": "int32",
          "description": "The invoice type code (laskulaji). For possible values and descriptions, see /api/numberseries?filter.numberSeries=Invoice. The type corresponds to the invoice type associated with the number series\r\n[here](#tag/NumberSeries/operation/NumberSeries_List)",
          "type": "integer"
        },
        "value_date": {
          "format": "date-time",
          "description": "The value date for the invoice",
          "type": "string"
        },
        "payment_term": {
          "format": "int32",
          "description": "The payment term for the invoice (maksuehto). For possible values, refer to /api/settings/payment_terms/{languageCode}. The payment term's value corresponds to the number returned by /api/settings/payment_terms\r\n[here](#tag/Settings/operation/Settings_GetPaymentTerms)",
          "type": "integer"
        },
        "person_driver": {
          "format": "int32",
          "description": "The driver person number (kuljettaja). For possible values, refer to /api/codelist/description?filter.codeListFilter=DRIVERS. The person_driver's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "person_invoice_res_person": {
          "format": "int32",
          "description": "The invoice responsible person number (vastuuhenkilö). For possible values, refer to /api/persons. The person_invoice_res_person's value corresponds to the number returned by /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "person_seller_number": {
          "format": "int32",
          "description": "The seller person number (myyjänumero). For possible values, refer to /api/persons. The person_seller_number's value corresponds to the number returned by /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "customer_reference": {
          "description": "The customer's reference for the invoice",
          "type": "string"
        },
        "modified_date": {
          "format": "date-time",
          "description": "The date the invoice was last modified",
          "type": "string"
        },
        "rows": {
          "description": "The invoice rows",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.InvoiceRow"
          }
        },
        "payments": {
          "description": "The invoice payment rows",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.InvoicePayment"
          }
        },
        "links": {
          "description": "The external links associated with the invoice",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
          }
        },
        "currencyrate_from_payload": {
          "description": "If set to true, the currency rate from the request payload is used.\r\nIf set to false, the system retrieves the current currency rate from the currency registry.\r\nRequires currency_code to be set when false.",
          "type": "boolean"
        },
        "external_id": {
          "format": "int32",
          "description": "The invoice ID in an external system",
          "type": "integer"
        },
        "settlement_reference": {
          "description": "The settlement reference for the invoice",
          "type": "string"
        },
        "customerdata_from_payload": {
          "description": "If set to false, the system retrieves customer data from the customer registry for the invoice\r\nand ignores the payload data provided in the request.\r\n            \r\nThe following properties determine which customer data is retrieved from the customer registry:\r\n- customer_number: The invoicing customer's properties are set (e.g., customer_name, customer_address).\r\n- delivery_customer_number: The delivery customer's properties are set (e.g., delivery_customer_address, delivery_customer_contact_email)\r\n- orderer_customer_number: The orderer customer's properties are set (e.g., orderer_customer_name, orderer_customer_address)",
          "type": "boolean"
        },
        "id": {
          "format": "int32",
          "description": "The unique id of the invoice",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The invoice number",
          "type": "integer"
        },
        "invoice_method": {
          "format": "int32",
          "description": "The invoice delivery method (laskutustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=INVOICE_METHODS. The invoice method's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "maximum": 20,
          "minimum": 0,
          "type": "integer"
        },
        "invoice_method_description": {
          "description": "The description of the invoice delivery method",
          "type": "string"
        },
        "customer_address": {
          "description": "The invoicing customer's street address",
          "type": "string"
        },
        "customer_address2": {
          "description": "The invoicing customer's additional address line",
          "type": "string"
        },
        "customer_address3": {
          "description": "The invoicing customer's postal code and city",
          "type": "string"
        },
        "customer_contact": {
          "description": "The invoicing customer's contact person name",
          "type": "string"
        },
        "customer_country": {
          "description": "The invoicing customer's country code. For possible values, refer to /api/codelist/description?filter.codeListFilter=COUNTRIES. The country's value corresponds to the Description returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "customer_name": {
          "description": "The invoicing customer's name",
          "type": "string"
        },
        "customer_additional_name": {
          "description": "The invoicing customer's additional name",
          "type": "string"
        },
        "customer_number": {
          "format": "int32",
          "description": "The invoicing customer's number. For possible values, refer to /api/customers. The customer_number's value corresponds to the number returned by /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_contact_phone": {
          "description": "The invoicing customer's contact phone number",
          "type": "string"
        },
        "customer_contact_email": {
          "description": "The invoicing customer's contact email address",
          "type": "string"
        },
        "date": {
          "format": "date-time",
          "description": "The invoice date",
          "type": "string"
        },
        "description": {
          "description": "The description of the invoice",
          "type": "string"
        },
        "due_date": {
          "format": "date-time",
          "description": "The due date of the invoice",
          "type": "string"
        },
        "invoiced_bit": {
          "description": "Indicates if the invoice has been sent to the customer",
          "type": "boolean"
        },
        "reminder_bit": {
          "description": "Indicates if a reminder has been sent for the invoice",
          "type": "boolean"
        },
        "reminder_count": {
          "format": "int32",
          "description": "The number of reminders sent for the invoice",
          "type": "integer"
        },
        "reminder_date": {
          "format": "date-time",
          "description": "The date of the last reminder sent",
          "type": "string"
        },
        "language_code": {
          "description": "The language code for the invoice (kielikoodi) in ISO 639-3 format. For possible values, refer to /api/settings/languages code property\r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
          "type": "string"
        },
        "currency_rate": {
          "format": "double",
          "description": "The currency exchange rate used on the invoice",
          "type": "number"
        },
        "state": {
          "description": "The state of the invoice. Calculated field: \"KIRJATTU\", \"HYVÄKSYTTY\", \"LASKUTETTU\", \"ERÄÄNTYNYT\", \"SUORITETTU\"",
          "type": "string"
        },
        "online_url": {
          "description": "The URL for viewing the invoice online",
          "type": "string"
        },
        "creditnote_prev_inv_number": {
          "format": "int32",
          "description": "The previous invoice number if this is a credit note",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.InvoiceRow": {
      "description": "An invoice row representing a line item on the invoice",
      "required": [
        "total",
        "unit_price",
        "quantity"
      ],
      "type": "object",
      "properties": {
        "invoice_id": {
          "format": "int32",
          "description": "The id of the invoice this row belongs to",
          "type": "integer"
        },
        "batch_number": {
          "format": "int32",
          "description": "The batch number for batch-tracked products",
          "type": "integer"
        },
        "delivery_customer_number": {
          "format": "int32",
          "description": "The delivery customer number for this row",
          "type": "integer"
        },
        "delivery_date": {
          "format": "date-time",
          "description": "The delivery date for this row",
          "type": "string"
        },
        "order_number": {
          "format": "int32",
          "description": "The sales order number this row originates from",
          "type": "integer"
        },
        "reference": {
          "description": "The reference text for this row",
          "type": "string"
        },
        "stock_id": {
          "format": "int32",
          "description": "The stock id for this row (varasto). For possible values, refer to /api/settings/products/stocks. The stock_id's value corresponds to the id returned by /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "person_seller_id": {
          "format": "int32",
          "description": "The seller person id for this row (myyjänumero). For possible values, refer to /api/persons. The person_seller_id's value corresponds to the number returned by /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The person number for this row. For possible values, refer to /api/persons. The person_number's value corresponds to the number returned by /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "sizes": {
          "description": "The size amounts for products with size types",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SizeAmount"
          }
        },
        "autofill_product": {
          "description": "When set to true, the system automatically fills product data from the product registry\r\nbased on the product_code and the invoice's customer_number",
          "default": false,
          "type": "boolean"
        },
        "id": {
          "format": "int32",
          "description": "The unique id of the invoice row",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The row type (e.g., normal row, header row, comment row)",
          "type": "integer"
        },
        "account": {
          "description": "The accounting account code for this row (tili). For possible values, refer to /api/settings/chart_of_accounts. The account's value corresponds to the account_number returned by /api/settings/chart_of_accounts\r\n[here](#tag/Settings/operation/Settings_GetChartOfAccounts)",
          "type": "string"
        },
        "cost_center": {
          "description": "The cost center code for this row (kustannuspaikka). For possible values, refer to /api/settings/costcenters. The cost_center's value corresponds to the code returned by /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "project_code": {
          "description": "The project code for this row",
          "type": "string"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number for this row (projektinumero). For possible values, refer to /api/projects. The project_number's value corresponds to the number returned by /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "The project phase id for this row (projektivaihe). For possible values, refer to /api/projects/{projectNumber}/phase. The project_phase_id's value corresponds to the id returned by /api/projects/{projectNumber}/phase\r\n[here](#tag/projects/operation/Project_GetPhases)",
          "type": "integer"
        },
        "discount": {
          "format": "double",
          "description": "The first discount percentage for this row",
          "type": "number"
        },
        "discount2": {
          "format": "double",
          "description": "The second discount percentage for this row",
          "type": "number"
        },
        "discount3": {
          "format": "double",
          "description": "The third discount percentage for this row",
          "type": "number"
        },
        "per": {
          "format": "double",
          "description": "The price per unit multiplier",
          "type": "number"
        },
        "sales_price": {
          "format": "double",
          "description": "The calculated sales price per unit (total / quantity)",
          "type": "number"
        },
        "total": {
          "format": "double",
          "description": "The total amount for this row including tax",
          "type": "number"
        },
        "unit_price": {
          "format": "double",
          "description": "The unit price for this row",
          "type": "number"
        },
        "quantity": {
          "format": "double",
          "description": "The quantity for this row",
          "type": "number"
        },
        "quantity2": {
          "format": "double",
          "description": "The secondary quantity for this row",
          "type": "number"
        },
        "color": {
          "description": "The color code for the product on this row",
          "type": "string"
        },
        "customer_discount_percentage": {
          "format": "double",
          "description": "The customer-specific discount percentage",
          "type": "number"
        },
        "dimension": {
          "description": "The dimension information for the product",
          "type": "string"
        },
        "inner_note": {
          "description": "An internal note for this row (not visible on the invoice)",
          "type": "string"
        },
        "net_price": {
          "format": "double",
          "description": "The net price for this row (excluding tax)",
          "type": "number"
        },
        "no_stock_update": {
          "description": "When set to true, the stock is not updated when this row is processed",
          "type": "boolean"
        },
        "note": {
          "description": "A note for this row (visible on the invoice)",
          "type": "string"
        },
        "number": {
          "format": "int32",
          "description": "The row number within the invoice",
          "type": "integer"
        },
        "position": {
          "description": "The position identifier for this row",
          "type": "string"
        },
        "product_code": {
          "description": "The product code for this row",
          "type": "string"
        },
        "product_name": {
          "description": "The product name for this row",
          "type": "string"
        },
        "product_extra_name": {
          "description": "The product extra name for this row",
          "type": "string"
        },
        "tax_amount": {
          "format": "double",
          "description": "The tax amount for this row",
          "type": "number"
        },
        "tax_rate": {
          "format": "double",
          "description": "The tax rate percentage for this row",
          "type": "number"
        },
        "unit": {
          "description": "The unit of measurement (e.g., \"kpl\", \"kg\", \"m\")",
          "type": "string"
        },
        "unit_net_price": {
          "format": "double",
          "description": "The unit net price (excluding tax)",
          "type": "number"
        },
        "unit_net_price_currency": {
          "format": "double",
          "description": "The unit net price in the invoice currency",
          "type": "number"
        },
        "unit_net_currency": {
          "description": "The currency code for the unit net price",
          "type": "string"
        },
        "product_stock": {
          "format": "int32",
          "description": "The stock id for the product on this row (varasto). For possible values, refer to /api/settings/products/stocks. The product_stock's value corresponds to the id returned by /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "lta": {
          "description": "The LTA (liiketapahtuma-avain) reference for accounting. For possible values, refer to /api/settings/ltas. The lta's value corresponds to the code returned by /api/settings/ltas\r\n[here](#tag/Settings/operation/Settings_GetLtas)",
          "type": "string"
        },
        "weight": {
          "format": "double",
          "description": "The weight of the product on this row",
          "type": "number"
        },
        "supplier_id": {
          "format": "int32",
          "description": "The supplier id for this row",
          "type": "integer"
        },
        "row_serial": {
          "description": "The serial number for the product",
          "type": "string"
        },
        "is_serial_follow_up": {
          "description": "Indicates if this product has serial number follow-up",
          "type": "boolean"
        },
        "serialnumber_type": {
          "format": "int32",
          "description": "The serial number type for the product",
          "type": "integer"
        },
        "is_batch_follow_up": {
          "description": "Indicates if this product has batch follow-up",
          "type": "boolean"
        },
        "handedness": {
          "description": "The handedness attribute for the product",
          "type": "string"
        },
        "price_info": {
          "description": "Additional price information for this row",
          "type": "string"
        },
        "blocking": {
          "format": "int32",
          "description": "Blocking id",
          "type": "integer"
        },
        "blocking_start_date": {
          "format": "date-time",
          "description": "Date and time when blocking begins",
          "type": "string"
        },
        "project_info": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectInfo",
          "description": "The project information related to this invoice row"
        },
        "lta_description": {
          "description": "Description of the LTA dimension on this row. Populated when include_dimension_descriptions is true.",
          "type": "string"
        },
        "cost_center_description": {
          "description": "Description of the cost center on this row. Populated when include_dimension_descriptions is true.",
          "type": "string"
        },
        "project_phase_description": {
          "description": "Description of the project phase on this row. Populated when include_dimension_descriptions is true.",
          "type": "string"
        },
        "project_phase_header": {
          "description": "Header (subject) of the project phase on this row. Populated when include_dimension_descriptions is true.",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.InvoicePayment": {
      "description": "A payment entry for an invoice",
      "required": [
        "date"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the payment",
          "type": "integer"
        },
        "invoice_id": {
          "format": "int32",
          "description": "The id of the invoice this payment belongs to",
          "type": "integer"
        },
        "description": {
          "description": "The description of the payment",
          "type": "string"
        },
        "accountlist_account": {
          "description": "The accounting account for the payment (tili). For possible values, refer to /api/settings/chart_of_accounts. The accountlist_account's value corresponds to the account_number returned by /api/settings/chart_of_accounts\r\n[here](#tag/Settings/operation/Settings_GetChartOfAccounts)",
          "type": "string"
        },
        "codelist_cashier_number": {
          "format": "int32",
          "description": "The cashier number from the code list (kassanumero)",
          "type": "integer"
        },
        "codelist_paymentcode": {
          "format": "int32",
          "description": "The payment code from the code list (maksukoodi)",
          "type": "integer"
        },
        "costcenter_code": {
          "description": "The cost center code for the payment (kustannuspaikka). For possible values, refer to /api/settings/costcenters. The costcenter_code's value corresponds to the code returned by /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "customer_date": {
          "format": "date-time",
          "description": "The customer's payment date",
          "type": "string"
        },
        "tax_rate": {
          "format": "double",
          "description": "The tax rate for the payment",
          "type": "number"
        },
        "account_currency": {
          "description": "The currency code for the payment account",
          "type": "string"
        },
        "currency_rate": {
          "format": "double",
          "description": "The currency exchange rate for the payment",
          "type": "number"
        },
        "date": {
          "format": "date-time",
          "description": "The payment date",
          "type": "string"
        },
        "total": {
          "format": "double",
          "description": "The total amount of the payment",
          "type": "number"
        },
        "total_incurrency": {
          "format": "double",
          "description": "The total amount in the payment currency",
          "type": "number"
        },
        "reference_payment_id": {
          "format": "int32",
          "description": "The reference payment id for linked payments",
          "type": "integer"
        },
        "interest_bit": {
          "description": "Indicates if this is an interest payment",
          "type": "boolean"
        },
        "rounding_bit": {
          "description": "Indicates if this is a rounding entry",
          "type": "boolean"
        },
        "archive": {
          "description": "The archive reference for the payment",
          "type": "string"
        },
        "project": {
          "format": "int32",
          "description": "The project number for the payment (projektinumero). For possible values, refer to /api/projects. The project's value corresponds to the number returned by /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "lta": {
          "description": "The LTA (liiketapahtuma-avain) reference for accounting. For possible values, refer to /api/settings/ltas. The lta's value corresponds to the code returned by /api/settings/ltas\r\n[here](#tag/Settings/operation/Settings_GetLtas)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.Link": {
      "description": "An external link associated with a business object",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the link",
          "type": "integer"
        },
        "application_id": {
          "format": "int32",
          "description": "The application id the link belongs to",
          "type": "integer"
        },
        "object_id": {
          "format": "int32",
          "description": "The object id the link is attached to",
          "type": "integer"
        },
        "target": {
          "description": "The target URL or path of the link",
          "type": "string"
        },
        "description": {
          "description": "The description of the link",
          "type": "string"
        },
        "type": {
          "description": "The type of the link",
          "type": "string"
        },
        "codelist_type": {
          "format": "int32",
          "description": "The link type code from the code list",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.ProjectInfo": {
      "description": "Project information related to the invoice row",
      "type": "object",
      "properties": {
        "description": {
          "description": "Project's description",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Invoice]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Invoice"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PageFilter": {
      "type": "object",
      "properties": {
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[System.Int32]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.LogDeleteEvent]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.LogDeleteEvent"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.LogDeleteEvent": {
      "description": "A single deletion event recorded in the audit log (lokitapahtuma)",
      "type": "object",
      "properties": {
        "log_id": {
          "format": "int32",
          "description": "The unique identifier of the log record itself",
          "type": "integer"
        },
        "id": {
          "format": "int32",
          "description": "The identifier of the deleted object (e.g. customer number, product ID) within its source domain",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The timestamp when the deletion was recorded",
          "type": "string"
        },
        "description": {
          "description": "A human-readable description of the deletion event. Always `null` when the log type is Worktime (253)",
          "type": "string"
        },
        "data1": {
          "description": "Primary supplementary context field for the deleted object. Content depends on the log type. Always `null` when the log type is Worktime (253)",
          "type": "string"
        },
        "data2": {
          "description": "Secondary supplementary context field for the deleted object. Content depends on the log type. Always `null` when the log type is Worktime (253)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.Message": {
      "description": "Message payload for creating messages.",
      "type": "object",
      "properties": {
        "header": {
          "description": "Message subject line shown to recipients.",
          "type": "string"
        },
        "body": {
          "description": "Message body text delivered to recipients.",
          "type": "string"
        },
        "role": {
          "description": "Recipient role. All persons with this role receive the message.",
          "enum": [
            "SuperUser",
            "Administrator",
            "Supervisor",
            "Seller",
            "CustomerResp",
            "ProductResp",
            "AccountsRec",
            "AccountsPay",
            "ProjectManager",
            "ProjectRes",
            "DataProtectionOfficer",
            "Circulation",
            "CashierSuperuser",
            "CompanyDirector",
            "User",
            "Cashier",
            "ServiceOrder",
            "DoNotShowProfit",
            "Payroll",
            "Bookkeeper",
            "TimeStamps",
            "BankConnection",
            "TimeStampTerminal",
            "SkillProfileCertificateAdmin",
            "SalesManager",
            "Buyer",
            "ContentIssues",
            "TechicalIssues",
            "Initiatives",
            "Collector",
            "TaxCertificateContentIssues",
            "TaxCertificateTechicalIssues",
            "ProjectLeader",
            "WorkShiftPlanner",
            "HrPerson",
            "BankAdmin"
          ],
          "type": "string"
        },
        "function_id": {
          "format": "int32",
          "description": "Lemonsoft function context identifier stored as the message application data id.",
          "type": "integer"
        },
        "send_internal_message": {
          "description": "When true, an internal Lemonsoft message is created for each recipient. Defaults to true.",
          "type": "boolean"
        },
        "send_email": {
          "description": "When true, an email notification is sent to recipients.",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.QueryFilters.NumberSeriesFilter": {
      "description": "Filter for querying number series. Filter parameters must be provided in the request — an omitted filter (null) returns BadRequest. Invalid NumberSeries values return an empty list.",
      "required": [
        "NumberSeries"
      ],
      "type": "object",
      "properties": {
        "NumberSeries": {
          "description": "The number series category to fetch (required). Determines which source library is queried:\r\nInvoice (1) → sales invoice number series, PurchaseInvoice (2) → purchase invoice number series,\r\nProduct (3) → product number series, Project (4) → project number series",
          "enum": [
            "Invoice",
            "PurchaseInvoice",
            "Product",
            "Project"
          ],
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.NumberSeriesBase]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.NumberSeriesBase"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.NumberSeriesBase": {
      "description": "A number series entry (numerosarja) used to assign sequential numbers to invoices, purchase invoices, products or projects",
      "type": "object",
      "properties": {
        "type": {
          "format": "int32",
          "description": "An opaque integer identifying the number series type within the queried source library. Not directly interpretable by API consumers",
          "type": "integer"
        },
        "description": {
          "description": "The description of the number series (kuvaus)",
          "type": "string"
        },
        "number": {
          "description": "The current (last assigned) sequential number in this series",
          "type": "string"
        },
        "id": {
          "format": "int32",
          "description": "The unique identifier of the number series",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.Offer": {
      "description": "An offer (tarjous) in Lemonsoft ERP, with full header data, rows, links and sales phase information",
      "type": "object",
      "properties": {
        "offer_date": {
          "format": "date-time",
          "description": "The offer date (tarjouspäivä)",
          "type": "string"
        },
        "offer_description": {
          "description": "The offer description (tarjouksen kuvaus)",
          "type": "string"
        },
        "offer_id": {
          "format": "int32",
          "description": "The unique internal id of the offer",
          "type": "integer"
        },
        "offer_number": {
          "format": "int32",
          "description": "The offer number (tarjousnumero) — unique business identifier",
          "type": "integer"
        },
        "offer_rows": {
          "description": "The rows on this offer",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.OfferRow"
          }
        },
        "offer_deal_date": {
          "format": "date-time",
          "description": "The deal date — set when the offer is marked won (kauppapäivä)",
          "type": "string"
        },
        "offer_valid_date": {
          "format": "date-time",
          "description": "The date until which the offer is valid (voimassaolopäivä)",
          "type": "string"
        },
        "offer_deliverydate": {
          "format": "date-time",
          "description": "The proposed delivery date for the offer (toimituspäivä)",
          "type": "string"
        },
        "offer_invoicing_date": {
          "format": "date-time",
          "description": "The proposed invoicing date for the offer (laskutuspäivä)",
          "type": "string"
        },
        "version_count": {
          "format": "int32",
          "description": "The total number of versions for this offer",
          "type": "integer"
        },
        "offer_type_attribute": {
          "format": "int32",
          "description": "The id of the offer type attribute",
          "type": "integer"
        },
        "offer_type": {
          "format": "int32",
          "description": "The offer type (tarjoustyyppi)",
          "type": "integer"
        },
        "tot_profit": {
          "format": "double",
          "description": "The total profit across all rows",
          "type": "number"
        },
        "tot_without_tax": {
          "format": "double",
          "description": "The total amount excluding tax",
          "type": "number"
        },
        "profit_percent": {
          "format": "double",
          "description": "The total profit as a percentage",
          "type": "number"
        },
        "currency_code": {
          "description": "The currency code of the offer (valuuttakoodi). For possible values, refer to /api/settings/currency/{code}\r\n[here](#tag/Settings/operation/Settings_GetCurrency)",
          "type": "string"
        },
        "offer_ordermark": {
          "description": "Order mark / mark text for the offer (tilausmerkki)",
          "type": "string"
        },
        "offer_our_reference": {
          "description": "Our reference text (viitteemme)",
          "type": "string"
        },
        "person_seller_number": {
          "format": "int32",
          "description": "The seller person number (myyjänumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "payment_term": {
          "format": "int32",
          "description": "The payment term for the offer (maksuehto). For possible values, refer to /api/settings/payment_terms/{languageCode}\r\n[here](#tag/Settings/operation/Settings_GetPaymentTerms)",
          "type": "integer"
        },
        "delivery_method": {
          "format": "int32",
          "description": "The delivery method for the offer (toimitustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_METHODS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "offer_delivery_code": {
          "description": "Free-text delivery code on the offer",
          "type": "string"
        },
        "offer_delivery_term": {
          "format": "int32",
          "description": "The delivery term for the offer (toimitusehto). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_TERMS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "offer_delivery_term_info": {
          "description": "Free-text delivery term description on the offer",
          "type": "string"
        },
        "person_invoice_res_person": {
          "format": "int32",
          "description": "The responsible person for invoicing the offer (vastuuhenkilö). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "offer_taxtype_bit": {
          "description": "Tax type indicator — true when prices include tax, false when prices exclude tax",
          "type": "boolean"
        },
        "offer_totalsum": {
          "format": "double",
          "description": "The total sum of the offer",
          "type": "number"
        },
        "company_location_id": {
          "format": "int32",
          "description": "The company location id (toimipaikka). For possible values, refer to /api/settings/companylocations\r\n[here](#tag/Settings/operation/Settings_GetCompanyLocations)",
          "type": "integer"
        },
        "offer_note": {
          "description": "Free-text note attached to the offer (huomautus)",
          "type": "string"
        },
        "offer_customer_number": {
          "format": "int32",
          "description": "The invoicing customer number (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "offer_customer_name1": {
          "description": "The invoicing customer's primary name",
          "type": "string"
        },
        "offer_customer_reference": {
          "description": "Reference text from the customer (viitteenne)",
          "type": "string"
        },
        "offer_customer_name2": {
          "description": "The invoicing customer's secondary name",
          "type": "string"
        },
        "offer_customer_address1": {
          "description": "The invoicing customer's street address",
          "type": "string"
        },
        "offer_customer_address2": {
          "description": "The invoicing customer's postal code + city",
          "type": "string"
        },
        "offer_customer_address3": {
          "description": "The invoicing customer's additional address line",
          "type": "string"
        },
        "offer_customer_country": {
          "description": "The invoicing customer's country code. For possible values, refer to /api/codelist/description?filter.codeListFilter=COUNTRIES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "offer_customer_contact": {
          "description": "The invoicing customer's contact person name",
          "type": "string"
        },
        "offer_project_number": {
          "format": "int32",
          "description": "The project number attached to the offer (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "delivery_customer_number": {
          "description": "The delivery customer's customer number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "string"
        },
        "delivery_customer_name1": {
          "description": "The delivery customer's primary name",
          "type": "string"
        },
        "delivery_customer_name2": {
          "description": "The delivery customer's secondary name",
          "type": "string"
        },
        "delivery_customer_address1": {
          "description": "The delivery customer's street address",
          "type": "string"
        },
        "delivery_customer_address2": {
          "description": "The delivery customer's postal code + city",
          "type": "string"
        },
        "delivery_customer_address3": {
          "description": "The delivery customer's additional address line",
          "type": "string"
        },
        "delivery_customer_country": {
          "description": "The delivery customer's country code. For possible values, refer to /api/codelist/description?filter.codeListFilter=COUNTRIES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "delivery_customer_contact": {
          "description": "The delivery customer's contact person name",
          "type": "string"
        },
        "won_bit": {
          "description": "Indicates the offer has been won (kauppa)",
          "type": "boolean"
        },
        "lost_bit": {
          "description": "Indicates the offer has been lost (menetetty)",
          "type": "boolean"
        },
        "wait_bit": {
          "description": "Indicates the offer is waiting / pending (odottaa)",
          "type": "boolean"
        },
        "won_why": {
          "description": "Reason the offer was won (free text)",
          "type": "string"
        },
        "lost_why": {
          "description": "Reason the offer was lost (free text)",
          "type": "string"
        },
        "wait_why": {
          "description": "Reason the offer is waiting (free text)",
          "type": "string"
        },
        "won_date": {
          "format": "date-time",
          "description": "The date the offer was marked won",
          "type": "string"
        },
        "lost_date": {
          "format": "date-time",
          "description": "The date the offer was marked lost",
          "type": "string"
        },
        "wait_date": {
          "format": "date-time",
          "description": "The date the offer was marked waiting",
          "type": "string"
        },
        "version": {
          "description": "The version string of this offer (e.g. \"A\", \"B\"). New offers default to empty",
          "type": "string"
        },
        "is_newest_version": {
          "description": "True when this is the newest version of the offer (highest version)",
          "type": "boolean"
        },
        "order_number": {
          "format": "int32",
          "description": "The order number generated when the offer becomes an order (tilausnumero)",
          "type": "integer"
        },
        "links": {
          "description": "External links attached to the offer",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
          }
        },
        "Sales_phase_collection": {
          "format": "int32",
          "description": "The id of the sales phase collection assigned to this offer",
          "type": "integer"
        },
        "Offer_current_sales_phase": {
          "format": "int32",
          "description": "The id of the current sales phase the offer is in",
          "type": "integer"
        },
        "orderer_customer_number": {
          "format": "int32",
          "description": "The orderer customer's customer number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "orderer_customer_name1": {
          "description": "The orderer customer's primary name",
          "type": "string"
        },
        "orderer_customer_name2": {
          "description": "The orderer customer's secondary name",
          "type": "string"
        },
        "orderer_customer_address1": {
          "description": "The orderer customer's street address",
          "type": "string"
        },
        "orderer_customer_address2": {
          "description": "The orderer customer's postal code + city",
          "type": "string"
        },
        "orderer_customer_address3": {
          "description": "The orderer customer's additional address line",
          "type": "string"
        },
        "orderer_customer_country": {
          "description": "The orderer customer's country code. For possible values, refer to /api/codelist/description?filter.codeListFilter=COUNTRIES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "orderer_customer_contact": {
          "description": "The orderer customer's contact person name",
          "type": "string"
        },
        "language_code": {
          "description": "The language code of the offer (kielikoodi). For possible values, refer to /api/settings/languages\r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
          "type": "string"
        },
        "deal_bit": {
          "description": "Indicates if the offer has prognosis (Tarjous - ennuste ja kilpailijat - kauppa)",
          "type": "boolean"
        },
        "external_id": {
          "format": "int32",
          "description": "Offer ID in external system",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.OfferRow": {
      "description": "An offer row representing a line item on the offer (tarjousrivi). Inherits all common row properties (product_code, quantity, price, discount, tax_rate, ...) from Row",
      "required": [
        "total",
        "unit_price",
        "quantity"
      ],
      "type": "object",
      "properties": {
        "invoice": {
          "description": "Indicates whether this row has already been invoiced",
          "type": "boolean"
        },
        "offer_id": {
          "format": "int32",
          "description": "The offer this row belongs to (internal id)",
          "type": "integer"
        },
        "offerrow_reference": {
          "description": "Reference text for this offer row (rivikohtainen viite)",
          "type": "string"
        },
        "offerrow_deliverydate": {
          "format": "date-time",
          "description": "Optional delivery date for this row (rivin toimituspäivä)",
          "type": "string"
        },
        "offerrow_ordernumber": {
          "format": "int32",
          "description": "The related order number if this offer row has been ordered (tilausnumero)",
          "type": "integer"
        },
        "stock_unit": {
          "description": "The stock unit (varastoyksikkö) for the row",
          "type": "string"
        },
        "row_product_batch_id": {
          "format": "int32",
          "description": "The id of the product batch referenced by this row (eränumero)",
          "type": "integer"
        },
        "sizes": {
          "description": "Size-amount breakdown when the product has size variants (kokojakauma)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SizeAmount"
          }
        },
        "worknumber": {
          "format": "int32",
          "description": "The worknumber for the row",
          "type": "integer"
        },
        "productdata_from_payload": {
          "description": "Set this to false to get the product data from lemonsoft by product_code and quantity. By default product data is fetched from payload.",
          "type": "boolean"
        },
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "type": "integer"
        },
        "account": {
          "type": "string"
        },
        "cost_center": {
          "type": "string"
        },
        "project_code": {
          "type": "string"
        },
        "project_number": {
          "format": "int32",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "type": "integer"
        },
        "discount": {
          "format": "double",
          "type": "number"
        },
        "discount2": {
          "format": "double",
          "type": "number"
        },
        "discount3": {
          "format": "double",
          "type": "number"
        },
        "per": {
          "format": "double",
          "type": "number"
        },
        "sales_price": {
          "format": "double",
          "type": "number"
        },
        "total": {
          "format": "double",
          "type": "number"
        },
        "unit_price": {
          "format": "double",
          "type": "number"
        },
        "quantity": {
          "format": "double",
          "type": "number"
        },
        "quantity2": {
          "format": "double",
          "type": "number"
        },
        "color": {
          "type": "string"
        },
        "customer_discount_percentage": {
          "format": "double",
          "type": "number"
        },
        "dimension": {
          "type": "string"
        },
        "inner_note": {
          "type": "string"
        },
        "net_price": {
          "format": "double",
          "type": "number"
        },
        "no_stock_update": {
          "type": "boolean"
        },
        "note": {
          "type": "string"
        },
        "number": {
          "format": "int32",
          "type": "integer"
        },
        "position": {
          "type": "string"
        },
        "product_code": {
          "type": "string"
        },
        "product_name": {
          "type": "string"
        },
        "product_extra_name": {
          "type": "string"
        },
        "tax_amount": {
          "format": "double",
          "type": "number"
        },
        "tax_rate": {
          "format": "double",
          "type": "number"
        },
        "unit": {
          "type": "string"
        },
        "unit_net_price": {
          "format": "double",
          "type": "number"
        },
        "unit_net_price_currency": {
          "format": "double",
          "type": "number"
        },
        "unit_net_currency": {
          "type": "string"
        },
        "product_stock": {
          "format": "int32",
          "type": "integer"
        },
        "lta": {
          "type": "string"
        },
        "weight": {
          "format": "double",
          "type": "number"
        },
        "supplier_id": {
          "format": "int32",
          "type": "integer"
        },
        "row_serial": {
          "type": "string"
        },
        "is_serial_follow_up": {
          "type": "boolean"
        },
        "serialnumber_type": {
          "format": "int32",
          "type": "integer"
        },
        "is_batch_follow_up": {
          "type": "boolean"
        },
        "handedness": {
          "type": "string"
        },
        "price_info": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.OfferFilter": {
      "description": "Filter for querying offers. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "customer_number": {
          "format": "int32",
          "description": "Filter offers by invoicing customer number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "delivery_customer_number": {
          "format": "int32",
          "description": "Filter offers by delivery customer number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "offer_date_before": {
          "format": "date-time",
          "description": "Filter offers whose offer date is on or before this date",
          "type": "string"
        },
        "offer_date_after": {
          "format": "date-time",
          "description": "Filter offers whose offer date is on or after this date",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Filter offers whose updated_at is on or before this date",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "description": "Filter offers whose updated_at is on or after this date",
          "type": "string"
        },
        "include_old_versions": {
          "description": "When true, returns all offer versions (not just the newest). State and action_date filters have no effect when this is true",
          "type": "boolean"
        },
        "offer_numbers": {
          "description": "Filter offers by one or more specific offer numbers",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "has_external_id": {
          "description": "When true, only offers with an external_id are returned; when false, only offers without one",
          "type": "boolean"
        },
        "external_id": {
          "format": "int32",
          "description": "Filter by a specific external_id value",
          "type": "integer"
        },
        "seller_number": {
          "description": "Filter offers by seller person number. Supports multiple values.\r\nOmit or leave empty to disable the filter.",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "state": {
          "description": "Filter offers by state (tila). Values: 0 = open (kesken), 1 = waiting (odottaa),\r\n2 = lost (menetetty), 3 = won (kauppa). Multiple states may be provided.\r\nNote: state filter is applied via the v_offer_all view and therefore has no effect\r\nwhen include_old_versions=true.",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "action_date_before": {
          "format": "date-time",
          "description": "Filter offers by the state action date upper bound (offer_action_date: won/lost/wait date\r\nof the current state). Omit to disable. Applied via the v_offer_all view — no effect\r\nwhen include_old_versions=true. Offers with no action date (open) are excluded.",
          "type": "string"
        },
        "action_date_after": {
          "format": "date-time",
          "description": "Filter offers by the state action date lower bound (offer_action_date: won/lost/wait date\r\nof the current state). Omit to disable. Applied via the v_offer_all view — no effect\r\nwhen include_old_versions=true. Offers with no action date (open) are excluded.",
          "type": "string"
        },
        "sort_field": {
          "description": "Sort field (database column name). Default is \"offer_date\". Common values: offer_id, offer_date, offer_number, offer_last_deadline.\r\nFalls back to default if column does not exist.",
          "type": "string"
        },
        "sort_desc": {
          "description": "Sorting order. Default is ascending (false).",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Offer]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Offer"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesPhaseCollection]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesPhaseCollection"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.SalesPhaseCollection": {
      "description": "A sales phase collection grouping a sequence of sales phases used by offers (myyntivaihekokoelma)",
      "type": "object",
      "properties": {
        "Sales_phase_collection_id": {
          "format": "int32",
          "description": "The unique id of the sales phase collection",
          "type": "integer"
        },
        "Sales_phase_collection_description": {
          "description": "The collection's description",
          "type": "string"
        },
        "SalesPhases": {
          "description": "The sales phases that make up this collection",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesPhase"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.SalesPhase": {
      "description": "A single sales phase within a sales phase collection (myyntivaihe)",
      "type": "object",
      "properties": {
        "Sales_phase_id": {
          "format": "int32",
          "description": "The unique id of the sales phase",
          "type": "integer"
        },
        "Sales_phase_collection_id": {
          "format": "int32",
          "description": "The id of the parent sales phase collection",
          "type": "integer"
        },
        "Sales_phase_header": {
          "description": "The header / display name of the sales phase",
          "type": "string"
        },
        "Sales_phase_prerequisite": {
          "description": "Free-text prerequisite description for the phase",
          "type": "string"
        },
        "Sales_phase_row": {
          "format": "int32",
          "description": "The order position of this phase within the collection",
          "type": "integer"
        },
        "Sales_phase_probability": {
          "format": "double",
          "description": "The probability assigned to this phase (percent)",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.QueryFilters.OrderFilter": {
      "type": "object",
      "properties": {
        "type": {
          "format": "int32",
          "description": "Specifies the sales order type (laji). For possible values and descriptions, see /api/settings/salesorder_numberseries salesorder_type\r\n[here](#tag/Settings/operation/Settings_GetSalesOrderNumberseries)",
          "type": "integer"
        },
        "state": {
          "description": "Specifies the sales order state (tila). For possible values and descriptions, see /api/settings/states/2\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "customer_number": {
          "format": "int32",
          "description": "The billing customer’s number in the sales order (laskutusasiakkaan numero)",
          "type": "integer"
        },
        "delivery_customer_number": {
          "format": "int32",
          "description": "The delivery customer’s number in the sales order (toimitusasiakkaan numero)",
          "type": "integer"
        },
        "orderer_customer_number": {
          "format": "int32",
          "description": "The orderer customer’s number in the sales order (tilaajasasiakkaan numero)",
          "type": "integer"
        },
        "consignee_customer_number": {
          "format": "int32",
          "description": "The consignee customer’s number in the sales order (vastaanottajasasiakkaan numero)",
          "type": "integer"
        },
        "order_numbers": {
          "description": "The sales order number (myyntitilauksen numero). May include multiple numbers.",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "ordered_before": {
          "format": "date-time",
          "description": "The date/time before which the sales order was ordered (tilattu ennen).",
          "type": "string"
        },
        "ordered_after": {
          "format": "date-time",
          "description": "The date/time after which the sales order was ordered (tilattu jälkeen).",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "The date/time before which the sales order was modified (muokattu ennen)",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "description": "The date/time after which the sales order was modified (muokattu jälkeen)",
          "type": "string"
        },
        "only_allowed_types": {
          "description": "Filters out sales orders to which the user does not have access by type.",
          "type": "boolean"
        },
        "skip_service": {
          "description": "Skip service orders in query. Service orders are orders with type less than 200.",
          "type": "boolean"
        },
        "only_service": {
          "description": "Only service orders in query. Service order are orders with type equal or greater than 200.",
          "type": "boolean"
        },
        "sort_desc": {
          "description": "Sorting order by id. Default is ascending (false).",
          "type": "boolean"
        },
        "product_code": {
          "description": "Search sales order by product code (tuotekoodi, sku)",
          "type": "string"
        },
        "customer_ordernumber": {
          "description": "Search sales order by customer order number (tilausnumeronne)",
          "type": "string"
        },
        "seller_number": {
          "format": "int32",
          "description": "Search sales order by seller number (myyjä)",
          "type": "integer"
        },
        "only_models": {
          "description": "Search only for sales order base models (mallipohjat). These are sales orders where sales_order_number is less than 0",
          "type": "boolean"
        },
        "service_order_serial": {
          "description": "Search service order by service order serial (huoltotilauksen sarjanumero)",
          "type": "string"
        },
        "service_order_product_code": {
          "description": "Search service order by service order product code (huoltotilauksen tuotekoodi)",
          "type": "string"
        },
        "project_number": {
          "format": "int32",
          "description": "Search order by project number (projektin numero). Use project_number = -1 to disable search by project number",
          "type": "integer"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.SalesOrder]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrder"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrder": {
      "description": "The sales order model (myyntitilaus)",
      "required": [
        "order_datetime",
        "rows"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "Unique identifier for the sales order",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "Sales order number (numero)",
          "type": "integer"
        },
        "order_datetime": {
          "format": "date-time",
          "description": "The date and time when the order was created",
          "type": "string"
        },
        "delivery_datetime": {
          "format": "date-time",
          "description": "The date and time when the order was delivered",
          "type": "string"
        },
        "shipment_datetime": {
          "format": "date-time",
          "description": "The date and time when the order was shipped",
          "type": "string"
        },
        "rows": {
          "description": "The sales order rows that describe the contents of the order",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRow"
          }
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number of the customer who made the order",
          "type": "integer"
        },
        "customer_address": {
          "description": "The invoiced customer's street address (lähiosoite) for the sales order, for example: \"Mannerheimintie 30\".",
          "type": "string"
        },
        "customer_address2": {
          "description": "Extra address field for the invoiced customer's address (osoite) for the sales order",
          "type": "string"
        },
        "customer_address3": {
          "description": "The address of the invoiced customer for the sales order, formatted as\r\n\"{Postal Code} {Location}\", for example: \"00100 Helsinki\".",
          "type": "string"
        },
        "customer_contact": {
          "description": "The name of the invoiced customer's contact person for the sales order.",
          "type": "string"
        },
        "customer_contact_email": {
          "description": "The email address of the invoiced customer's contact person for the sales order.",
          "type": "string"
        },
        "customer_contact_phone": {
          "description": "The phone number of the invoiced customer's contact person for the sales order.",
          "type": "string"
        },
        "customer_country": {
          "description": "The country of the invoiced customer",
          "type": "string"
        },
        "customer_name": {
          "description": "The name of the invoiced customer",
          "type": "string"
        },
        "customer_name2": {
          "description": "Extra field for the invoiced customer's name",
          "type": "string"
        },
        "customer_order_number": {
          "description": "The customer's order number (tilausnumeronne) for the sales order.",
          "type": "string"
        },
        "customer_reference": {
          "description": "The customer's reference (viitteenne) for the sales order.",
          "type": "string"
        },
        "delivery_customer_number": {
          "format": "int32",
          "description": "The customer number of the customer who will receive the delivery",
          "type": "integer"
        },
        "delivery_customer_address": {
          "description": "The delivery customer's street address (lähiosoite) for the sales order, for example: \"Mannerheimintie 30\".",
          "type": "string"
        },
        "delivery_customer_address2": {
          "description": "Extra address field for the delivery customer's address",
          "type": "string"
        },
        "delivery_customer_address3": {
          "description": "The delivery customer's address (osoite), formatted as \"{Postal Code} {Location}\", for example: \"00100 Helsinki\".",
          "type": "string"
        },
        "delivery_customer_contact": {
          "description": "The delivery customer's contact person for the sales order.",
          "type": "string"
        },
        "delivery_customer_contact_email": {
          "description": "The email address of the delivery customer's contact person for the sales order.",
          "type": "string"
        },
        "delivery_customer_contact_phone": {
          "description": "The phone number of the delivery customer's contact person for the sales order.",
          "type": "string"
        },
        "delivery_customer_country": {
          "description": "The country of the delivery customer",
          "type": "string"
        },
        "delivery_customer_name": {
          "description": "The name of the delivery customer",
          "type": "string"
        },
        "delivery_customer_name2": {
          "description": "The extra name field for the delivery customer",
          "type": "string"
        },
        "orderer_customer_number": {
          "format": "int32",
          "description": "The customer number of the customer who made the order",
          "type": "integer"
        },
        "orderer_customer_address": {
          "description": "The orderer's street address (lähiosoite) for the sales order, for example: \"Mannerheimintie 30\".",
          "type": "string"
        },
        "orderer_customer_address2": {
          "description": "The extra address field for the orderer's address",
          "type": "string"
        },
        "orderer_customer_address3": {
          "description": "The orderer's address (osoite), formatted as \"{Postal Code} {Location}\", for example: \"00100 Helsinki\".",
          "type": "string"
        },
        "orderer_customer_contact": {
          "description": "The name of the orderer's contact person for the sales order.",
          "type": "string"
        },
        "orderer_customer_contact_email": {
          "description": "The email address of the orderer's contact person for the sales order.",
          "type": "string"
        },
        "orderer_customer_contact_phone": {
          "description": "The phone number of the orderer's contact person for the sales order.",
          "type": "string"
        },
        "orderer_customer_country": {
          "description": "The country of the orderer",
          "type": "string"
        },
        "orderer_customer_name": {
          "description": "The name of the orderer",
          "type": "string"
        },
        "orderer_customer_name2": {
          "description": "The extra name field for the orderer",
          "type": "string"
        },
        "consignee_customer_number": {
          "format": "int32",
          "description": "The consignee customer's number",
          "type": "integer"
        },
        "consignee_customer_address": {
          "description": "The consignee customer's street address (lähiosoite) for the sales order, for example: \"Mannerheimintie 30\".",
          "type": "string"
        },
        "consignee_customer_address2": {
          "description": "The extra address field for the consignee customer's address",
          "type": "string"
        },
        "consignee_customer_address3": {
          "description": "The consignee customer's address (osoite), formatted as \"{Postal Code} {Location}\", for example: \"00100 Helsinki\".",
          "type": "string"
        },
        "consignee_customer_contact": {
          "description": "The name of the consignee customer's contact person for the sales order.",
          "type": "string"
        },
        "consignee_customer_contact_email": {
          "description": "The email address of the consignee customer's contact person for the sales order.",
          "type": "string"
        },
        "consignee_customer_contact_phone": {
          "description": "The phone number of the consignee customer's contact person for the sales order.",
          "type": "string"
        },
        "consignee_customer_country": {
          "description": "The country of the consignee",
          "type": "string"
        },
        "consignee_customer_name": {
          "description": "The name of the consignee",
          "type": "string"
        },
        "consignee_customer_name2": {
          "description": "The extra name field for the consignee",
          "type": "string"
        },
        "is_confirmed": {
          "description": "Indicates whether the sales order has been confirmed with the customer  (vahvistettu asiakkaalle)",
          "type": "boolean"
        },
        "is_taxful": {
          "description": "Indicates whether the order's prices include VAT (ALV)",
          "type": "boolean"
        },
        "currency_rate": {
          "format": "double",
          "description": "The currency rate for the sales order (valuuttakurssi). Must be higher than 0",
          "type": "number"
        },
        "total": {
          "format": "double",
          "description": "The total sum of the sales order",
          "type": "number"
        },
        "weight": {
          "format": "double",
          "description": "The weight of the sales order",
          "type": "number"
        },
        "delivery_method": {
          "format": "int32",
          "description": "The delivery method for the sales order (toimitustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_METHODS. The delivery method's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "delivery_term": {
          "format": "int32",
          "description": "The terms of delivery for sales order (toimitusehto). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_TERMS. The delivery term's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "delivery_term_info": {
          "description": "Additional information for the sales order's delivery terms  (toimitusehdon lisätieto)",
          "type": "string"
        },
        "payment_term": {
          "format": "int32",
          "description": "The payement term for the sales order (maksuehto). For possible values, refer to /api/codelist/payment_term. The payment term's value corresponds to the number returned by /api/codelist/payment_term\r\n[here](#tag/codelist/operation/Codelist_ListPaymentTerms)",
          "type": "integer"
        },
        "sales_channel_id": {
          "format": "int32",
          "description": "The sales channel id (myyntikanava). For possible values, refer to /api/codelist/description?filter.codeListFilter=SALESCHANNEL",
          "type": "integer"
        },
        "invoice_res_person": {
          "format": "int32",
          "description": "The responsible person for the sales order's invoice (vastuuhenkilö). For possible values, refer to /api/persons. The invoice_res_person's value corresponds to the number returned by /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "seller_number": {
          "format": "int32",
          "description": "The seller number for the sales order (myyjänumero). For possible values, refer to /api/persons. The seller_number's value corresponds to the number returned by /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number for the sales order (projektinumero). For possible values, refer to /api/projects. The project_number's value corresponds to the number returned by /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "row_count": {
          "format": "int32",
          "description": "The amount of rows in the sales order",
          "type": "integer"
        },
        "state": {
          "format": "int32",
          "description": "The current state for sales order (tila). For possible values and descriptions, see /api/settings/states/2\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The sales order's type (laji). For possible values and descriptions, see /api/settings/salesorder_numberseries salesorder_type\r\n[here](#tag/Settings/operation/Settings_GetSalesOrderNumberseries)",
          "type": "integer"
        },
        "currency_code": {
          "description": "The currency code for the sales order (valuuttakoodi) in ISO 4217 format. For example: \"EUR\", \"USD\" or \"SEK\". The available codes are controlled via currency codes in codelists",
          "type": "string"
        },
        "delivery_code": {
          "description": "The delivery code for the sales order (toimitustieto). This is a free text field",
          "type": "string"
        },
        "delivery_text": {
          "description": "The delivery text for the sales order (toimitusteksti). This is a free text field",
          "type": "string"
        },
        "description": {
          "description": "The description for the sales order (kuvaus). This is a free text field",
          "type": "string"
        },
        "invoice_reference": {
          "description": "The invoice reference for e-commerce integrations (maksutunniste), for example Paytrail, payment ID. The reference will be transferred to the invoice from sales order.",
          "type": "string"
        },
        "language_code": {
          "description": "The language code for the sales order (kielikoodi) in ISO 639‑3 format. For possible values, refer to /api/settings/languages code property. \r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
          "type": "string"
        },
        "note_number": {
          "format": "int32",
          "description": "The note number for the sales order (viestinumero). This value corresponds to the note's ID in Settings -&gt; Notes",
          "type": "integer"
        },
        "note": {
          "description": "A note for the sales order (viesti)",
          "type": "string"
        },
        "mark": {
          "description": "Mark for the sales order (merkki)",
          "type": "string"
        },
        "our_reference": {
          "description": "Our organization's sales order reference number (viitteemme)",
          "type": "string"
        },
        "service_products": {
          "description": "A list of service products for the sales order",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ServiceProduct"
          }
        },
        "service_product": {
          "description": "The product code of service order (huoltotyön tuotekoodi)",
          "type": "string"
        },
        "service_serialnumber": {
          "description": "The serial number of the service order (huoltotyön sarjanumero)",
          "type": "string"
        },
        "service_description_todo": {
          "description": "The description of the service order (huoltotyön kuvaus)",
          "type": "string"
        },
        "service_description_done": {
          "description": "The description for the completed work in service order (työselite)",
          "type": "string"
        },
        "service_description_inner": {
          "description": "The internal description for the service order (sisäinen kuvaus)",
          "type": "string"
        },
        "service_price_estimate": {
          "description": "The cost estimate for the service order (kustannusarvio)",
          "type": "string"
        },
        "service_failcode": {
          "format": "int32",
          "description": "The fault code for the service order (syykoodi). The available codes are controlled via fault codes in codelists (huollon vikakoodi)",
          "type": "integer"
        },
        "service_workhours": {
          "format": "double",
          "description": "The hours of work performed (työaika)",
          "type": "number"
        },
        "service_km_start": {
          "format": "int32",
          "description": "The current kilometers on the vehicle at the beginning of the work (km-alku)",
          "type": "integer"
        },
        "service_km_end": {
          "format": "int32",
          "description": "The kilometers on the vehicle at the end of the work (km-loppu)",
          "type": "integer"
        },
        "service_km": {
          "format": "int32",
          "description": "The total kilometers traveled during the work (kilometrit)",
          "type": "integer"
        },
        "service_travel_time": {
          "format": "double",
          "description": "The travel time for the service order (matka-aika)",
          "type": "number"
        },
        "service_day_allowance": {
          "format": "double",
          "description": "The total amount of daily allowance for the service order (päiväraha)",
          "type": "number"
        },
        "service_halfday_allowance": {
          "format": "double",
          "description": "The total amount of half-day allowance for the service order (puolipäiväraha)",
          "type": "number"
        },
        "service_version": {
          "format": "int32",
          "description": "The service order's version number (versio)",
          "type": "integer"
        },
        "service_donedate": {
          "format": "date-time",
          "description": "The date and time when the service order was completed (tehty)",
          "type": "string"
        },
        "service_started": {
          "format": "date-time",
          "description": "The date and time when the service order was started (asiakkaalla)",
          "type": "string"
        },
        "service_warranty_bit": {
          "description": "The warranty for the service order (takuu voimassa). True if the warranty is valid, false if not",
          "type": "boolean"
        },
        "service_contact": {
          "description": "The contact for the service order (kontakti). This is a free text field",
          "type": "string"
        },
        "service_location": {
          "description": "The location for the service order (sijainti). This is a free text field",
          "type": "string"
        },
        "service_started_trip": {
          "format": "date-time",
          "description": "The date and time when the service order was started (lähdetty matkaan)",
          "type": "string"
        },
        "service_started_date_calendar": {
          "format": "date-time",
          "description": "The date and time when the service order is scheduled to start",
          "type": "string"
        },
        "service_ended_date_calendar": {
          "format": "date-time",
          "description": "The date and time when the service order is scheduled to end",
          "type": "string"
        },
        "agreement_response_time": {
          "format": "double",
          "description": "The agreement response time for the service order (vasteaika)",
          "type": "number"
        },
        "service_type": {
          "format": "int32",
          "description": "The service type for the service order (huoltotyyppi). The available codes are controlled via codelists (huoltotyypit)",
          "type": "integer"
        },
        "service_response_time": {
          "format": "double",
          "description": "The actualized response time for the service order (toteutunut vasteaika). This is calculated based on the actual start and end times",
          "type": "number"
        },
        "service_team": {
          "format": "int32",
          "description": "The service team for the service order (huoltotiimi). The available codes are found in /api/settings/teams.\r\n[here](#tag/Settings/operation/Settings_GetTeams)",
          "type": "integer"
        },
        "service_agreement_number": {
          "format": "int32",
          "description": "The agreement number for the service order (sopimusnumero)",
          "type": "integer"
        },
        "service_customer_transaction_id": {
          "format": "int32",
          "description": "The customer transaction ID for the service order (CRM tapahtuma id)",
          "type": "integer"
        },
        "campaign_id": {
          "format": "int32",
          "description": "The campaign ID for the service order (kohderyhmä)",
          "type": "integer"
        },
        "transaction_type": {
          "format": "int32",
          "description": "The crm event type for the service order (tapahtumatyyppi)",
          "type": "integer"
        },
        "service_planned_hours": {
          "format": "double",
          "description": "The planned hours for the service order (muut tiedot - työaika)",
          "type": "number"
        },
        "mark_code": {
          "format": "int32",
          "description": "The mark code for the service order (merkki). This is a free text field",
          "type": "integer"
        },
        "instructions": {
          "description": "The instruction for the service order (huolto-ohje)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ServiceOrderInstruction"
          }
        },
        "delivery_info": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryInfo",
          "description": "The delivery information for the sales order (toimitustiedot)"
        },
        "service_persons": {
          "description": "The persons who ordered the service order (tekijä)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ServiceOrderPerson"
          }
        },
        "links": {
          "description": "The links for the order (linkit)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
          }
        },
        "invoice_from_project": {
          "description": "The invoice from project (laskutus maksuposteilla). True if the invoice is from a project, false if not",
          "type": "boolean"
        },
        "triangulation_transaction": {
          "description": "The triangulation trade (kolmikantakauppa intrastat). True if the trade is triangulation, false if not",
          "type": "boolean"
        },
        "customerdata_from_payload": {
          "description": "If set to false, the system retrieves customer data from the customer registry for the sales order \r\nand ignores the payload data provided in the request.\r\n            \r\nThe following properties determine which customer data is retrieved from the customer registry:\r\n- customer_number: The invoicing customer's properties are set (e.g., customer_name, customer_address).\r\n- delivery_customer_number: The delivery customer's properties are set (e.g., delivery_customer_address, delivery_customer_contact_email)\r\n- consignee_customer_number: The consignee customer's properties are set (e.g., consignee_customer_address, consignee_customer_address3)\r\n- orderer_customer_number: The orderer customer's properties are set (e.g., orderer_customer_name, consignee_customer_address)",
          "type": "boolean"
        },
        "online_url": {
          "description": "Internal property for lemonsoft integrations",
          "type": "string"
        },
        "driver": {
          "format": "int32",
          "description": "The driver number for sales order (kuljettaja). For possible values and descriptions, see /api/codelist/description?filter.codeListFilter=DRIVERS. The driver's value corresponds to the ID returned by /api/codelist/description?filter.codeListFilter=DRIVERS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "driver_info": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.DriverInfo",
          "description": "Driver information for the sales order (kuljettajan tiedot)"
        },
        "company_location_id": {
          "format": "int32",
          "description": "THe company location ID for the sales order (toimipaikka). For possible values and descriptions, see /api/settings/companylocations. The company location's value corresponds to the ID returned by /api/settings/companylocations\r\n[here](#tag/Settings/operation/Settings_GetCompanyLocationList)",
          "type": "integer"
        },
        "packlist_bit": {
          "description": "Indicates whether the picking list has been printed for the sales order (keräyslähete tulostettu)",
          "type": "boolean"
        },
        "shipping_cost_products": {
          "description": "Shipping cost products for delivery",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ShippingCostProduct"
          }
        },
        "external_id": {
          "description": "Order ID in the external source system",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ServiceProduct": {
      "description": "The service product in the sales order",
      "type": "object",
      "properties": {
        "product_id": {
          "format": "int32",
          "description": "The id of the service product",
          "type": "integer"
        },
        "service_id": {
          "format": "int32",
          "description": "The service id",
          "type": "integer"
        },
        "agreementproduct_id": {
          "format": "int32",
          "description": "The id of the related product agreement",
          "type": "integer"
        },
        "product_agreement_number": {
          "format": "int32",
          "description": "The product agreement number for the service product",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code for the service product",
          "type": "string"
        },
        "product_description": {
          "description": "The service product description",
          "type": "string"
        },
        "product_description2": {
          "description": "Extra description field for the service product",
          "type": "string"
        },
        "product_serialnumber": {
          "description": "Service product serial number",
          "type": "string"
        },
        "product_location": {
          "description": "The location of the service product",
          "type": "string"
        },
        "product_mark_code": {
          "format": "int32",
          "description": "The mark/brand code for the service product",
          "type": "integer"
        },
        "product_completed": {
          "description": "Indicates if the service product's work is completed",
          "type": "boolean"
        },
        "product_workhours": {
          "format": "double",
          "description": "The amount of hours spend on the service",
          "type": "number"
        },
        "product_notes": {
          "description": "The notes for the service product",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ServiceOrderInstruction": {
      "description": "The service order instruction model",
      "required": [
        "order_id",
        "instruction_id",
        "instruction_phase_id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The internal id of the service order instruction",
          "type": "integer"
        },
        "order_id": {
          "format": "int32",
          "description": "The id of the service order the instruction is part of",
          "type": "integer"
        },
        "instruction_id": {
          "format": "int32",
          "description": "The instruction id",
          "type": "integer"
        },
        "instruction_description": {
          "description": "The instruction description",
          "type": "string"
        },
        "instruction_phase_id": {
          "format": "int32",
          "description": "The phase/order of the instruction. This is represented in the user interface as ID",
          "type": "integer"
        },
        "instruction_phase_header": {
          "description": "The phase's header description",
          "type": "string"
        },
        "instruction_phase_description": {
          "description": "The instruction's description",
          "type": "string"
        },
        "instruction_todo_description": {
          "description": "The TODO description for the instruction. This is free text field",
          "type": "string"
        },
        "is_instruction": {
          "description": "Additional boolean field for the instruction (kyllä/ei)",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.OrderDeliveryInfo": {
      "description": "The deliveryinfo for sales order (toimitustiedot)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the sales order delivery info",
          "type": "integer"
        },
        "packages": {
          "format": "int32",
          "description": "The amount of shipment units for the delivery (kollit)",
          "type": "integer"
        },
        "weight": {
          "format": "double",
          "description": "The weight of the delivery (bruttopaino)",
          "type": "number"
        },
        "m2": {
          "format": "double",
          "description": "The area of the delivery in square meters (neliöt)",
          "type": "number"
        },
        "m3": {
          "format": "double",
          "description": "The volume of the delivery in cubic meters (kuutiot)",
          "type": "number"
        },
        "pallets": {
          "format": "double",
          "description": "The area of pallets for the delivery (lavametrit)",
          "type": "number"
        },
        "delivery_method": {
          "format": "int32",
          "description": "The delivery method for the sales order delivery info (toimitustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_METHODS. The delivery method's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "description": {
          "description": "The description for the sales order delivery info (sisältö)",
          "type": "string"
        },
        "consignment": {
          "description": "The consignment number for the delivery (rahtikirja)",
          "type": "string"
        },
        "departure": {
          "description": "The departure location of the delivery (lähtöpaikka)",
          "type": "string"
        },
        "deliveryinfo_date": {
          "format": "date-time",
          "description": "The date and time when the delivery info was created (toimituspäivä)",
          "type": "string"
        },
        "instructions": {
          "description": "The instructions for the delivery (kuljetusohjeet)",
          "type": "string"
        },
        "forwarder": {
          "description": "The forwarder for the delivery (huolitsija)",
          "type": "string"
        },
        "info1": {
          "description": "Additional information for the delivery (muut tiedot)",
          "type": "string"
        },
        "info2": {
          "description": "The second additional information for the delivery (varauma)",
          "type": "string"
        },
        "destination": {
          "description": "The destination location of the delivery (määräpaikka)",
          "type": "string"
        },
        "package_type": {
          "description": "The type of the shipment unit (kollilaji). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERYPACKAGE_TYPES. The package type's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "can_invoice_date": {
          "format": "date-time",
          "description": "The date and time when the delivery can be invoiced (laskutuslupa)",
          "type": "string"
        },
        "outer_delivery_id": {
          "description": "The code for the outer delivery",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ServiceOrderPerson": {
      "description": "",
      "type": "object",
      "properties": {
        "service_order_person_id": {
          "format": "int32",
          "description": "The id of the service order person",
          "type": "integer"
        },
        "service_id": {
          "format": "int32",
          "description": "The id of the service order the person is part of",
          "type": "integer"
        },
        "service_order_person_number": {
          "format": "int32",
          "description": "The person's number",
          "type": "integer"
        },
        "service_order_person_state": {
          "format": "int32",
          "description": "The state of the person on the service order",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.DriverInfo": {
      "description": "The driver's information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "Unique identifier for the driver",
          "type": "integer"
        },
        "code": {
          "format": "int32",
          "description": "Internal code for the driver",
          "type": "integer"
        },
        "description": {
          "description": "A description for the driver",
          "type": "string"
        },
        "phone": {
          "description": "The driver's phone number",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ShippingCostProduct": {
      "description": "The shipping cost product in the sales order delivery",
      "type": "object",
      "properties": {
        "product_code": {
          "description": "Product code of the shipping cost product",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "Amount of the shipping cost product",
          "type": "number"
        },
        "unit_price": {
          "format": "double",
          "description": "Unit price of the shipping cost product",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.SalesOrderDeliveryInfoFull]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderDeliveryInfoFull"
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderDeliveryInfoFull": {
      "description": "The deliveryinfo for sales order (toimitustiedot)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the sales order delivery info",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The date and time when the delivery info was created (toimituspäivä)",
          "type": "string"
        },
        "method": {
          "format": "int32",
          "description": "The delivery method for the sales order delivery info (toimitustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_METHODS. The delivery method's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "description": {
          "description": "The description for the sales order delivery info (sisältö)",
          "type": "string"
        },
        "consignment": {
          "description": "The consignment number for the delivery (rahtikirja)",
          "type": "string"
        },
        "departure": {
          "description": "The departure location of the delivery (lähtöpaikka)",
          "type": "string"
        },
        "destination": {
          "description": "The destination location of the delivery (määräpaikka)",
          "type": "string"
        },
        "forwarder": {
          "description": "The forwarder for the delivery (huolitsija)",
          "type": "string"
        },
        "instructions": {
          "description": "The instructions for the delivery (kuljetusohjeet)",
          "type": "string"
        },
        "info1": {
          "description": "Additional information for the delivery (muut tiedot)",
          "type": "string"
        },
        "info2": {
          "description": "The second additional information for the delivery (varauma)",
          "type": "string"
        },
        "packages": {
          "format": "int32",
          "description": "The amount of shipment units for the delivery (kollit)",
          "type": "integer"
        },
        "weight": {
          "format": "double",
          "description": "The weight of the delivery (bruttopaino)",
          "type": "number"
        },
        "m3": {
          "format": "double",
          "description": "The volume of the delivery in cubic meters (kuutiot)",
          "type": "number"
        },
        "m2": {
          "format": "double",
          "description": "The area of the delivery in square meters (neliöt)",
          "type": "number"
        },
        "pallets": {
          "format": "double",
          "description": "The area of pallets for the delivery (lavametrit)",
          "type": "number"
        },
        "can_invoice_date": {
          "format": "date-time",
          "description": "The date and time when the delivery can be invoiced (laskutuslupa)",
          "type": "string"
        },
        "transfered": {
          "description": "Indicates if the delivery has been transferred",
          "type": "boolean"
        },
        "package_type": {
          "description": "The type of the shipment unit (kollilaji). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERYPACKAGE_TYPES. The package type's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "transfered_ext_stock": {
          "description": "Indicates if the delivery has been transferred to external stock",
          "type": "boolean"
        },
        "outer_delivery_id": {
          "description": "The code for the outer delivery",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[System.Collections.Generic.List[LemonRest.Models.Proxy.SalesOrderDeliveryInfoFull]]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderDeliveryInfoFull"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.OrderPreDeliveryInfo": {
      "description": "The predelivery info for the delivery",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the predelivery info",
          "type": "integer"
        },
        "order_id": {
          "format": "int32",
          "description": "The id of the order the predelivery info is part of",
          "type": "integer"
        },
        "method_id": {
          "format": "int32",
          "description": "The delivery method for the sales order delivery info (toimitustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_METHODS. The delivery method's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "description": {
          "description": "The description for the sales order delivery info (sisältö)",
          "type": "string"
        },
        "forwarder": {
          "description": "The forwarder for the delivery (huolitsija)",
          "type": "string"
        },
        "instructions": {
          "description": "The instructions for the delivery (kuljetusohjeet)",
          "type": "string"
        },
        "departure": {
          "description": "The departure location of the delivery (lähtöpaikka)",
          "type": "string"
        },
        "destination": {
          "description": "The destination location of the delivery (määräpaikka)",
          "type": "string"
        },
        "departure_door": {
          "description": "The departure door for the delivery (nouto ovi)",
          "type": "string"
        },
        "destination_door": {
          "description": "The destination door for the delivery (kohde ovi)",
          "type": "string"
        },
        "info1": {
          "description": "Additional information for the delivery (muut tiedot)",
          "type": "string"
        },
        "info2": {
          "description": "The second additional information for the delivery (varauma)",
          "type": "string"
        },
        "packages": {
          "format": "int32",
          "description": "The amount of shipment units for the delivery (kollit)",
          "type": "integer"
        },
        "weight": {
          "format": "double",
          "description": "The weight of the delivery (bruttopaino)",
          "type": "number"
        },
        "m3": {
          "format": "double",
          "description": "The volume of the delivery in cubic meters (kuutiot)",
          "type": "number"
        },
        "m2": {
          "format": "double",
          "description": "The area of the delivery in square meters (neliöt)",
          "type": "number"
        },
        "pallets": {
          "format": "double",
          "description": "The area of pallets for the delivery (lavametrit)",
          "type": "number"
        },
        "noconsigment_number": {
          "description": "Indicates if the delivery doesn't have a consignment number (ei rahtikirjanumeroa)",
          "type": "boolean"
        },
        "route": {
          "description": "The route for the delivery (reitti)",
          "type": "string"
        },
        "delivery_packages": {
          "description": "The descriptions for the delivery packages in the delivery (kollilajit)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PreDeliveryInfoPackage"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PreDeliveryInfoPackage": {
      "description": "The descriptions for the delivery package in the delivery (kollilajit)",
      "type": "object",
      "properties": {
        "package_code": {
          "description": "The unit of the shipment (kollilaji). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERYPACKAGE_TYPES. The package type's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "description": {
          "description": "The description for the package (sisältö)",
          "type": "string"
        },
        "weight": {
          "format": "double",
          "description": "The weight of the delivery (bruttopaino)",
          "type": "number"
        },
        "m3": {
          "format": "double",
          "description": "The volume of the delivery in cubic meters (kuutiot)",
          "type": "number"
        },
        "m2": {
          "format": "double",
          "description": "The area of the delivery in square meters (neliöt)",
          "type": "number"
        },
        "pallets": {
          "format": "double",
          "description": "The area of pallets for the delivery (lavametrit)",
          "type": "number"
        },
        "packages": {
          "format": "int32",
          "description": "The amount of shipment units for the delivery (kollien lkm)",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[System.Int32]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.StatusResponse": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "status": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderPreInvoicingInfo": {
      "description": "Sales order preinvoicing information",
      "type": "object",
      "properties": {
        "percent": {
          "format": "double",
          "description": "%-amount of preinvoicing, 0 = get from preinvoicing product",
          "type": "number"
        },
        "description": {
          "description": "Preinvoicing product description, empty = get from preinvoicing product",
          "type": "string"
        },
        "note": {
          "description": "Rowtext for preinvoice",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderPreInvoicingCreateInfo": {
      "description": "Sales order preinvoicing creation information",
      "type": "object",
      "properties": {
        "percent": {
          "format": "double",
          "description": "%-amount of preinvoicing. Must be greater than 0",
          "maximum": 100,
          "type": "number"
        },
        "description": {
          "description": "Preinvoicing product description, empty = get from preinvoicing product",
          "type": "string"
        },
        "note": {
          "description": "Rowtext for preinvoice",
          "type": "string"
        },
        "invoiced": {
          "description": "Indicates whether the preinvoice should be immediately invoiced",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.SalesOrder]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrder"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.SalesOrderRow]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRow"
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderRowChange": {
      "description": "The model for sales order row change",
      "type": "object",
      "properties": {
        "changed_property_name": {
          "description": "This property's value must correspond to the edited property's name in the SalesOrderRow model",
          "type": "string"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number sets the customer for the sales order. If 0, the customer is not altered",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The type of the sales order",
          "type": "integer"
        },
        "language": {
          "description": "The language for the sales order. For possible values, refer to /api/settings/languages code property",
          "type": "string"
        },
        "taxtype_bit": {
          "description": "Indicates whether the order's prices include VAT (ALV, hinnat sisältävät arvolisäveron)",
          "type": "boolean"
        },
        "project_number": {
          "format": "int32",
          "description": "Sets project number for the sales order. If 0, the project number is not altered",
          "type": "integer"
        },
        "pricelist_date": {
          "format": "date-time",
          "description": "The price list date for the sales order. If null or min value, the price list date is not altered",
          "type": "string"
        },
        "edited_row": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRow",
          "description": "The contents of the edited row"
        },
        "previous_row": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRow",
          "description": "The contents of the previous row"
        },
        "package_amount": {
          "format": "double",
          "description": "Amount for package product handling. Leave empty or set 0 if not package product.",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesOrderRow]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRow"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderRowChangeBatch": {
      "description": "Request model for batch row processing.\r\nCommon fields are defined once at batch level.",
      "type": "object",
      "properties": {
        "customer_number": {
          "format": "int32",
          "description": "The customer number sets the customer for the sales order. If 0, the customer is not altered",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The type of the sales order",
          "type": "integer"
        },
        "language": {
          "description": "The language for the sales order. For possible values, refer to /api/settings/languages code property",
          "type": "string"
        },
        "taxtype_bit": {
          "description": "Indicates whether the order's prices include VAT",
          "type": "boolean"
        },
        "project_number": {
          "format": "int32",
          "description": "Sets project number for the sales order. If 0, the project number is not altered",
          "type": "integer"
        },
        "pricelist_date": {
          "format": "date-time",
          "description": "The price list date for the sales order. If null or min value, the price list date is not altered",
          "type": "string"
        },
        "previous_row": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRow",
          "description": "Optional previous row context for the first row (e.g. last existing order row for position calculation)"
        },
        "changed_property_name": {
          "description": "This property's value must correspond to the edited property's name in the SalesOrderRow model",
          "type": "string"
        },
        "rows": {
          "description": "List of rows to process",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRowChangeItem"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderRowChangeItem": {
      "description": "Single row item in batch request. Contains only row-specific fields.",
      "type": "object",
      "properties": {
        "edited_row": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderRow",
          "description": "The contents of the edited row"
        },
        "package_amount": {
          "format": "double",
          "description": "Amount for package product handling. Leave empty or set 0 if not package product.",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ServiceInstructionFilter": {
      "type": "object",
      "properties": {
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ServiceInstruction]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ServiceInstruction"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ServiceInstruction": {
      "description": "The service instruction model",
      "type": "object",
      "properties": {
        "service_instruction_id": {
          "format": "int32",
          "description": "The service instruction id",
          "type": "integer"
        },
        "service_instruction_description": {
          "description": "The service instruction's description",
          "type": "string"
        },
        "service_instruction_type": {
          "format": "int32",
          "description": "The service instruction's type",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderInvoicingParty": {
      "description": "The invoicing party model for sales order",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the invoicing party",
          "type": "integer"
        },
        "order_id": {
          "format": "int32",
          "description": "The id of the sales order the invoicing party is part of",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number for the invoicing party (laskutus)",
          "type": "integer"
        },
        "customer_name1": {
          "description": "The customer name for the invoicing party (nimi)",
          "type": "string"
        },
        "customer_name2": {
          "description": "Extra name field for the customer name",
          "type": "string"
        },
        "customer_address1": {
          "description": "The local address for the invoicing party (lähiosoite)",
          "type": "string"
        },
        "customer_address2": {
          "description": "Extra address field for the customer address",
          "type": "string"
        },
        "customer_address3": {
          "description": "The address for the invoicing party (osoite)",
          "type": "string"
        },
        "customer_country": {
          "description": "The invoicing party's country",
          "type": "string"
        },
        "customer_contact": {
          "description": "The contact person for the invoicing party (yhteyshenkilö)",
          "type": "string"
        },
        "customer_contact_phone": {
          "description": "The phone number for the invoicing party",
          "type": "string"
        },
        "customer_contact_email": {
          "description": "The email address for the invoicing party",
          "type": "string"
        },
        "allocation": {
          "format": "int32",
          "description": "The invoicing party's billing portion (laskutusosuus)",
          "type": "integer"
        },
        "roles": {
          "description": "The roles for the invoicing party",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderInvoicingPartyRole"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderInvoicingPartyRole": {
      "description": "The invoicing party role model for sales order",
      "type": "object",
      "properties": {
        "role_id": {
          "format": "int32",
          "description": "The id of the role",
          "type": "integer"
        },
        "invoicing_party_id": {
          "format": "int32",
          "description": "The id of the invoicing party the role is part of",
          "type": "integer"
        },
        "role": {
          "format": "int32",
          "description": "The role number",
          "type": "integer"
        },
        "description": {
          "description": "The description for the role",
          "type": "string"
        },
        "IsChecked": {
          "description": "Indicates if the role has been selected for the invoicing party",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesOrderInvoicingParty]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderInvoicingParty"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.OrderDeliveryPallet]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryPallet"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.OrderDeliveryPallet": {
      "description": "Delivery pallet model",
      "type": "object",
      "properties": {
        "order_delivery_pallet_id": {
          "format": "int32",
          "description": "The id of the delivery pallet. Not to be confused with the pallet_id",
          "type": "integer"
        },
        "order_id": {
          "format": "int32",
          "description": "The id of the order the delivery pallet is part of",
          "type": "integer"
        },
        "order_delivery_pallet_code": {
          "description": "The delivery pallet identifier",
          "type": "string"
        },
        "order_delivery_pallet_serial": {
          "description": "The serial number for the delivery pallet",
          "type": "string"
        },
        "order_delivery_package_code": {
          "description": "The type of the shipment unit (kollilaji). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERYPACKAGE_TYPES. The package type's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "order_delivery_pallet_weight": {
          "format": "double",
          "description": "The weight of the delivery pallet (paino)",
          "type": "number"
        },
        "order_delivery_pallet_volyme": {
          "format": "double",
          "description": "The volume of the delivery pallet (tilavuus)",
          "type": "number"
        },
        "order_delivery_pallet_package": {
          "format": "double",
          "description": "The amount of packages on the delivery pallet (kollit)",
          "type": "number"
        },
        "order_delivery_pallet_info": {
          "description": "The delivery pallet's description (lavan selite)",
          "type": "string"
        },
        "order_delivery_pallet_SSCC": {
          "description": "The delivery pallet's SSCC code (SSCC numerosarja)",
          "type": "string"
        },
        "pallet_number": {
          "format": "int32",
          "description": "The number of the pallet",
          "type": "integer"
        },
        "order_delivery_pallet_rows": {
          "description": "The rows for the delivery pallet. Describes the contents of the pallet",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryPalletRow"
          }
        },
        "pallet_id": {
          "format": "int32",
          "description": "Internal id of the pallet. Not to be confused with the order_delivery_pallet_id. This is not represented in the user interface",
          "type": "integer"
        },
        "order_delivery_pallet_father_id": {
          "format": "int32",
          "description": "The id of the parent pallet. Only set when the pallet is a child pallet",
          "type": "integer"
        },
        "order_delivery_calculate_stat": {
          "description": "If set to true, the system calculates the delivery pallet's properties based on the rows and shipment units. If false, the properties are not calculated and user provided values are used",
          "type": "boolean"
        },
        "delivery_pallet_view_name": {
          "description": "The name of the delivery pallet as presented in the user interface (275 - PAH - 1907)",
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock number for the pallet",
          "type": "integer"
        },
        "shelf": {
          "description": "The shelf code for the pallet",
          "type": "string"
        },
        "length": {
          "format": "int32",
          "description": "The length of the pallet",
          "type": "integer"
        },
        "width": {
          "format": "int32",
          "description": "The width of the pallet",
          "type": "integer"
        },
        "height": {
          "format": "int32",
          "description": "The height of the pallet",
          "type": "integer"
        },
        "sales_order_number": {
          "format": "int32",
          "description": "The sales order number for the pallet",
          "type": "integer"
        },
        "sales_order_description": {
          "description": "The description of the sales order",
          "type": "string"
        },
        "delivery_customer_number": {
          "format": "int32",
          "description": "The delivery customer number for the pallet",
          "type": "integer"
        },
        "delivery_customer_name": {
          "description": "The delivery customer name for the pallet",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.OrderDeliveryPalletRow": {
      "description": "The pallet row model for delivery pallet",
      "type": "object",
      "properties": {
        "pallet_row_id": {
          "format": "int32",
          "description": "The id of the pallet row",
          "type": "integer"
        },
        "pallet_id": {
          "format": "int32",
          "description": "The id of the pallet the row is part of",
          "type": "integer"
        },
        "pallet_row_code": {
          "description": "The product code for the pallet row",
          "type": "string"
        },
        "order_row_id": {
          "format": "int32",
          "description": "The order row id for the pallet row",
          "type": "integer"
        },
        "row_amount": {
          "format": "double",
          "description": "The amount of product for the pallet row",
          "type": "number"
        },
        "batch_id": {
          "format": "int32",
          "description": "The batch id related to the pallet row",
          "type": "integer"
        },
        "batch_supplier_code": {
          "description": "The batch supplier code for the pallet row",
          "type": "string"
        },
        "product_name": {
          "description": "The name of the product for the pallet row",
          "type": "string"
        },
        "shelf": {
          "description": "The shelf where the product was collected",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.OrderDeliveryPallet]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryPallet"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.OrderDeliveryPalletRow]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryPalletRow"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.StockTransactionSerialNumber]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionSerialNumber"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.StockTransactionSerialNumber": {
      "description": "Serial number information for a stock transaction",
      "type": "object",
      "properties": {
        "serialnr_id": {
          "format": "int32",
          "description": "The id of the serial number",
          "type": "integer"
        },
        "stock_transaction_id": {
          "format": "int32",
          "description": "The id of the stock transaction this serial number belongs to",
          "type": "integer"
        },
        "serialnr_product_code": {
          "description": "The product code for this serial number",
          "type": "string"
        },
        "serialnr_code": {
          "description": "The serial number code",
          "type": "string"
        },
        "serialnr_father_serial": {
          "description": "The parent serial number code",
          "type": "string"
        },
        "serialnr_description": {
          "description": "The description of the serial number",
          "type": "string"
        },
        "serialnr_state": {
          "format": "int32",
          "description": "The state of the serial number",
          "type": "integer"
        },
        "serialnr_stock_number": {
          "format": "int32",
          "description": "The stock number for this serial number",
          "type": "integer"
        },
        "serialnr_inventory_tmp": {
          "format": "int32",
          "description": "The temporary inventory count for this serial number",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[System.DateTime]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "format": "date-time",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.OrderDeliveyRowsFilter": {
      "type": "object",
      "properties": {
        "orderrow_id": {
          "format": "int32",
          "type": "integer"
        },
        "invoice_id": {
          "format": "int32",
          "type": "integer"
        },
        "order_number": {
          "format": "int32",
          "type": "integer"
        },
        "delivery_date_before": {
          "format": "date-time",
          "type": "string"
        },
        "delivery_date_after": {
          "format": "date-time",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "type": "number"
        },
        "stock_id": {
          "format": "int32",
          "type": "integer"
        },
        "deliveryinfo_id": {
          "format": "int32",
          "type": "integer"
        },
        "box": {
          "format": "int32",
          "type": "integer"
        },
        "sort_desc": {
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.SalesDeliveryRow]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesDeliveryRow"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.SalesDeliveryRow": {
      "description": "Delivery row for sales order",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the delivery row",
          "type": "integer"
        },
        "orderrow_id": {
          "format": "int32",
          "description": "The id of the sales order row",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The date and time for the delivery row",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount of product delivered",
          "type": "number"
        },
        "stock_id": {
          "format": "int32",
          "description": "The stock id for the delivery row",
          "type": "integer"
        },
        "invoice_id": {
          "format": "int32",
          "description": "The invoice id for the delivery row",
          "type": "integer"
        },
        "deliveryinfo_id": {
          "format": "int32",
          "description": "The delivery info id for the delivery row",
          "type": "integer"
        },
        "box": {
          "format": "int32",
          "description": "The box id for the delivery row",
          "type": "integer"
        },
        "stock_id_in": {
          "format": "int32",
          "description": "The stock id for the delivery row",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductStockPallet": {
      "description": "A product stock pallet (tuotevarastolava) — a logical container in the warehouse that holds one or more product rows and may contain child pallets",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique identifier of this product stock pallet",
          "type": "integer"
        },
        "code": {
          "description": "The pallet identifier code (lavakoodi)",
          "type": "string"
        },
        "serial": {
          "description": "The pallet's serial number",
          "type": "string"
        },
        "weight": {
          "format": "double",
          "description": "The total weight of the pallet (paino)",
          "type": "number"
        },
        "volyme": {
          "format": "double",
          "description": "The total volume of the pallet (tilavuus)",
          "type": "number"
        },
        "package": {
          "format": "double",
          "description": "The number of packages on the pallet (kollit)",
          "type": "number"
        },
        "info": {
          "description": "The pallet's description (lavan selite)",
          "type": "string"
        },
        "rows": {
          "description": "The rows on this pallet, describing each product and its amount",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStockPalletRow"
          }
        },
        "pallet_id": {
          "format": "int32",
          "description": "The shared pallet identifier (yhteis-lava-ID). Used to reference the pallet across related stock and delivery operations",
          "type": "integer"
        },
        "shelf": {
          "description": "The shelf code where the pallet is located (hylly). For possible values, refer to /api/codelist/description?filter.codeListFilter=PRODUCT_SHELF\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "stock": {
          "format": "int32",
          "description": "The stock (warehouse) number where the pallet is located (varasto). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "batch_suppliercode": {
          "description": "The batch supplier code of the pallet's contents (toimittajan eränumero)",
          "type": "string"
        },
        "father_id": {
          "format": "int32",
          "description": "The id of the parent pallet, when this pallet is a child of another pallet",
          "type": "integer"
        },
        "sscc": {
          "description": "The SSCC code of the pallet (Serial Shipping Container Code)",
          "type": "string"
        },
        "package_code": {
          "description": "The package type code for the pallet (pakkaustyyppi). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERYPACKAGE_TYPES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "calculate_stat": {
          "description": "When set to true, the pallet's weight, volume and package values are calculated automatically from the rows and child pallets. When false, the values supplied in the payload are used as-is",
          "type": "boolean"
        },
        "child_pallets": {
          "description": "Child pallets nested under this pallet. Used to represent multi-level pallet structures",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStockPallet"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductStockPalletRow": {
      "description": "A product row on a stock pallet, describing the product and its amount",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique identifier of the pallet row",
          "type": "integer"
        },
        "parent_id": {
          "format": "int32",
          "description": "The id of the pallet this row belongs to",
          "type": "integer"
        },
        "product_id": {
          "format": "int32",
          "description": "The internal product id",
          "type": "integer"
        },
        "stock_id": {
          "format": "int32",
          "description": "The id of the product stock (warehouse) entry for this row. For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "row_amount": {
          "format": "double",
          "description": "The amount of product on this row",
          "type": "number"
        },
        "unit": {
          "description": "The unit of measurement for the amount (e.g. kpl, kg, m)",
          "type": "string"
        },
        "product_code": {
          "description": "The product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "product_description": {
          "description": "The product's description as it appears on the row",
          "type": "string"
        },
        "weight": {
          "format": "double",
          "description": "The row's weight (paino)",
          "type": "number"
        },
        "packages": {
          "format": "double",
          "description": "The number of packages on this row (kollit)",
          "type": "number"
        },
        "volyme": {
          "format": "double",
          "description": "The volume of this row (tilavuus)",
          "type": "number"
        },
        "batch_id": {
          "format": "int32",
          "description": "The id of the existing stock transaction batch for this row, when the row references an existing batch",
          "type": "integer"
        },
        "batch_supplier_code": {
          "description": "The supplier batch code for the row (toimittajan eränumero)",
          "type": "string"
        },
        "batch_supplier_code_input": {
          "description": "New supplier batch code to register as part of this row's transaction. When set, the row creates a new batch entry instead of referencing batch_id",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PalletFilter": {
      "description": "Filter for querying product stock pallets without paging",
      "type": "object",
      "properties": {
        "product_code": {
          "description": "Filter pallets by product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "description": "Filter pallets by stock number (varastonumero). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "shelf": {
          "description": "Filter pallets by shelf code (hylly)",
          "type": "string"
        },
        "info": {
          "description": "Filter pallets by the info / description field",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductStockPallet]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStockPallet"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStockPallet]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStockPallet"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PalletInStockFilter": {
      "description": "Paging filter for in-stock pallet queries. Inherits page and page_size from PageFilter",
      "type": "object",
      "properties": {
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductStockPallet]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStockPallet"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.PagedPalletFilter": {
      "description": "Paged filter for querying product stock pallets. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "product_code": {
          "description": "Filter pallets by product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "description": "Filter pallets by their rows' stock number. Pallets without rows are excluded when this is set. For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "shelf": {
          "description": "Filter pallets by one or more shelf codes (hyllyt)",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "pallet_code": {
          "description": "Filter pallets by the pallet identifier code (lavakoodi)",
          "type": "string"
        },
        "info": {
          "description": "Filter pallets by the info / description field",
          "type": "string"
        },
        "batch_id": {
          "format": "int32",
          "description": "Filter pallets by the batch id of any row",
          "type": "integer"
        },
        "batchnr_suppliercode": {
          "description": "Filter pallets by the supplier batch code (toimittajan eränumero) of any row",
          "type": "string"
        },
        "sort_desc": {
          "description": "Sort order by pallet id. False (default) sorts ascending; true sorts descending",
          "type": "boolean"
        },
        "serial": {
          "description": "Filter pallets by serial number (substring match)",
          "type": "string"
        },
        "pallet_stock": {
          "description": "Filter pallets by one or more pallet stock numbers (the pallet-level stock, not the row stock). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PersonFilter": {
      "description": "Filter for querying persons. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "created_before": {
          "format": "date-time",
          "description": "Filter persons created on or before this date",
          "type": "string"
        },
        "created_after": {
          "format": "date-time",
          "description": "Filter persons created on or after this date",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Filter persons whose updated_at is on or before this date",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "description": "Filter persons whose updated_at is on or after this date",
          "type": "string"
        },
        "role": {
          "format": "int32",
          "description": "Filter persons by role / attribute code",
          "type": "integer"
        },
        "costcenter": {
          "description": "Filter persons by their payroll cost center code (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "hide_models": {
          "description": "When true, model persons (non-real placeholder rows used in workshift planning) are excluded",
          "type": "boolean"
        },
        "number": {
          "format": "int32",
          "description": "Filter by person number (exact match)",
          "type": "integer"
        },
        "numbers": {
          "description": "Filter by person numbers. Accepts a list of person numbers",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "only_lemonsoft_users": {
          "description": "When true, only persons that are Lemonsoft users are returned",
          "type": "boolean"
        },
        "only_employees": {
          "description": "When true, only persons flagged as employees are returned",
          "type": "boolean"
        },
        "person_code": {
          "description": "Filter persons by any of their identifier codes (e.g. RFID code)",
          "type": "string"
        },
        "sort_desc": {
          "description": "Sorting order by id. Default is ascending (false).",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Person]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Person"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Person": {
      "description": "Full person model with employment, payroll and contact information (henkilö)",
      "type": "object",
      "properties": {
        "currency_code": {
          "description": "The person's preferred currency code (valuuttakoodi). For possible values, refer to /api/settings/currency/{code}\r\n[here](#tag/Settings/operation/Settings_GetCurrency)",
          "default": "EUR",
          "type": "string"
        },
        "images": {
          "description": "Profile images attached to the person",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Image"
          }
        },
        "codes": {
          "description": "Free-form identifier codes attached to the person (e.g. RFID, key codes)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PersonCode"
          }
        },
        "form_of_salaries": {
          "description": "The forms of salary (palkkalajit) assigned to the person",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PersonFormOfSalary"
          }
        },
        "help_figures": {
          "description": "Help figures used in payroll calculations (apuluvut)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PersonHelpFigure"
          }
        },
        "address1": {
          "description": "The person's primary street address",
          "type": "string"
        },
        "address2": {
          "description": "The person's secondary address line",
          "type": "string"
        },
        "city": {
          "description": "The person's city",
          "type": "string"
        },
        "country": {
          "description": "The person's country code. For possible values, refer to /api/codelist/description?filter.codeListFilter=COUNTRIES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number this person is linked to (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "department": {
          "format": "int32",
          "description": "The person's department (osasto)",
          "type": "integer"
        },
        "domain": {
          "description": "The person's Active Directory domain",
          "type": "string"
        },
        "is_employee": {
          "description": "Indicates whether the person is an employee of the company",
          "type": "boolean"
        },
        "fax": {
          "description": "The person's fax number",
          "type": "string"
        },
        "group": {
          "format": "int32",
          "description": "The person's group / team membership",
          "type": "integer"
        },
        "homephone": {
          "description": "The person's home phone number",
          "type": "string"
        },
        "is_lemonuser": {
          "description": "Indicates whether the person is a Lemonsoft user (can log in)",
          "type": "boolean"
        },
        "payroll_accidentins_number": {
          "format": "int32",
          "description": "Payroll: accident insurance number (tapaturmavakuutuksen numero)",
          "type": "integer"
        },
        "payroll_accidentins_percent": {
          "format": "double",
          "description": "Payroll: accident insurance percentage",
          "type": "number"
        },
        "payroll_accountname": {
          "description": "Payroll: bank account holder name",
          "type": "string"
        },
        "payroll_accountnumber": {
          "description": "Payroll: bank account number / IBAN",
          "type": "string"
        },
        "payroll_ahp": {
          "format": "double",
          "description": "Payroll: accrued holiday compensation (AHP)",
          "type": "number"
        },
        "payroll_ahp_date": {
          "format": "date-time",
          "description": "Payroll: AHP calculation reference date",
          "type": "string"
        },
        "payroll_ahp_holiday": {
          "format": "double",
          "description": "Payroll: AHP holiday days",
          "type": "number"
        },
        "payroll_ahp_holidayhours": {
          "format": "double",
          "description": "Payroll: AHP holiday hours",
          "type": "number"
        },
        "payroll_ahp_holidaysum": {
          "format": "double",
          "description": "Payroll: AHP holiday compensation sum",
          "type": "number"
        },
        "payroll_ahp_hours": {
          "format": "double",
          "description": "Payroll: AHP working hours",
          "type": "number"
        },
        "payroll_ahp_sum": {
          "format": "double",
          "description": "Payroll: AHP total sum",
          "type": "number"
        },
        "payroll_ahpholiday_date": {
          "format": "date-time",
          "description": "Payroll: AHP holiday reference date",
          "type": "string"
        },
        "payroll_carbenefit_agegroup": {
          "description": "Payroll: car benefit age group code (autoetu ikäryhmä)",
          "type": "string"
        },
        "is_payroll_carbenefit": {
          "description": "Indicates whether the person has a car benefit (autoetu)",
          "type": "boolean"
        },
        "payroll_costcenter": {
          "description": "Payroll: cost center code (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "payroll_earnings": {
          "format": "double",
          "description": "Payroll: year-to-date earnings",
          "type": "number"
        },
        "payroll_enddate": {
          "format": "date-time",
          "description": "Payroll: employment end date",
          "type": "string"
        },
        "payroll_holidayfactors_id": {
          "format": "int32",
          "description": "Payroll: id of the holiday-factor configuration row",
          "type": "integer"
        },
        "payroll_important": {
          "description": "Payroll: free-text important payroll notes",
          "type": "string"
        },
        "payroll_info": {
          "description": "Payroll: free-text general payroll info",
          "type": "string"
        },
        "payroll_limit1": {
          "format": "double",
          "description": "Payroll: salary calculation limit 1",
          "type": "number"
        },
        "payroll_limit2": {
          "format": "double",
          "description": "Payroll: salary calculation limit 2",
          "type": "number"
        },
        "payroll_limit3": {
          "format": "double",
          "description": "Payroll: salary calculation limit 3",
          "type": "number"
        },
        "is_payroll_limitedcarbenefit": {
          "description": "Indicates whether the person has a limited car benefit (rajoitettu autoetu)",
          "type": "boolean"
        },
        "payroll_payment_interval_id": {
          "format": "int32",
          "description": "Payroll: payment interval configuration id",
          "type": "integer"
        },
        "payroll_payslip_group_number": {
          "format": "int32",
          "description": "Payroll: payslip group number",
          "type": "integer"
        },
        "payroll_pensionins_id": {
          "format": "int32",
          "description": "Payroll: pension insurance configuration id (TyEL)",
          "type": "integer"
        },
        "payroll_pensionins_percent": {
          "format": "double",
          "description": "Payroll: pension insurance percentage",
          "type": "number"
        },
        "payroll_percent1": {
          "format": "double",
          "description": "Payroll: percentage 1 used by salary calculation",
          "type": "number"
        },
        "payroll_percent2": {
          "format": "double",
          "description": "Payroll: percentage 2 used by salary calculation",
          "type": "number"
        },
        "payroll_percent3": {
          "format": "double",
          "description": "Payroll: percentage 3 used by salary calculation",
          "type": "number"
        },
        "payroll_percent4": {
          "format": "double",
          "description": "Payroll: percentage 4 used by salary calculation",
          "type": "number"
        },
        "payroll_perdiempaym_percent": {
          "format": "double",
          "description": "Payroll: per-diem payment percentage",
          "type": "number"
        },
        "payroll_postinggroup_id": {
          "format": "int32",
          "description": "Payroll: posting group id (kirjausryhmä)",
          "type": "integer"
        },
        "payroll_project": {
          "description": "Payroll: project number for default posting (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "string"
        },
        "payroll_sendtype": {
          "format": "int32",
          "description": "Payroll: send type code (payslip delivery method)",
          "type": "integer"
        },
        "payroll_sicknessins_percent": {
          "format": "double",
          "description": "Payroll: sickness insurance percentage",
          "type": "number"
        },
        "is_payroll_sideline": {
          "description": "Indicates the person has a secondary (sideline) employment (sivutoimi)",
          "type": "boolean"
        },
        "payroll_startdate": {
          "format": "date-time",
          "description": "Payroll: employment start date",
          "type": "string"
        },
        "payroll_stat_group": {
          "format": "int32",
          "description": "Payroll: statistical group code",
          "type": "integer"
        },
        "payroll_taxcard_startdate": {
          "format": "date-time",
          "description": "Payroll: tax card start date",
          "type": "string"
        },
        "payroll_taxmethod": {
          "format": "int32",
          "description": "Payroll: tax method code",
          "type": "integer"
        },
        "payroll_tvr": {
          "format": "int32",
          "description": "Payroll: TVR (Työllisyysrahasto) configuration code",
          "type": "integer"
        },
        "payroll_unemploymentins_id": {
          "format": "int32",
          "description": "Payroll: unemployment insurance configuration id",
          "type": "integer"
        },
        "payroll_union_id": {
          "format": "int32",
          "description": "Payroll: trade union configuration id",
          "type": "integer"
        },
        "payroll_vacationdays": {
          "format": "double",
          "description": "Payroll: vacation days balance",
          "type": "number"
        },
        "postal_code": {
          "description": "The person's postal code",
          "type": "string"
        },
        "profession": {
          "format": "int32",
          "description": "The person's profession code (ammatti)",
          "type": "integer"
        },
        "sex": {
          "format": "int32",
          "description": "Sex code (0 = unspecified, 1 = male, 2 = female)",
          "type": "integer"
        },
        "vat": {
          "description": "The person's VAT / national ID",
          "type": "string"
        },
        "work_phone": {
          "description": "The person's work phone number",
          "type": "string"
        },
        "workshift": {
          "format": "int32",
          "description": "The person's default work shift id (työvuoro)",
          "type": "integer"
        },
        "worktime_regulation": {
          "format": "int32",
          "description": "The person's worktime regulation id (työaikasääntö)",
          "type": "integer"
        },
        "kellokortti_user_state": {
          "format": "int32",
          "description": "Kellokortti 2.0 user state (0 = not a Kellokortti user, 1 = active). Null leaves the current value\r\nunchanged on update.",
          "type": "integer"
        },
        "person_timezone": {
          "description": "The person's IANA time zone identifier (used by Kellokortti 2.0). Null leaves the current value\r\nunchanged on update.",
          "type": "string"
        },
        "person_time_counter_start_date": {
          "format": "date-time",
          "description": "The date from which the person's time counters start accumulating (Kellokortti 2.0). Null leaves the\r\ncurrent value unchanged on update.",
          "type": "string"
        },
        "person_default_event_type": {
          "format": "int32",
          "description": "The person's default Kellokortti 2.0 entry type (kirjauslaji). Null leaves the current value unchanged\r\non update.",
          "type": "integer"
        },
        "modified_date": {
          "format": "date-time",
          "description": "The timestamp when the person record was last modified",
          "type": "string"
        },
        "contact_password": {
          "description": "Password for contact-only access (used when the person is not a Lemonsoft user)",
          "type": "string"
        },
        "person_password": {
          "description": "The person's Lemonsoft login password",
          "type": "string"
        },
        "supervisor": {
          "format": "int32",
          "description": "The person number of this person's supervisor (esimies)",
          "type": "integer"
        },
        "send_email": {
          "description": "When true, the person receives email notifications",
          "type": "boolean"
        },
        "send_internal_msg": {
          "description": "When true, the person receives internal Lemonsoft messages",
          "type": "boolean"
        },
        "send_sms": {
          "description": "When true, the person receives SMS notifications",
          "type": "boolean"
        },
        "id": {
          "format": "int32",
          "description": "The unique internal id of the person",
          "type": "integer"
        },
        "language_code": {
          "description": "The person's UI language (kielikoodi). For possible values, refer to /api/settings/languages\r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
          "default": "FIN",
          "type": "string"
        },
        "attributes": {
          "description": "Role / classification attributes assigned to this person",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PersonAttribute"
          }
        },
        "email": {
          "description": "The person's e-mail address",
          "type": "string"
        },
        "gsm": {
          "description": "The person's mobile phone number (gsm)",
          "type": "string"
        },
        "name": {
          "description": "The person's display name",
          "type": "string"
        },
        "number": {
          "format": "int32",
          "description": "The person's number (henkilönumero)",
          "type": "integer"
        },
        "office": {
          "format": "int32",
          "description": "The company location id (toimipaikka). For possible values, refer to /api/settings/companylocations\r\n[here](#tag/Settings/operation/Settings_GetCompanyLocations)",
          "type": "integer"
        },
        "short_name": {
          "description": "Short / abbreviated name for the person",
          "type": "string"
        },
        "username": {
          "description": "The person's Lemonsoft login username (only set for Lemonsoft users)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.Image": {
      "type": "object",
      "properties": {
        "data_id": {
          "format": "int32",
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "bytes": {
          "format": "byte",
          "default": "",
          "type": "string"
        },
        "object_id": {
          "format": "int32",
          "type": "integer"
        },
        "prefix": {
          "type": "string"
        },
        "type": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.PersonCode": {
      "description": "A simple identifier code attached to a person — e.g. RFID, access code (henkilön koodi)",
      "type": "object",
      "properties": {
        "name": {
          "description": "The code value",
          "type": "string"
        },
        "id": {
          "format": "int32",
          "description": "The unique id of the code entry",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.PersonFormOfSalary": {
      "description": "A form of salary (palkkalaji) assignment for a person",
      "type": "object",
      "properties": {
        "account": {
          "description": "The default accounting account for this form of salary",
          "type": "string"
        },
        "atpriceformula": {
          "description": "The \"@\" pricing formula expression",
          "type": "string"
        },
        "costcenter": {
          "description": "The default cost center for this form of salary (kustannuspaikka)",
          "type": "string"
        },
        "date": {
          "format": "date-time",
          "description": "The validity start date of this assignment",
          "type": "string"
        },
        "id": {
          "format": "int32",
          "description": "The unique id of the assignment row",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The form of salary number (palkkalajinumero)",
          "type": "integer"
        },
        "piecesformula": {
          "description": "The pieces / quantity pricing formula expression",
          "type": "string"
        },
        "project": {
          "description": "The default project for this form of salary (projektinumero)",
          "type": "string"
        },
        "row_number": {
          "format": "int32",
          "description": "The display order of the row",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.PersonHelpFigure": {
      "description": "A help figure value used by payroll calculations (apuluku)",
      "type": "object",
      "properties": {
        "value": {
          "format": "double",
          "description": "The numeric value of the help figure",
          "type": "number"
        },
        "code": {
          "description": "The code identifying the help figure",
          "type": "string"
        },
        "name": {
          "description": "The display name of the help figure",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.PersonAttribute": {
      "description": "A role / classification attribute attached to a person (henkilön rooli)",
      "required": [
        "id",
        "selected"
      ],
      "type": "object",
      "properties": {
        "name": {
          "description": "The attribute description",
          "type": "string"
        },
        "id": {
          "format": "int32",
          "description": "The unique identifier of the attribute (required)",
          "type": "integer"
        },
        "selected": {
          "description": "Indicates whether this attribute is selected for the person (required)",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.CreateUpdateWithNumberResponse": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "number": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Person]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Person"
        }
      }
    },
    "LemonRest.Models.Proxy.PutPersonCodeRequest": {
      "description": "Request body item for PUT api/persons/{id}/codes. The endpoint is scoped to RFID codes only:\r\nthe supplied list replaces the person's RFID codes (existing codes are matched by id and renamed,\r\nomitted RFID codes are removed, and codes with id = 0 are created as RFID). Non-RFID codes\r\n(eMailer, HelpDesk) are never created or modified through this endpoint.",
      "type": "object",
      "properties": {
        "name": {
          "description": "The RFID code value.",
          "type": "string"
        },
        "id": {
          "format": "int32",
          "description": "Existing person code id to update, or 0 to create a new RFID code.",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.PutPersonAttributesRequest": {
      "description": "Request body for PUT api/persons/{number}/attributes. Carries the Kellokortti person\r\nattribute selection: role ids, recording-method ids and the extra permission flags. The\r\nendpoint reconciles the whitelisted Kellokortti person_attributes to match this selection.",
      "type": "object",
      "properties": {
        "roles": {
          "description": "Selected person role attribute ids (e.g. supervisor, project manager).",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "recording_methods": {
          "description": "Selected recording-method attribute ids (9000 = stamp, 9001 = calendar).",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "can_cancel_approval": {
          "description": "When true, the person may cancel approvals (attribute 9002).",
          "type": "boolean"
        },
        "can_start_subordinate_calendar_stamp": {
          "description": "When true, the supervisor may start subordinate calendar stamps (attribute 9003).",
          "type": "boolean"
        },
        "can_edit_own_time_bank_events": {
          "description": "When true, the person may edit their own time bank events (attribute 9004).",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.QueryFilters.JobFilter": {
      "type": "object",
      "properties": {
        "person_number": {
          "format": "int32",
          "type": "integer"
        },
        "states": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "job_types": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "company_location": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "department": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "costcenter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "project_type": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "after": {
          "format": "date-time",
          "type": "string"
        },
        "before": {
          "format": "date-time",
          "type": "string"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Job]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Job"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Job": {
      "description": "A scheduled or in-progress job assignment for a person (työkeikka). Used by the /api/persons/jobs endpoints",
      "type": "object",
      "properties": {
        "type": {
          "format": "int32",
          "description": "The job type code (e.g. service job, project, sales order)",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The scheduled date of the job",
          "type": "string"
        },
        "start_date": {
          "format": "date-time",
          "description": "The job's actual start timestamp (set when the worker starts the job)",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "description": "The job's actual end timestamp (set when the worker completes the job)",
          "type": "string"
        },
        "description": {
          "description": "Free-text description of the job",
          "type": "string"
        },
        "person_number": {
          "format": "int32",
          "description": "The person assigned to the job (henkilönumero)",
          "type": "integer"
        },
        "state": {
          "format": "int32",
          "description": "The job's state code (e.g. assigned, started, paused, done)",
          "type": "integer"
        },
        "object_id": {
          "format": "int32",
          "description": "The id of the underlying object the job is attached to (project, sales order, etc.)",
          "type": "integer"
        },
        "customer_name": {
          "description": "The customer's display name",
          "type": "string"
        },
        "customer_address": {
          "description": "The customer's address",
          "type": "string"
        },
        "hours": {
          "format": "double",
          "description": "Hours recorded against the job",
          "type": "number"
        },
        "description_done": {
          "description": "Free-text description of work performed",
          "type": "string"
        },
        "description_inner": {
          "description": "Internal-only notes (not visible to customer)",
          "type": "string"
        },
        "travel_route": {
          "description": "The travel route description for the job",
          "type": "string"
        },
        "km": {
          "format": "int32",
          "description": "Kilometers driven for the job",
          "type": "integer"
        },
        "vehicle": {
          "format": "int32",
          "description": "The vehicle id used for travel",
          "type": "integer"
        },
        "calculate_allowance": {
          "description": "When true, per-diem allowance is calculated automatically based on the duration",
          "type": "boolean"
        },
        "header": {
          "description": "The job's display header",
          "type": "string"
        },
        "code": {
          "description": "The job's code / identifier",
          "type": "string"
        },
        "object_number": {
          "format": "int32",
          "description": "The business number of the object the job is attached to (e.g. project_number, order_number)",
          "type": "integer"
        },
        "object_description": {
          "description": "The display description of the attached object",
          "type": "string"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_id": {
          "format": "int32",
          "description": "The internal customer id",
          "type": "integer"
        },
        "customer_postal_code": {
          "description": "The customer's postal code",
          "type": "string"
        },
        "customer_city": {
          "description": "The customer's city",
          "type": "string"
        },
        "customer_contact_name": {
          "description": "The customer contact person's name",
          "type": "string"
        },
        "customer_contact_phone_number": {
          "description": "The customer contact person's phone number",
          "type": "string"
        },
        "customer_contact_email": {
          "description": "The customer contact person's email",
          "type": "string"
        },
        "person_name": {
          "description": "The assigned person's name",
          "type": "string"
        },
        "person_gsm": {
          "description": "The assigned person's mobile number",
          "type": "string"
        },
        "billable_hours": {
          "format": "double",
          "description": "The number of hours that will be billed to the customer",
          "type": "number"
        },
        "fos_number": {
          "format": "int32",
          "description": "The form of salary number used when posting hours from the job (palkkalajinumero)",
          "type": "integer"
        },
        "person_office": {
          "format": "int32",
          "description": "The person's company location id (toimipaikka)",
          "type": "integer"
        },
        "person_department": {
          "format": "int32",
          "description": "The person's department",
          "type": "integer"
        },
        "service_order_id": {
          "format": "int32",
          "description": "The id of the underlying service order, when the job belongs to one",
          "type": "integer"
        },
        "cost_center": {
          "description": "The cost center for the job (kustannuspaikka)",
          "type": "string"
        },
        "serialnumber": {
          "description": "Serial number of the equipment / product the job is targeting",
          "type": "string"
        },
        "product_code": {
          "description": "The product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "product_description": {
          "description": "The product's primary description",
          "type": "string"
        },
        "product_description2": {
          "description": "The product's secondary description",
          "type": "string"
        },
        "additional_jobs": {
          "description": "Linked / sub-jobs spawned from this job",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Job"
          }
        },
        "additional_workers": {
          "description": "Additional workers attached to this job",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PersonMainData"
          }
        },
        "project_invoicing_type": {
          "format": "int32",
          "description": "Project invoicing type code (laskutustyyppi). For possible values, refer to /api/codelist/description?filter.codeListFilter=INVOICING_TYPE",
          "type": "integer"
        },
        "project_worktime_invoicing_type": {
          "format": "int32",
          "description": "Project worktime invoicing type code",
          "type": "integer"
        },
        "project_worktime_material_invoicing_type": {
          "format": "int32",
          "description": "Project worktime material invoicing type code",
          "type": "integer"
        },
        "project_phase_worktime_invoicing_type": {
          "format": "int32",
          "description": "Project phase worktime invoicing type code",
          "type": "integer"
        },
        "project_phase_worktime_material_invoicing_type": {
          "format": "int32",
          "description": "Project phase worktime material invoicing type code",
          "type": "integer"
        },
        "amount": {
          "format": "double",
          "description": "Generic amount value for the job",
          "type": "number"
        },
        "worktime_reason_code": {
          "format": "int32",
          "description": "Worktime reason code used when posting hours from this job",
          "type": "integer"
        },
        "workshift": {
          "format": "int32",
          "description": "The workshift id used when posting hours",
          "type": "integer"
        },
        "team": {
          "format": "int32",
          "description": "The team id the job is assigned to. For possible values, refer to /api/settings/teams\r\n[here](#tag/Settings/operation/Settings_GetTeams)",
          "type": "integer"
        },
        "team_description": {
          "description": "The team's display description",
          "type": "string"
        },
        "service_agreement_number": {
          "format": "int32",
          "description": "The service agreement number attached to the job (sopimusnumero)",
          "type": "integer"
        },
        "set_order_invoiced": {
          "description": "When true, completing the job marks the underlying order as invoiced",
          "type": "boolean"
        },
        "payment_term": {
          "format": "int32",
          "description": "The payment term used for the job's invoice (maksuehto). For possible values, refer to /api/settings/payment_terms/{languageCode}\r\n[here](#tag/Settings/operation/Settings_GetPaymentTerms)",
          "type": "integer"
        },
        "payment_account": {
          "description": "The bank account used for the job's invoice",
          "type": "string"
        },
        "send_sms": {
          "description": "When true and the job is a service order, completing it sends an SMS notification to the customer (huoltotyön valmistuminen). Honored together with the SMS_DELIVERY_MESSAGE function setting.",
          "type": "boolean"
        },
        "send_email": {
          "description": "When true and the job is a service order, completing it emails the service report PDF to the customer",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.PersonMainData": {
      "description": "Core person data — extends PersonLogin with login credentials, supervisor and notification preferences",
      "type": "object",
      "properties": {
        "contact_password": {
          "description": "Password for contact-only access (used when the person is not a Lemonsoft user)",
          "type": "string"
        },
        "person_password": {
          "description": "The person's Lemonsoft login password",
          "type": "string"
        },
        "supervisor": {
          "format": "int32",
          "description": "The person number of this person's supervisor (esimies)",
          "type": "integer"
        },
        "send_email": {
          "description": "When true, the person receives email notifications",
          "type": "boolean"
        },
        "send_internal_msg": {
          "description": "When true, the person receives internal Lemonsoft messages",
          "type": "boolean"
        },
        "send_sms": {
          "description": "When true, the person receives SMS notifications",
          "type": "boolean"
        },
        "id": {
          "format": "int32",
          "description": "The unique internal id of the person",
          "type": "integer"
        },
        "language_code": {
          "description": "The person's UI language (kielikoodi). For possible values, refer to /api/settings/languages\r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
          "default": "FIN",
          "type": "string"
        },
        "attributes": {
          "description": "Role / classification attributes assigned to this person",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PersonAttribute"
          }
        },
        "email": {
          "description": "The person's e-mail address",
          "type": "string"
        },
        "gsm": {
          "description": "The person's mobile phone number (gsm)",
          "type": "string"
        },
        "name": {
          "description": "The person's display name",
          "type": "string"
        },
        "number": {
          "format": "int32",
          "description": "The person's number (henkilönumero)",
          "type": "integer"
        },
        "office": {
          "format": "int32",
          "description": "The company location id (toimipaikka). For possible values, refer to /api/settings/companylocations\r\n[here](#tag/Settings/operation/Settings_GetCompanyLocations)",
          "type": "integer"
        },
        "short_name": {
          "description": "Short / abbreviated name for the person",
          "type": "string"
        },
        "username": {
          "description": "The person's Lemonsoft login username (only set for Lemonsoft users)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.WorkTimeFilter": {
      "description": "Työajan filtteri",
      "type": "object",
      "properties": {
        "created_before": {
          "format": "date-time",
          "type": "string"
        },
        "created_after": {
          "format": "date-time",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "type": "string"
        },
        "date_before": {
          "format": "date-time",
          "type": "string"
        },
        "date_after": {
          "format": "date-time",
          "type": "string"
        },
        "states": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "job_id": {
          "format": "int32",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "Person number",
          "type": "integer"
        },
        "sort_desc": {
          "description": "Sorting order. Default is ascending (false).",
          "type": "boolean"
        },
        "sources": {
          "description": "Worktime sources",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "project_number": {
          "format": "int32",
          "description": "Project number. Returns only worktimes booked on the given project.",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "Project phase id. Value 0 returns worktimes that have no phase; omit the parameter to skip phase filtering.",
          "type": "integer"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.WorkTime]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTime"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.WorkTime": {
      "description": "Work time proxy",
      "required": [
        "date"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "Unique identifier for the work time entry",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "Person number associated with this work time entry",
          "type": "integer"
        },
        "person_name": {
          "description": "Name of the person",
          "type": "string"
        },
        "date": {
          "format": "date-time",
          "description": "Date of the work time entry",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "description": "End date of the work time entry (optional)",
          "type": "string"
        },
        "hours": {
          "format": "int32",
          "description": "Worked time in seconds, not hours despite the name",
          "type": "integer"
        },
        "header": {
          "description": "Header/title of the work time entry",
          "type": "string"
        },
        "description": {
          "description": "Detailed description of the work performed",
          "type": "string"
        },
        "geography": {
          "description": "Geographic location where work was performed",
          "type": "string"
        },
        "state": {
          "format": "int32",
          "description": "Current state/status of the work time entry",
          "type": "integer"
        },
        "invoice_hours": {
          "format": "int32",
          "description": "Time to be invoiced to the customer in seconds, not hours despite the name",
          "type": "integer"
        },
        "is_invoice": {
          "description": "Indicates whether this work time is invoiceable",
          "type": "boolean"
        },
        "project_number": {
          "format": "int32",
          "description": "Project number this work time is associated with",
          "type": "integer"
        },
        "project_description": {
          "description": "Description of the project",
          "type": "string"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "Project phase identifier",
          "type": "integer"
        },
        "project_phase_description": {
          "description": "Description of the project phase",
          "type": "string"
        },
        "formofsalary_number": {
          "format": "int32",
          "description": "Form of salary number/type for this work",
          "type": "integer"
        },
        "formofsalary_description": {
          "description": "Description of the form of salary",
          "type": "string"
        },
        "customer_number": {
          "format": "int32",
          "description": "Customer number this work is performed for",
          "type": "integer"
        },
        "customer_name": {
          "description": "Name of the customer",
          "type": "string"
        },
        "costcenter": {
          "description": "Cost center code",
          "type": "string"
        },
        "costcenter_description": {
          "description": "Description of the cost center",
          "type": "string"
        },
        "costprice": {
          "format": "double",
          "description": "Cost price for this work time",
          "type": "number"
        },
        "workshift": {
          "format": "int32",
          "description": "Work shift identifier",
          "type": "integer"
        },
        "additions": {
          "description": "List of additional salary components for this work time",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeAddition"
          }
        },
        "source": {
          "format": "int32",
          "description": "Source system/origin of this work time entry",
          "type": "integer"
        },
        "source_description": {
          "description": "Description of the source",
          "type": "string"
        },
        "reason": {
          "format": "int32",
          "description": "Reason code for this work time entry",
          "type": "integer"
        },
        "modified_date": {
          "format": "date-time",
          "description": "Date when this work time entry was last modified",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.WorkTimeAddition": {
      "description": "Work time addition/supplement proxy",
      "type": "object",
      "properties": {
        "formofsalary_number": {
          "format": "int32",
          "description": "Form of salary number for this addition",
          "type": "integer"
        },
        "formofsalary_description": {
          "description": "Description of the form of salary",
          "type": "string"
        },
        "price": {
          "format": "double",
          "description": "Price/rate for this addition",
          "type": "number"
        },
        "amount": {
          "format": "int32",
          "description": "Quantity/amount of this addition",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.WorkTime]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTime"
        }
      }
    },
    "LemonRest.Models.QueryFilters.WorkTimeMaterialFilter": {
      "type": "object",
      "properties": {
        "product_type": {
          "format": "int32",
          "type": "integer"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.WorkTimeMaterial]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeMaterial"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.WorkTimeMaterial": {
      "description": "Work time material proxy",
      "required": [
        "product_code",
        "amount"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "Unique identifier for the work time material",
          "type": "integer"
        },
        "worktime_id": {
          "format": "int32",
          "description": "Work time entry this material is associated with",
          "type": "integer"
        },
        "product_code": {
          "description": "Product code of the material",
          "type": "string"
        },
        "product_description": {
          "description": "Description of the product",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "Quantity/amount of the material used",
          "type": "number"
        },
        "unit_id": {
          "format": "int32",
          "description": "Work time material unit identifier",
          "type": "integer"
        },
        "unit": {
          "description": "Work time material unit",
          "type": "string"
        },
        "is_invoice": {
          "description": "Indicates whether this material is invoiceable to customer",
          "type": "boolean"
        },
        "stock_number": {
          "format": "int32",
          "description": "Stock number where material is taken from",
          "type": "integer"
        },
        "project_invoicingtype": {
          "format": "int32",
          "description": "Project invoicing type for this material",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.WorkTimeRegulation]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeRegulation"
        }
      }
    },
    "LemonRest.Models.Proxy.WorkTimeRegulation": {
      "description": "Työaikaseurannan asetukset",
      "type": "object",
      "properties": {
        "regulation_id": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_number": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_type": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_description": {
          "type": "string"
        },
        "regulation_start": {
          "format": "date-time",
          "type": "string"
        },
        "regulation_start_early": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_start_late": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_end": {
          "format": "date-time",
          "type": "string"
        },
        "regulation_end_early": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_end_late": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_lunch": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_lunch_reduction": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_formofsalary": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_formofsalary_contract": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_formofsalary_timecontract": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_formofsalary_lunch": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_lunch_max": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_formofsalary_lunchcutback": {
          "format": "int32",
          "type": "integer"
        },
        "is_regulation_inuse": {
          "type": "boolean"
        },
        "regulation_pause_max": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_formofsalary_pause": {
          "format": "int32",
          "type": "integer"
        },
        "is_regulation_mo": {
          "type": "boolean"
        },
        "is_regulation_tu": {
          "type": "boolean"
        },
        "is_regulation_we": {
          "type": "boolean"
        },
        "is_regulation_th": {
          "type": "boolean"
        },
        "is_regulation_fr": {
          "type": "boolean"
        },
        "is_regulation_sa": {
          "type": "boolean"
        },
        "is_regulation_su": {
          "type": "boolean"
        },
        "is_regulation_next_days_workshift": {
          "type": "boolean"
        },
        "regulation_workshift_end_time": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_duration": {
          "format": "int32",
          "type": "integer"
        },
        "is_regulation_default": {
          "type": "boolean"
        },
        "is_regulation_has_plan": {
          "type": "boolean"
        },
        "regulation_validity_start": {
          "format": "date-time",
          "type": "string"
        },
        "regulation_validity_end": {
          "format": "date-time",
          "type": "string"
        },
        "regulation_date_selection_type": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_date_selection_date": {
          "format": "date-time",
          "type": "string"
        },
        "is_regulation_date_selection_exception_days_finnish_holiday": {
          "type": "boolean"
        },
        "is_regulation_date_selection_exception_days_shortened_day": {
          "type": "boolean"
        },
        "is_regulation_date_selection_exception_days_companys_holiday": {
          "type": "boolean"
        },
        "is_regulation_date_selection_exception_days_non_holiday": {
          "type": "boolean"
        },
        "is_regulation_date_selection_exception_days_other": {
          "type": "boolean"
        },
        "is_regulation_date_selection_ignored_exception_days_finnish_holiday": {
          "type": "boolean"
        },
        "is_regulation_date_selection_ignored_exception_days_shortened_day": {
          "type": "boolean"
        },
        "is_regulation_date_selection_ignored_exception_days_companys_holiday": {
          "type": "boolean"
        },
        "is_regulation_date_selection_ignored_exception_days_non_holiday": {
          "type": "boolean"
        },
        "is_regulation_date_selection_ignored_exception_days_other": {
          "type": "boolean"
        },
        "regulation_priority": {
          "format": "int32",
          "type": "integer"
        },
        "is_regulation_forced_days_mo": {
          "type": "boolean"
        },
        "is_regulation_forced_days_tu": {
          "type": "boolean"
        },
        "is_regulation_forced_days_we": {
          "type": "boolean"
        },
        "is_regulation_forced_days_th": {
          "type": "boolean"
        },
        "is_regulation_forced_days_fr": {
          "type": "boolean"
        },
        "is_regulation_forced_days_sa": {
          "type": "boolean"
        },
        "is_regulation_forced_days_su": {
          "type": "boolean"
        },
        "is_regulation_forced_exception_days_finnish_holiday": {
          "type": "boolean"
        },
        "is_regulation_forced_exception_days_shortened_day": {
          "type": "boolean"
        },
        "is_regulation_forced_exception_days_companys_holiday": {
          "type": "boolean"
        },
        "is_regulation_forced_exception_days_non_holiday": {
          "type": "boolean"
        },
        "is_regulation_forced_exception_days_other": {
          "type": "boolean"
        },
        "is_regulation_not_used_in_work_shift_utils": {
          "type": "boolean"
        },
        "regulation_stamp_in_rounding_mode": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_stamp_out_rounding_mode": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_lunch_reduction_setting": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_lunch_reduction_direction": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_lunch_reduction_position": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_lunch_start": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_lunch_reduction_without_stamp_minutes": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_number_of_breaks": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_payslip_code": {
          "type": "string"
        },
        "regulation_default_event_type": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_normal_duration": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_workday_end": {
          "format": "date-time",
          "type": "string"
        },
        "regulation_overtime_practice_default": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_automatic_stamp_out_practice": {
          "format": "int32",
          "type": "integer"
        },
        "is_regulation_flextime_enabled_on_overtime": {
          "type": "boolean"
        },
        "is_regulation_lunch_skip_salary_robot": {
          "type": "boolean"
        },
        "regulation_worktime_group": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_settings": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeRegulationSetting"
          }
        },
        "regulation_reasons": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeReason"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.WorkTimeRegulationSetting": {
      "description": "Työaikaseurannan asetusten lisäasetukset",
      "type": "object",
      "properties": {
        "regulation_setting_id": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_id": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_setting_start": {
          "format": "date-time",
          "type": "string"
        },
        "regulation_setting_end": {
          "format": "date-time",
          "type": "string"
        },
        "regulation_setting_formofsalary": {
          "format": "int32",
          "type": "integer"
        },
        "regulation_setting_formofsalary_limitation": {
          "format": "int32",
          "type": "integer"
        },
        "is_regulation_setting_add": {
          "type": "boolean"
        },
        "regulation_setting_hour": {
          "format": "date-time",
          "type": "string"
        },
        "regulation_setting_reasons": {
          "type": "string"
        },
        "is_regulation_setting_is_addition": {
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.WorkTimeReason": {
      "description": "Työajan syykoodit",
      "type": "object",
      "properties": {
        "reason_id": {
          "format": "int32",
          "type": "integer"
        },
        "reason_description": {
          "type": "string"
        },
        "reason_worktime_regulation_id": {
          "format": "int32",
          "type": "integer"
        },
        "is_reason_timeofreturn": {
          "type": "boolean"
        },
        "is_reason_worktime": {
          "type": "boolean"
        },
        "is_reason_lunchtime": {
          "type": "boolean"
        },
        "reason_formofsalary": {
          "format": "int32",
          "type": "integer"
        },
        "is_reason_holyday": {
          "type": "boolean"
        },
        "is_reason_useminlunch": {
          "type": "boolean"
        },
        "is_reason_today": {
          "type": "boolean"
        },
        "is_reason_update": {
          "type": "boolean"
        },
        "is_reason_maxhours": {
          "type": "boolean"
        },
        "is_reason_overtime": {
          "type": "boolean"
        },
        "is_reason_vacation": {
          "type": "boolean"
        },
        "is_reason_pause": {
          "type": "boolean"
        },
        "is_vacation_fulldays": {
          "type": "boolean"
        },
        "is_reason_inuse": {
          "type": "boolean"
        },
        "is_reason_can_stamp_in": {
          "type": "boolean"
        },
        "is_reason_sick_leave": {
          "type": "boolean"
        },
        "is_reason_time_compensation": {
          "type": "boolean"
        },
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorkTimeAddition]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeAddition"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[System.Nullable[System.DateTime]]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "format": "date-time",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PersonAbsenceFilter": {
      "type": "object",
      "properties": {
        "person_number": {
          "format": "int32",
          "type": "integer"
        },
        "states": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "after": {
          "format": "date-time",
          "type": "string"
        },
        "before": {
          "format": "date-time",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "type": "string"
        },
        "sort_desc": {
          "description": "Sorting order by id. Default is ascending (false).",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PersonAbsence]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PersonAbsence"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PersonAbsence": {
      "description": "A person absence entry (poissaolo) — vacation, sick leave, leave of absence, etc.",
      "type": "object",
      "properties": {
        "person_absence_id": {
          "format": "int32",
          "description": "The unique id of the absence entry",
          "type": "integer"
        },
        "person_id": {
          "format": "int32",
          "description": "The internal id of the person on absence",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The number of the person on absence (henkilönumero)",
          "type": "integer"
        },
        "person_name": {
          "description": "The person's name",
          "type": "string"
        },
        "person_absence_state": {
          "format": "int32",
          "description": "The state of the absence (0 = draft, 1 = submitted, 2 = approved, 3 = rejected)",
          "type": "integer"
        },
        "person_absence_state_description": {
          "description": "The state's display description",
          "type": "string"
        },
        "person_absence_reason_id": {
          "format": "int32",
          "description": "The id of the absence reason (poissaolon syy)",
          "type": "integer"
        },
        "person_absence_reason_description": {
          "description": "The absence reason's display description",
          "type": "string"
        },
        "person_absence_date": {
          "format": "date-time",
          "description": "The first day of the absence",
          "type": "string"
        },
        "person_absence_enddate": {
          "format": "date-time",
          "description": "The last day of the absence",
          "type": "string"
        },
        "person_absence_last_modification_time": {
          "format": "date-time",
          "description": "Timestamp when the absence was last modified",
          "type": "string"
        },
        "person_absence_unit": {
          "format": "int32",
          "description": "The unit code for the absence duration (0 = days, 1 = hours)",
          "type": "integer"
        },
        "person_absence_amount": {
          "format": "double",
          "description": "The absence amount in the configured unit",
          "type": "number"
        },
        "person_absence_amount_days": {
          "format": "double",
          "description": "The absence amount expressed in days",
          "type": "number"
        },
        "person_absence_amount_hours": {
          "format": "double",
          "description": "The absence amount expressed in hours",
          "type": "number"
        },
        "person_absence_header": {
          "description": "Short title / header for the absence",
          "type": "string"
        },
        "person_absence_description": {
          "description": "Free-text description of the absence",
          "type": "string"
        },
        "person_absence_formofsalary_description": {
          "description": "Display name of the form of salary used for the absence (palkkalaji)",
          "type": "string"
        },
        "person_absence_payroll_postinggroup_description": {
          "description": "Display name of the payroll posting group",
          "type": "string"
        },
        "person_absence_rejection_description": {
          "description": "Reason text supplied when the absence was rejected",
          "type": "string"
        },
        "person_absence_reversal_bit": {
          "description": "When true, the absence is a reversal of an earlier absence (peruutus)",
          "type": "boolean"
        },
        "Person_absence_source": {
          "description": "Person absence source",
          "enum": [
            "Lemonsoft",
            "Customer",
            "Product",
            "Person",
            "Invoicing",
            "PLedger",
            "Campaign",
            "Offer",
            "SalesOrder",
            "PurchaseOrder",
            "CashRegister",
            "Payroll",
            "Production",
            "Accounting",
            "AccountList",
            "Project",
            "ServiceOrder",
            "TravelExpense",
            "CustomerAgreement",
            "PurchaceinvoicingCirculation",
            "TravelExpenseCirculation",
            "Complaints",
            "DeliveryAgreement",
            "Assets",
            "SalesOrderDelivery",
            "SalaryCirculation",
            "PurchaseInvoiceCirculationSmart",
            "AccountingCirculation",
            "SalaryCirculationSmart",
            "TaxFormAttachment",
            "PurchaseOrderDelivery",
            "OfferDecision",
            "AccountingArchive",
            "InvoicePayment",
            "NumberSeries",
            "FormOfSalaries",
            "Pricelist",
            "TimeRegistration",
            "CustomerList",
            "CustomerCentrum",
            "TransactionCentrum",
            "ProductCentrum",
            "SalesLedgerCentrum",
            "InvoicingCentrum",
            "ReferencePayments",
            "PurchaseInvoicePayments",
            "ProductList",
            "ProjectCentrum",
            "OfferCentrum",
            "HRCalendar",
            "Timestamp",
            "PersonSkillProfile",
            "PurchaseInvoiceImportedImages",
            "HRCalendarAcceptance",
            "PurchaseInvoiceHubZips",
            "IncomeRegisterSending",
            "Worktime",
            "CustomerTransaction",
            "Calendar",
            "CustomerTransactionList",
            "ExpenseInvoice",
            "eKuittiLemon",
            "eKuittiLemonAccountStatement",
            "AccountStatement",
            "MultiBank",
            "CompanyPayments",
            "LemonFiles",
            "Initiatives",
            "LoyalityHandling",
            "SalesOrderCentrum",
            "Consignment",
            "SSCC",
            "PurchaseOrderCentrum",
            "SupplierPortalCentrum",
            "FeedbackCentre",
            "Feedback",
            "DevelopmentIdea",
            "CustomerHistory",
            "BalanceOfAccount",
            "BalanceofAccountSupplier",
            "PurchaseInvoiceFinvoiceImport",
            "PurchaseInvoiceCentrum",
            "ProductBatchHandling",
            "ProductStructure",
            "StockCollectJobs",
            "ProductDevice",
            "PalletHandling",
            "ProductionJobList",
            "ProductionList",
            "ProductionStatus",
            "ProductionGANTT",
            "ProductionBatchPlanning",
            "ProductionStandars",
            "ProductionComplaints",
            "ProductionJobDone",
            "SSRSReports",
            "MachineHistory",
            "Worknumbers",
            "ResourceHandling",
            "ResourcePlanning",
            "LemonShop",
            "CollectJobs",
            "ProjectEnterpriseSearch",
            "WorktimeRegulation",
            "Fee",
            "ProjectPhase",
            "WorkHour",
            "PreOrderInfo",
            "WorkHourMaterial",
            "WorkTimeMaterial",
            "ShiftPlanning",
            "ShiftPlanningProposedShifts",
            "ShiftPlanningFreeShifts",
            "Kellokortti2",
            "eKuittiMobile",
            "SalaryChangeEvent",
            "ProjectBudgetVersions",
            "ProjectPredictionVersions"
          ],
          "type": "string"
        },
        "event_type_id": {
          "format": "int32",
          "description": "Kellokortti 2.0 entry type (kirjauslaji) linked to the absence",
          "type": "integer"
        },
        "person_absence_day_selection": {
          "format": "int32",
          "description": "Kellokortti 2.0 day selection (0 = only workdays, 1 = all weekdays, 2 = all days)",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PersonAbsence]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PersonAbsence"
        }
      }
    },
    "LemonRest.Models.Proxy.PersonAbsenceDate": {
      "description": "A single day-level row of an absence",
      "type": "object",
      "properties": {
        "person_absence_date_id": {
          "format": "int32",
          "description": "The unique id of the absence day row (0 for a new row)",
          "type": "integer"
        },
        "person_absence_id": {
          "format": "int32",
          "description": "The id of the absence this day belongs to",
          "type": "integer"
        },
        "person_absence_date": {
          "format": "date-time",
          "description": "The day covered by this row",
          "type": "string"
        },
        "realized_workshift_id": {
          "format": "int32",
          "description": "The realized workshift the day is tied to, if any",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.PersonAbsenceCalculation": {
      "description": "Input model for the absence calculation endpoint (POST /api/persons/absences/calculate)",
      "type": "object",
      "properties": {
        "person_id": {
          "format": "int32",
          "description": "The internal id of the person",
          "type": "integer"
        },
        "absence_reason_id": {
          "format": "int32",
          "description": "The id of the absence reason to calculate against",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The first day of the absence to calculate",
          "type": "string"
        },
        "enddate": {
          "format": "date-time",
          "description": "The last day of the absence to calculate",
          "type": "string"
        },
        "absence_reversal_bit": {
          "description": "When true, calculation treats the entry as a reversal of a previous absence",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PersonAbsenceCalculationAmount]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PersonAbsenceCalculationAmount"
        }
      }
    },
    "LemonRest.Models.Proxy.PersonAbsenceCalculationAmount": {
      "description": "Calculated absence amount returned by POST /api/persons/absences/calculate",
      "type": "object",
      "properties": {
        "amount": {
          "format": "double",
          "description": "The absence amount in the absence's configured unit",
          "type": "number"
        },
        "days": {
          "format": "double",
          "description": "The absence amount expressed in days",
          "type": "number"
        },
        "hours": {
          "format": "double",
          "description": "The absence amount expressed in hours",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.PersonLogin": {
      "description": "Minimal person identity model returned by login and basic lookup endpoints (henkilön perustiedot)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique internal id of the person",
          "type": "integer"
        },
        "language_code": {
          "description": "The person's UI language (kielikoodi). For possible values, refer to /api/settings/languages\r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
          "default": "FIN",
          "type": "string"
        },
        "attributes": {
          "description": "Role / classification attributes assigned to this person",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PersonAttribute"
          }
        },
        "email": {
          "description": "The person's e-mail address",
          "type": "string"
        },
        "gsm": {
          "description": "The person's mobile phone number (gsm)",
          "type": "string"
        },
        "name": {
          "description": "The person's display name",
          "type": "string"
        },
        "number": {
          "format": "int32",
          "description": "The person's number (henkilönumero)",
          "type": "integer"
        },
        "office": {
          "format": "int32",
          "description": "The company location id (toimipaikka). For possible values, refer to /api/settings/companylocations\r\n[here](#tag/Settings/operation/Settings_GetCompanyLocations)",
          "type": "integer"
        },
        "short_name": {
          "description": "Short / abbreviated name for the person",
          "type": "string"
        },
        "username": {
          "description": "The person's Lemonsoft login username (only set for Lemonsoft users)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.EReceiptFilter": {
      "description": "eReceipt filter",
      "type": "object",
      "properties": {
        "filename": {
          "description": "eReceipt file name",
          "type": "string"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.EReceipt]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.EReceipt"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.EReceipt": {
      "description": "An e-receipt (eKuitti) — a digital receipt linked to a person and forwarded to purchase invoicing",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the e-receipt",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The person who submitted the receipt (henkilönumero)",
          "type": "integer"
        },
        "person_name": {
          "description": "The submitting person's name",
          "type": "string"
        },
        "date": {
          "format": "date-time",
          "description": "The receipt date",
          "type": "string"
        },
        "description": {
          "description": "Free-text description for the receipt",
          "type": "string"
        },
        "total_price": {
          "format": "double",
          "description": "The total price across all price lines on the receipt",
          "type": "number"
        },
        "purchase_invoice_id": {
          "format": "int32",
          "description": "The id of the purchase invoice generated from the receipt (when one has been generated)",
          "type": "integer"
        },
        "purchase_invoice_state": {
          "format": "int32",
          "description": "The state of the linked purchase invoice",
          "type": "integer"
        },
        "prices": {
          "description": "The price / posting lines on the receipt",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.EReceiptPrice"
          }
        },
        "files": {
          "description": "The receipt's attached files",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.EReceiptFile"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.EReceiptPrice": {
      "description": "A price / posting line on an e-receipt",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the price line",
          "type": "integer"
        },
        "ereceipt_id": {
          "format": "int32",
          "description": "The e-receipt the line belongs to",
          "type": "integer"
        },
        "total": {
          "format": "double",
          "description": "The amount on the line (total)",
          "type": "number"
        },
        "expense_type": {
          "format": "int32",
          "description": "The expense type code (matkalaskutyyppi)",
          "type": "integer"
        },
        "expense_type_description": {
          "description": "The expense type's display description",
          "type": "string"
        },
        "project": {
          "format": "int32",
          "description": "The project number (projektinumero). For possible values, refer to /api/projects\r\n            [here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "project_description": {
          "description": "The project's display description",
          "type": "string"
        },
        "costcenter": {
          "description": "The cost center code (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n            [here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "costcenter_description": {
          "description": "The cost center's display description",
          "type": "string"
        },
        "lta": {
          "description": "The LTA code (työehtosopimuslisä). For possible values, refer to /api/settings/ltas\r\n            [here](#tag/Settings/operation/Settings_GetLtas)",
          "type": "string"
        },
        "lta_description": {
          "description": "The LTA's display description",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.EReceiptFile": {
      "description": "A file attached to an e-receipt (scanned receipt image, PDF, etc.)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the file attachment entry",
          "type": "integer"
        },
        "ereceipt_id": {
          "format": "int32",
          "description": "The e-receipt this file belongs to",
          "type": "integer"
        },
        "filename": {
          "description": "The original filename of the attachment",
          "type": "string"
        },
        "lemonfiles_file_id": {
          "format": "int32",
          "description": "The internal LemonFiles file id",
          "type": "integer"
        },
        "lemonfiles_file_path": {
          "description": "The internal LemonFiles file path",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ShiftPlanningRowFilter": {
      "type": "object",
      "properties": {
        "date_before": {
          "format": "date-time",
          "type": "string"
        },
        "date_after": {
          "format": "date-time",
          "type": "string"
        },
        "persons": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "person_groups": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ShiftPlanningRow]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ShiftPlanningRow"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ShiftPlanningRow": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "type": "integer"
        },
        "shift_id": {
          "format": "int32",
          "type": "integer"
        },
        "start_date": {
          "format": "date-time",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ShiftPlanningRowWorkStationFilter": {
      "description": "Filter parameters for querying shift planning row work station assignments.",
      "type": "object",
      "properties": {
        "date_before": {
          "format": "date-time",
          "description": "Upper bound for the assignment start date. Defaults to one year from today.",
          "type": "string"
        },
        "date_after": {
          "format": "date-time",
          "description": "Lower bound for the assignment start date. Defaults to 1970-01-01 (effectively unbounded).",
          "type": "string"
        },
        "persons": {
          "description": "Optional list of person numbers to filter assignments by. Null or empty disables this filter.",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ShiftPlanningRowWorkStation]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ShiftPlanningRowWorkStation"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ShiftPlanningRowWorkStation": {
      "description": "Proxy DTO representing a work station assignment within a shift planning row.",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "Unique identifier of the shift planning row work station assignment.",
          "type": "integer"
        },
        "shift_planning_row_id": {
          "format": "int32",
          "description": "Identifier of the parent shift planning row.",
          "type": "integer"
        },
        "work_station_id": {
          "format": "int32",
          "description": "Identifier of the assigned work station.",
          "type": "integer"
        },
        "work_station_description": {
          "description": "Display description of the assigned work station.",
          "type": "string"
        },
        "person_number": {
          "format": "int32",
          "description": "Person number assigned to the work station.",
          "type": "integer"
        },
        "description": {
          "description": "Free-form description for this assignment.",
          "type": "string"
        },
        "start_date": {
          "format": "date-time",
          "description": "Start date of the work station assignment.",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "description": "End date of the work station assignment.",
          "type": "string"
        },
        "capacity": {
          "format": "double",
          "description": "Capacity allocated to this assignment.",
          "type": "number"
        },
        "capacity_factor": {
          "format": "double",
          "description": "Capacity factor (multiplier) applied to the allocated capacity.",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.QueryFilters.WorktimeFosSummaryFilter": {
      "type": "object",
      "properties": {
        "person": {
          "format": "int32",
          "type": "integer"
        },
        "start": {
          "format": "date-time",
          "type": "string"
        },
        "end": {
          "format": "date-time",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorktimeFosSummary]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WorktimeFosSummary"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.WorktimeFosSummary": {
      "description": "Worktime form-of-salary summary row returned by GET /api/persons/worktimefossummary (palkkalajikohtainen yhteenveto)",
      "type": "object",
      "properties": {
        "fos_number": {
          "format": "int32",
          "description": "The form of salary number",
          "type": "integer"
        },
        "fos_description": {
          "description": "The form of salary description",
          "type": "string"
        },
        "hour_info": {
          "description": "Human-readable hours info string for the form of salary",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.WorktimeInfo]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.WorktimeInfo"
        }
      }
    },
    "LemonRest.Models.Proxy.WorktimeInfo": {
      "description": "Flex / hours summary returned by GET /api/persons/{person_number}/flexinfo",
      "type": "object",
      "properties": {
        "flex": {
          "description": "The person's current flex hour balance (liukumasaldo)",
          "type": "string"
        },
        "hours_today": {
          "description": "The hours recorded for today",
          "type": "string"
        },
        "hours_needed_today": {
          "description": "The required hours for today based on the person's regulation",
          "type": "string"
        },
        "vacation_days": {
          "description": "The person's remaining vacation days",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PersonTravelInfoFilter": {
      "description": "Henkilön matkainfon filtteri",
      "type": "object",
      "properties": {
        "start": {
          "format": "date-time",
          "type": "string"
        },
        "end": {
          "format": "date-time",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PersonTravelInfo]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PersonTravelInfo"
        }
      }
    },
    "LemonRest.Models.Proxy.PersonTravelInfo": {
      "description": "Travel info summary returned by GET /api/persons/{person_number}/travelinfo (matkalaskutiedot)",
      "type": "object",
      "properties": {
        "km": {
          "format": "double",
          "description": "The accumulated kilometers driven",
          "type": "number"
        },
        "allowance": {
          "format": "double",
          "description": "The accumulated full per-diem allowance",
          "type": "number"
        },
        "part_allowance": {
          "format": "double",
          "description": "The accumulated partial per-diem allowance",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.KellokorttiShiftPlanningDetails": {
      "type": "object",
      "properties": {
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.KellokorttiPersonGroup"
          }
        },
        "workshifts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.KellokorttiWorkshift"
          }
        },
        "persons": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.KellokorttiPerson"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.KellokorttiPersonGroup": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.KellokorttiWorkshift": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "start_date": {
          "format": "date-time",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.KellokorttiPerson": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "supervisor": {
          "format": "int32",
          "type": "integer"
        },
        "office": {
          "format": "int32",
          "type": "integer"
        },
        "person_group": {
          "format": "int32",
          "type": "integer"
        },
        "email_work": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.MobileNotificationToken": {
      "description": "Payload for the POST /api/persons/mobile_notification_token endpoint — registers a Firebase token for a given app",
      "required": [
        "app",
        "token"
      ],
      "type": "object",
      "properties": {
        "app": {
          "format": "int32",
          "description": "App identifier, 0=LemonTime, 1=LemonWMS, 2=eKuitti, 3=MyLemon, 4=Viisari",
          "type": "integer"
        },
        "token": {
          "description": "Firebase token",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.WageTransparencyFilter": {
      "description": "Filter for wage transparency data",
      "type": "object",
      "properties": {
        "person_number": {
          "format": "int32",
          "description": "Filter by person number. Use -1 to not filter by this field.",
          "type": "integer"
        },
        "person_supervisor": {
          "format": "int32",
          "description": "Filter by person supervisor number. Use -1 to not filter by this field.",
          "type": "integer"
        },
        "department": {
          "format": "int32",
          "description": "Filter by department ID. Use -1 to not filter by this field.",
          "type": "integer"
        },
        "sex": {
          "format": "int32",
          "description": "Filter by person sex (0=Not specified, 1=Male, 2=Female, 3=Other). Use -1 to not filter by this field.",
          "type": "integer"
        },
        "worker_group": {
          "format": "int32",
          "description": "Filter by worker group ID. Use -1 to not filter by this field.",
          "type": "integer"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.WageTransparency]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WageTransparency"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.WageTransparency": {
      "description": "Wage transparency information for a person",
      "type": "object",
      "properties": {
        "person_id": {
          "format": "int32",
          "description": "Person ID",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "Person number",
          "type": "integer"
        },
        "person_name": {
          "description": "Person name",
          "type": "string"
        },
        "person_supervisor": {
          "format": "int32",
          "description": "Person supervisor number",
          "type": "integer"
        },
        "person_supervisor_name": {
          "description": "Person supervisor name",
          "type": "string"
        },
        "person_department": {
          "format": "int32",
          "description": "Person department ID",
          "type": "integer"
        },
        "person_department_description": {
          "description": "Person department description",
          "type": "string"
        },
        "person_sex": {
          "format": "int32",
          "description": "Person sex code (0=Not specified, 1=Male, 2=Female, 3=Other)",
          "type": "integer"
        },
        "person_sex_description": {
          "description": "Person sex description",
          "type": "string"
        },
        "worker_group": {
          "format": "int32",
          "description": "Worker group",
          "type": "integer"
        },
        "worker_group_description": {
          "description": "Worker group description",
          "type": "string"
        },
        "employment_start_date": {
          "format": "date-time",
          "description": "Employment start date",
          "type": "string"
        },
        "employment_end_date": {
          "format": "date-time",
          "description": "Employment end date",
          "type": "string"
        },
        "age": {
          "format": "int32",
          "description": "Person age",
          "type": "integer"
        },
        "salaries": {
          "description": "List of salaries for this person",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WageTransparencySalary"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.WageTransparencySalary": {
      "description": "Wage transparency salary information",
      "type": "object",
      "properties": {
        "salary_row_id": {
          "format": "int32",
          "description": "Salary row ID",
          "type": "integer"
        },
        "form_of_salary_id": {
          "format": "int32",
          "description": "Form of salary ID",
          "type": "integer"
        },
        "form_of_salary_description": {
          "description": "Form of salary description",
          "type": "string"
        },
        "salary_total": {
          "format": "double",
          "description": "Salary row total",
          "type": "number"
        },
        "form_of_salary_attributes": {
          "description": "List of form of salary attributes",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WageTransparencyFormOfSalaryAttribute"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.WageTransparencyFormOfSalaryAttribute": {
      "description": "Form of salary attribute for wage transparency",
      "type": "object",
      "properties": {
        "attribute_id": {
          "format": "int32",
          "description": "Attribute ID",
          "type": "integer"
        },
        "attribute_description": {
          "description": "Attribute description",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PricelistFilter": {
      "description": "Filter for querying pricelists. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Filter pricelists whose description contains this string",
          "type": "string"
        },
        "number": {
          "format": "int32",
          "description": "Filter by pricelist number (exact match)",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "Filter by pricelist type (exact match)",
          "type": "integer"
        },
        "start_date_before": {
          "format": "date-time",
          "description": "Filter pricelists whose start date is on or before this date",
          "type": "string"
        },
        "start_date_after": {
          "format": "date-time",
          "description": "Filter pricelists whose start date is on or after this date",
          "type": "string"
        },
        "end_date_before": {
          "format": "date-time",
          "description": "Filter pricelists whose end date is on or before this date",
          "type": "string"
        },
        "end_date_after": {
          "format": "date-time",
          "description": "Filter pricelists whose end date is on or after this date",
          "type": "string"
        },
        "get_ids": {
          "description": "When true, the response is enriched with customer_register_id and product_register_id values for each pricelist entry",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Pricelist]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Pricelist"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Pricelist": {
      "description": "A pricelist (hinnasto) — defines product pricing for selected customers, products, product groups, supplier discounts, customer group discounts and projects, optionally limited to a date range",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique identifier of the pricelist",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The pricelist number (must be unique on create)",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The pricelist type (hinnastotyyppi)",
          "type": "integer"
        },
        "name": {
          "description": "The pricelist name / description (kuvaus)",
          "type": "string"
        },
        "tax": {
          "format": "int32",
          "description": "The tax handling mode for the pricelist (verokäsittely)",
          "type": "integer"
        },
        "price_info": {
          "description": "Free-text price info attached to the pricelist (hintalisätieto)",
          "type": "string"
        },
        "price": {
          "format": "double",
          "description": "The default price applied across the pricelist when a product-specific price is not set",
          "type": "number"
        },
        "discount": {
          "format": "double",
          "description": "The default percentage discount applied across the pricelist",
          "type": "number"
        },
        "discount2": {
          "format": "double",
          "description": "The default secondary percentage discount applied across the pricelist (alennus 2)",
          "type": "number"
        },
        "customers": {
          "description": "The customers attached to this pricelist",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PricelistCustomer"
          }
        },
        "products": {
          "description": "The products with explicit pricing rules on this pricelist",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PricelistProduct"
          }
        },
        "product_groups": {
          "description": "The product groups with discount rules on this pricelist",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PriceListProductGroup"
          }
        },
        "supplier_discounts": {
          "description": "The supplier-based discount rules on this pricelist",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PricelistSupplierDiscount"
          }
        },
        "customer_group_discounts": {
          "description": "The customer-group-based discount rules on this pricelist",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PricelistCustomerGroupDiscount"
          }
        },
        "start_datetime": {
          "format": "date-time",
          "description": "The first day the pricelist is valid. Null means no lower bound",
          "type": "string"
        },
        "end_datetime": {
          "format": "date-time",
          "description": "The last day the pricelist is valid. Null means no upper bound",
          "type": "string"
        },
        "reference_number": {
          "format": "int32",
          "description": "Reference number used to link the pricelist to other entities (viitenumero)",
          "type": "integer"
        },
        "currency": {
          "description": "The currency code of the pricelist (valuuttakoodi). For possible values, refer to /api/settings/currency/{code}\r\n[here](#tag/Settings/operation/Settings_GetCurrency)",
          "type": "string"
        },
        "profit_type": {
          "format": "int32",
          "description": "The profit calculation mode for the pricelist (katetyyppi)",
          "type": "integer"
        },
        "profit": {
          "format": "double",
          "description": "The profit percentage value used when profit_type is set",
          "type": "number"
        },
        "projects": {
          "description": "The projects attached to this pricelist",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PricelistProject"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PricelistCustomer": {
      "description": "A customer attached to a pricelist",
      "type": "object",
      "properties": {
        "pricelist_id": {
          "format": "int32",
          "description": "The pricelist this customer entry belongs to",
          "type": "integer"
        },
        "customer_id": {
          "format": "int32",
          "description": "The pricelist customer entry id. Use this id when deleting via /pricelists/{id}/customers/{customer_id}",
          "type": "integer"
        },
        "name": {
          "description": "The customer's name as it appears on the pricelist",
          "type": "string"
        },
        "number": {
          "format": "int32",
          "description": "The customer number (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_register_id": {
          "format": "int32",
          "description": "The customer's id in the customer register. Only populated when the list endpoint is called with get_ids=true",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.PricelistProduct": {
      "description": "A product attached to a pricelist with explicit pricing rules",
      "type": "object",
      "properties": {
        "pricelist_id": {
          "format": "int32",
          "description": "The pricelist this product entry belongs to",
          "type": "integer"
        },
        "product_id": {
          "format": "int32",
          "description": "The pricelist product entry id. Use this id when deleting via /pricelists/{id}/products/{product_id}",
          "type": "integer"
        },
        "product_register_id": {
          "format": "int32",
          "description": "The product's id in the product register. Only populated when the list endpoint is called with get_ids=true",
          "type": "integer"
        },
        "code": {
          "description": "The product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "name": {
          "description": "The product's name on the pricelist",
          "type": "string"
        },
        "extra_name": {
          "description": "Additional product name (lisänimi)",
          "type": "string"
        },
        "price": {
          "format": "double",
          "description": "The price applied to this product on the pricelist",
          "type": "number"
        },
        "discount": {
          "format": "double",
          "description": "The discount percentage applied to this product",
          "type": "number"
        },
        "discount2": {
          "format": "double",
          "description": "The secondary discount percentage applied to this product",
          "type": "number"
        },
        "amount": {
          "format": "double",
          "description": "The amount threshold above which the price applies (e.g. bulk pricing)",
          "type": "number"
        },
        "unit": {
          "description": "The unit of measurement for the row",
          "type": "string"
        },
        "is_product_group": {
          "description": "When true, the entry represents a product group rather than a single product",
          "type": "boolean"
        },
        "location_code": {
          "description": "Location code used when pricing depends on a delivery / customer location",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.PriceListProductGroup": {
      "description": "A product group attached to a pricelist with discount rules",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The pricelist product group entry id. Use this id when deleting via /pricelists/{id}/product_groups/{group_id}",
          "type": "integer"
        },
        "pricelist_id": {
          "format": "int32",
          "description": "The pricelist this product group entry belongs to",
          "type": "integer"
        },
        "code": {
          "description": "The product group code (tuoteryhmäkoodi)",
          "type": "string"
        },
        "name": {
          "description": "The product group's name",
          "type": "string"
        },
        "discount": {
          "format": "double",
          "description": "The discount percentage applied to all products in this group",
          "type": "number"
        },
        "discount2": {
          "format": "double",
          "description": "The secondary discount percentage applied to all products in this group",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.PricelistSupplierDiscount": {
      "description": "A supplier-based discount rule attached to a pricelist",
      "type": "object",
      "properties": {
        "pricelist_id": {
          "format": "int32",
          "description": "The pricelist this supplier discount belongs to",
          "type": "integer"
        },
        "discount_id": {
          "format": "int32",
          "description": "The pricelist supplier discount entry id. Use this id when deleting via /pricelists/{id}/supplier_discounts/{discount_id}",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The supplier customer number (toimittajan numero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "discount": {
          "format": "double",
          "description": "The discount percentage applied to products from this supplier",
          "type": "number"
        },
        "discount2": {
          "format": "double",
          "description": "The secondary discount percentage applied to products from this supplier",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.PricelistCustomerGroupDiscount": {
      "description": "A customer-group-based discount rule attached to a pricelist",
      "type": "object",
      "properties": {
        "pricelist_id": {
          "format": "int32",
          "description": "The pricelist this customer group discount belongs to",
          "type": "integer"
        },
        "group_id": {
          "format": "int32",
          "description": "The pricelist customer group discount entry id. Use this id when deleting via /pricelists/{id}/cust_group_discounts/{group_id}",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The customer group number",
          "type": "integer"
        },
        "discount": {
          "format": "double",
          "description": "The discount percentage applied to customers in this group",
          "type": "number"
        },
        "discount2": {
          "format": "double",
          "description": "The secondary discount percentage applied to customers in this group",
          "type": "number"
        },
        "name": {
          "description": "The customer group's name",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.PricelistProject": {
      "description": "A project attached to a pricelist",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The pricelist project entry id. Use this id when deleting via /pricelists/{id}/projects/{project_id}",
          "type": "integer"
        },
        "pricelist_id": {
          "format": "int32",
          "description": "The pricelist this project belongs to",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ProductPriceFilter": {
      "description": "Filter for the /pricelists/{id}/{product_code} product price lookup",
      "required": [
        "list_valid_date"
      ],
      "type": "object",
      "properties": {
        "list_valid_date": {
          "format": "date-time",
          "description": "The date used to determine which pricelist entries are valid (required)",
          "type": "string"
        },
        "product_unit": {
          "description": "Optional unit of measurement to scope the price lookup",
          "type": "string"
        },
        "cust_no": {
          "format": "int32",
          "description": "Optional customer number to apply customer-specific pricing rules. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductPrice]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProductPrice"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductPrice": {
      "description": "Computed price of a product, returned by /pricelists/{id}/{product_code}",
      "type": "object",
      "properties": {
        "price": {
          "format": "double",
          "description": "The base price from the pricelist (before discounts)",
          "type": "number"
        },
        "discount": {
          "format": "double",
          "description": "The discount percentage applied to the base price",
          "type": "number"
        },
        "discount2": {
          "format": "double",
          "description": "The secondary discount percentage applied to the base price",
          "type": "number"
        },
        "price_with_discount_no_tax": {
          "format": "double",
          "description": "The final price with discounts, excluding tax",
          "type": "number"
        },
        "price_with_discount_and_tax": {
          "format": "double",
          "description": "The final price with discounts, including tax",
          "type": "number"
        },
        "taxrate": {
          "format": "double",
          "description": "The tax rate applied to the price (in percent)",
          "type": "number"
        },
        "info": {
          "description": "Free-text price info from the pricelist",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Pricelist]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Pricelist"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ProductFilter": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "sku": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "ean": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "modified_before": {
          "format": "date-time",
          "type": "string"
        },
        "modified_after": {
          "format": "date-time",
          "type": "string"
        },
        "attribute_id": {
          "format": "int32",
          "type": "integer"
        },
        "extra_name": {
          "type": "string"
        },
        "category_id": {
          "format": "int32",
          "type": "integer"
        },
        "group_code": {
          "type": "string"
        },
        "group_codes": {
          "description": "Filter products by one or more product group codes (exact match). Multiple values are OR-ed together.",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "show_models": {
          "type": "boolean"
        },
        "show_nonactive": {
          "type": "boolean"
        },
        "show_nonstock": {
          "type": "boolean"
        },
        "include_pricing": {
          "description": "Control whether to include pricing information in the response",
          "type": "boolean"
        },
        "shelf": {
          "type": "string"
        },
        "shelf_stock": {
          "format": "int32",
          "type": "integer"
        },
        "stock": {
          "format": "int32",
          "type": "integer"
        },
        "sort_by_sku": {
          "type": "boolean"
        },
        "sort_desc": {
          "description": "Sorting order. Default is ascending (false). Works with sort_by_sku.",
          "type": "boolean"
        },
        "search_words": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "is_sales": {
          "description": "Vain myytävät tuotteet",
          "type": "boolean"
        },
        "is_purchase": {
          "description": "Vain ostettavat tuotteet",
          "type": "boolean"
        },
        "only_with_balance": {
          "description": "Vain saldolliset",
          "type": "boolean"
        },
        "only_below_alert_level": {
          "description": "Only products below alert level. Requires stock filter to be set.",
          "type": "boolean"
        },
        "search_from_additional_eancodes": {
          "description": "Search by searchword from additional EAN codes as well",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Product]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Product"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Product": {
      "description": "The main product model",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product",
          "type": "integer"
        },
        "name": {
          "description": "The name of the product",
          "type": "string"
        },
        "extra_name": {
          "description": "Additional name information for the product",
          "type": "string"
        },
        "sku": {
          "description": "The stock keeping unit (SKU) code for the product",
          "type": "string"
        },
        "price": {
          "format": "double",
          "description": "The price of the product",
          "type": "number"
        },
        "price_includes_tax": {
          "description": "Indicates if the product price includes tax",
          "type": "boolean"
        },
        "texts": {
          "description": "The text content associated with the product",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductText"
          }
        },
        "units": {
          "description": "The units associated with the product",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductUnit"
          }
        },
        "dimensions": {
          "description": "The dimensions of the product",
          "type": "string"
        },
        "is_inactive": {
          "description": "Indicates if the product is inactive",
          "type": "boolean"
        },
        "is_non_stock": {
          "description": "Indicates if the product is not stocked",
          "type": "boolean"
        },
        "is_sellable": {
          "description": "Indicates if the product can be sold",
          "type": "boolean"
        },
        "is_purchase_product": {
          "description": "Indicates if the product can be purchased",
          "type": "boolean"
        },
        "search_code": {
          "description": "The search code for the product",
          "type": "string"
        },
        "size_type": {
          "format": "int32",
          "description": "The size type of the product",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The type of the product",
          "type": "integer"
        },
        "type_description": {
          "description": "The description of the product type",
          "type": "string"
        },
        "stock_unit": {
          "description": "The stock unit of the product (e.g., \"kpl\", \"kg\", \"m\")",
          "type": "string"
        },
        "sales_price_taxful": {
          "format": "double",
          "description": "The sales price including tax",
          "type": "number"
        },
        "sales_price_taxless": {
          "format": "double",
          "description": "The sales price excluding tax",
          "type": "number"
        },
        "sales_account": {
          "description": "The sales account for the product (myyntitili)",
          "type": "string"
        },
        "payment_account": {
          "description": "The payment account for the product (suoritustili)",
          "type": "string"
        },
        "productline_code": {
          "format": "int32",
          "description": "The product line code for the product (tuotelinjakoodi)",
          "type": "integer"
        },
        "best_before": {
          "format": "int32",
          "description": "The best before time in days for the product (parasta ennen)",
          "type": "integer"
        },
        "pefc_class": {
          "format": "int32",
          "description": "The pefc class for the product (pefc-luokka)",
          "type": "integer"
        },
        "stock_saldo_type": {
          "format": "int32",
          "description": "Specifies how the stock balance is handled:\r\n0 = Negative stock balances are allowed.\r\n1 = Negative stock balances are allowed, but a warning is issued or logged.\r\n2 = Negative stock balances are not allowed.",
          "type": "integer"
        },
        "kaukeva_group": {
          "description": "Kaukeva grouping information",
          "type": "string"
        },
        "taxrate_code": {
          "format": "int32",
          "description": "The tax rate code for the product",
          "type": "integer"
        },
        "cost_center": {
          "description": "THe cost center for the product (kustannuspaikka)",
          "type": "string"
        },
        "unit_id": {
          "format": "int32",
          "description": "The unit id for the product",
          "type": "integer"
        },
        "color_code": {
          "format": "int32",
          "description": "The color code for the product",
          "type": "integer"
        },
        "mark_code": {
          "format": "int32",
          "description": "The mark code for the product",
          "type": "integer"
        },
        "model_code": {
          "format": "int32",
          "description": "The model code for the product",
          "type": "integer"
        },
        "person_responsible_number": {
          "format": "int32",
          "description": "The person number responsible for the product",
          "type": "integer"
        },
        "stocks": {
          "description": "The stock information for the product",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStock"
          }
        },
        "cn_code": {
          "description": "The CN code for the product (CN-nimike)",
          "type": "string"
        },
        "ean_code": {
          "description": "The European Article Number (EAN) code for the product",
          "type": "string"
        },
        "group_code": {
          "format": "int32",
          "description": "The group code for the product",
          "type": "integer"
        },
        "ser_code": {
          "format": "int32",
          "description": "The ser code for the product (veroluokka)",
          "type": "integer"
        },
        "height": {
          "format": "int32",
          "description": "The height of the product",
          "type": "integer"
        },
        "length": {
          "format": "int32",
          "description": "The length of the product",
          "type": "integer"
        },
        "width": {
          "format": "int32",
          "description": "The width of the product",
          "type": "integer"
        },
        "manufacturer": {
          "format": "int32",
          "description": "The manufacturer code for the product",
          "type": "integer"
        },
        "origin": {
          "description": "The country of origin for the product (alkuperämaa)",
          "type": "string"
        },
        "reference": {
          "description": "The reference for the product (viite)",
          "type": "string"
        },
        "warranty": {
          "format": "int32",
          "description": "The warranty period in months for the product",
          "type": "integer"
        },
        "version": {
          "description": "The version of the product",
          "type": "string"
        },
        "drawing_number": {
          "description": "The drawing number for the product",
          "type": "string"
        },
        "machine": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProductMachine",
          "description": "The machine information for the product (työpiste)"
        },
        "attribute_data": {
          "description": "The attribute data for the product",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductAttributeData"
          }
        },
        "suppliers": {
          "description": "The suppliers for the product",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductSupplier"
          }
        },
        "languages": {
          "description": "The languages for the product",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductLanguage"
          }
        },
        "attributes": {
          "description": "The attributes for the product",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductAttribute"
          }
        },
        "categories": {
          "description": "The categories for the product",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductCategory"
          }
        },
        "is_serialnumber_followup": {
          "description": "Indicates if the product has serial number tracking",
          "type": "boolean"
        },
        "serialnumber_type": {
          "format": "int32",
          "description": "The type of serial number tracking",
          "type": "integer"
        },
        "is_batchfollowup": {
          "description": "Indicates if the product has batch tracking",
          "type": "boolean"
        },
        "links": {
          "description": "The links associated with the product",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
          }
        },
        "abc": {
          "format": "int32",
          "description": "The ABC classification of the product",
          "type": "integer"
        },
        "vak": {
          "description": "Delivery information for the product (kuljetustietoja)",
          "type": "string"
        },
        "un": {
          "description": "The un number for the product (yk-numero)",
          "type": "string"
        },
        "handedness": {
          "description": "The handedness of the product (kätisyys)",
          "type": "string"
        },
        "material": {
          "description": "The material of the product (materiaali)",
          "type": "string"
        },
        "family": {
          "format": "int32",
          "description": "The product family the product belongs to (tuoteperhe)",
          "type": "integer"
        },
        "lta": {
          "description": "The LTA code for the product",
          "type": "string"
        },
        "pricing": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProductPricing",
          "description": "The pricing information for the product"
        },
        "purchase_account": {
          "description": "The purchase account for the product (ostotili)",
          "type": "string"
        },
        "purchase_account_tax_rate": {
          "format": "double",
          "description": "The tax rate for the purchase account",
          "type": "number"
        },
        "default_discount": {
          "format": "double",
          "description": "The default discount percentage for the product",
          "type": "number"
        },
        "adr_name": {
          "description": "The name of the dangerous goods product",
          "type": "string"
        },
        "adr_class": {
          "description": "The class of the dangerous goods product",
          "type": "string"
        },
        "adr_packagegroup": {
          "description": "Packagegroup of dangerous goods product(I,II,III)",
          "type": "string"
        },
        "adr_net_weight": {
          "format": "double",
          "description": "The weight of the dangerous goods product",
          "type": "number"
        },
        "adr_label": {
          "description": "The label of the dangerous goods product",
          "type": "string"
        },
        "adr_tunnelcode": {
          "description": "The tunnel code of the dangerous goods product",
          "type": "string"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number of the product",
          "type": "integer"
        },
        "adr_limited_quantity": {
          "description": "Indicates if the dangerous goods product is of limited quantity",
          "type": "boolean"
        },
        "refrigerant": {
          "format": "int32",
          "description": "The refrigerant of the product",
          "type": "integer"
        },
        "refrigerant_amount_kg": {
          "format": "double",
          "description": "The amount of refrigerant in kilos",
          "type": "number"
        },
        "refrigeration_unit_type": {
          "format": "int32",
          "description": "The refrigeration unit type of the product",
          "type": "integer"
        },
        "exp_price": {
          "format": "double",
          "description": "The expense price of the product (kuluhinta)",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductText": {
      "description": "Text content associated with a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product text",
          "type": "integer"
        },
        "language_code": {
          "description": "The language code in ISO 639‑3 format",
          "type": "string"
        },
        "header_number": {
          "format": "int32",
          "description": "The header number for organizing text content",
          "type": "integer"
        },
        "text": {
          "description": "The text content with formatting (RTF)",
          "type": "string"
        },
        "text_plain": {
          "description": "The text content without formatting",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductUnit": {
      "description": "Unit information for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product unit",
          "type": "integer"
        },
        "product_id": {
          "format": "int32",
          "description": "The id of the product this unit belongs to",
          "type": "integer"
        },
        "package": {
          "format": "double",
          "description": "The package size",
          "type": "number"
        },
        "unit": {
          "description": "The unit of measurement (e.g., \"kpl\", \"kg\", \"m\")",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount in this unit",
          "type": "number"
        },
        "code": {
          "description": "The code for this unit",
          "type": "string"
        },
        "default_amount": {
          "format": "double",
          "description": "The default amount for this unit",
          "type": "number"
        },
        "discount": {
          "format": "double",
          "description": "The discount percentage for this unit",
          "type": "number"
        },
        "price": {
          "format": "double",
          "description": "The price for this unit",
          "type": "number"
        },
        "price_per": {
          "format": "double",
          "description": "The price per unit",
          "type": "number"
        },
        "use_for_pricing": {
          "description": "Indicates if this unit is used for pricing",
          "type": "boolean"
        },
        "use_for_purchase": {
          "description": "Indicates if this unit is used for purchasing",
          "type": "boolean"
        },
        "use_for_sales": {
          "description": "Indicates if this unit is used for sales",
          "type": "boolean"
        },
        "use_for_stock": {
          "description": "Indicates if this unit is used for stock",
          "type": "boolean"
        },
        "volume": {
          "format": "double",
          "description": "The volume of this unit",
          "type": "number"
        },
        "weight": {
          "format": "double",
          "description": "The weight of this unit",
          "type": "number"
        },
        "package_weight": {
          "format": "double",
          "description": "The weight of the package",
          "type": "number"
        },
        "use_intrastat": {
          "description": "Indicates if this unit is used for intrastat reporting",
          "type": "boolean"
        },
        "intrastat_amount": {
          "format": "double",
          "description": "The amount used for intrastat reporting",
          "type": "number"
        },
        "default_amount_purchase": {
          "format": "double",
          "description": "The default amount for purchasing",
          "type": "number"
        },
        "default_amount_production": {
          "format": "double",
          "description": "The default amount for production",
          "type": "number"
        },
        "handling_cost_id": {
          "format": "int32",
          "description": "The handling cost id for this unit. The possible values are defined in the codelists (nimikkeiden yksiköiden kustannukset)",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductStock": {
      "description": "Stock information for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product stock",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The stock number",
          "type": "integer"
        },
        "free_saldo": {
          "format": "double",
          "description": "The free balance in stock",
          "type": "number"
        },
        "saldo_incoming": {
          "format": "double",
          "description": "The incoming balance in stock",
          "type": "number"
        },
        "saldo_out": {
          "format": "double",
          "description": "The outgoing balance in stock",
          "type": "number"
        },
        "is_default": {
          "description": "Indicates if this is the default stock location",
          "type": "boolean"
        },
        "in_stock": {
          "format": "double",
          "description": "The current amount in stock",
          "type": "number"
        },
        "in_stock_min": {
          "format": "double",
          "description": "The minimum amount to keep in stock",
          "type": "number"
        },
        "Stock_inward": {
          "format": "double",
          "description": "The amount of stock coming in",
          "type": "number"
        },
        "stock_outward": {
          "format": "double",
          "description": "The amount of stock going out",
          "type": "number"
        },
        "stock_outward_production": {
          "format": "double",
          "description": "The amount of stock going out for production",
          "type": "number"
        },
        "previous_shelf": {
          "description": "The previous shelf location",
          "type": "string"
        },
        "stock_description": {
          "description": "The description of the stock location",
          "type": "string"
        },
        "stock_average_prchase_price": {
          "format": "double",
          "description": "The average purchase price for the stock",
          "type": "number"
        },
        "stock_inventory_date": {
          "format": "date-time",
          "description": "The date of the last inventory count",
          "type": "string"
        },
        "stock_shelf_type": {
          "format": "int32",
          "description": "The type of shelf in the stock location",
          "type": "integer"
        },
        "sizes": {
          "description": "The sizes available in this stock location",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Size"
          }
        },
        "shelves": {
          "description": "The shelves in this stock location",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockShelf"
          }
        },
        "product_id": {
          "format": "int32",
          "description": "The id of the product this stock information belongs to",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code for this stock information",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductMachine": {
      "description": "Machine information for a product",
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductAttributeData": {
      "description": "Attribute data for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product attribute data",
          "type": "integer"
        },
        "name": {
          "description": "The name of the attribute",
          "type": "string"
        },
        "product_id": {
          "format": "int32",
          "description": "The id of the product this attribute belongs to",
          "type": "integer"
        },
        "codelist_id": {
          "format": "int32",
          "description": "The id of the codelist this attribute belongs to",
          "type": "integer"
        },
        "value": {
          "format": "double",
          "description": "The value of the attribute",
          "type": "number"
        },
        "min": {
          "format": "double",
          "description": "The minimum allowed value for the attribute",
          "type": "number"
        },
        "max": {
          "format": "double",
          "description": "The maximum allowed value for the attribute",
          "type": "number"
        },
        "type": {
          "format": "int32",
          "description": "The type of the attribute",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductSupplier": {
      "description": "Supplier information for a product",
      "type": "object",
      "properties": {
        "supplier_id": {
          "format": "int32",
          "description": "The id of the supplier",
          "type": "integer"
        },
        "product_id": {
          "format": "int32",
          "description": "The id of the product this supplier information belongs to",
          "type": "integer"
        },
        "name": {
          "description": "The name of the supplier",
          "type": "string"
        },
        "is_default": {
          "description": "Indicates if this is the default supplier for the product",
          "type": "boolean"
        },
        "number": {
          "format": "int32",
          "description": "The supplier number",
          "type": "integer"
        },
        "code": {
          "description": "The supplier's product code",
          "type": "string"
        },
        "delivery_days": {
          "format": "int32",
          "description": "The number of days for delivery",
          "type": "integer"
        },
        "note": {
          "description": "Additional notes about the supplier",
          "type": "string"
        },
        "url": {
          "description": "The URL associated with this supplier",
          "type": "string"
        },
        "description": {
          "description": "The description of the supplier",
          "type": "string"
        },
        "description2": {
          "description": "Additional description field for the supplier",
          "type": "string"
        },
        "price": {
          "format": "double",
          "description": "The price from this supplier",
          "type": "number"
        },
        "stock_amount": {
          "format": "double",
          "description": "The amount in stock from this supplier",
          "type": "number"
        },
        "purchase_price": {
          "format": "double",
          "description": "The purchase price from this supplier",
          "type": "number"
        },
        "purchase_price_in_currency": {
          "format": "double",
          "description": "The purchase price in the supplier's currency",
          "type": "number"
        },
        "currency_code": {
          "description": "The currency code in ISO 4217 format",
          "type": "string"
        },
        "discount": {
          "format": "double",
          "description": "The discount percentage from this supplier",
          "type": "number"
        },
        "discount_code": {
          "description": "The discount code from this supplier",
          "type": "string"
        },
        "price_update_date": {
          "format": "date-time",
          "description": "The date when the price was last updated",
          "type": "string"
        },
        "stock_date": {
          "format": "date-time",
          "description": "The date when the stock amount was last updated",
          "type": "string"
        },
        "origin": {
          "description": "The country of origin for the product from this supplier",
          "type": "string"
        },
        "pricefactor_orders": {
          "format": "double",
          "description": "The price factor for orders from this supplier",
          "type": "number"
        },
        "pricefactor_purchase_invoices": {
          "format": "double",
          "description": "The price factor for purchase invoices from this supplier",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductLanguage": {
      "description": "The language information for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product language",
          "type": "integer"
        },
        "product_id": {
          "format": "int32",
          "description": "The id of the product this language information belongs to",
          "type": "integer"
        },
        "code": {
          "description": "The language code in ISO 639‑3 format (\"FIN\", \"ENG\", \"SWE\")",
          "type": "string"
        },
        "name": {
          "description": "The product name in this language",
          "type": "string"
        },
        "extra_name": {
          "description": "Additional name information in this language",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductAttribute": {
      "description": "Attribute information for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product attribute",
          "type": "integer"
        },
        "name": {
          "description": "The name of the attribute",
          "type": "string"
        },
        "selected": {
          "description": "Indicates if this attribute is selected",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductCategory": {
      "description": "Category information for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product category",
          "type": "integer"
        },
        "parent_id": {
          "format": "int32",
          "description": "The id of the parent category",
          "type": "integer"
        },
        "name": {
          "description": "The name of the category",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The type of the category",
          "type": "integer"
        },
        "is_web": {
          "description": "Indicates if this category is visible on the web",
          "type": "boolean"
        },
        "is_member": {
          "description": "Indicates if the product belongs to this category. Nullable so that a PATCH can tell an explicit\r\nfalse (remove the membership) apart from an omitted field (leave the membership as it is).",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductPricing": {
      "description": "Product pricing information",
      "type": "object",
      "properties": {
        "average_price": {
          "format": "double",
          "description": "The average price for the product",
          "type": "number"
        },
        "previous_price": {
          "format": "double",
          "description": "The previous price for the product",
          "type": "number"
        },
        "previous_purchase_price": {
          "format": "double",
          "description": "The previous purchase price for the product",
          "type": "number"
        },
        "net_price": {
          "format": "double",
          "description": "The net price for the product",
          "type": "number"
        },
        "profit_min": {
          "format": "double",
          "description": "The minimum profit for the product (minimikate)",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.Size": {
      "description": "Size information for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the size",
          "type": "integer"
        },
        "stock_id": {
          "format": "int32",
          "description": "The id of the stock this size belongs to",
          "type": "integer"
        },
        "size": {
          "description": "The size code (e.g., \"S\", \"M\", \"L\", \"XL\")",
          "type": "string"
        },
        "in_stock": {
          "format": "double",
          "description": "The current amount in stock for this size",
          "type": "number"
        },
        "in_stock_min": {
          "format": "double",
          "description": "The minimum amount to keep in stock for this size",
          "type": "number"
        },
        "inward": {
          "format": "double",
          "description": "The amount of stock coming in for this size",
          "type": "number"
        },
        "outward": {
          "format": "double",
          "description": "The amount of stock going out for this size",
          "type": "number"
        },
        "sort_order": {
          "format": "int32",
          "description": "The sorting order for this size",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.StockShelf": {
      "description": "Shelf information in a stock location",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the stock shelf",
          "type": "integer"
        },
        "product_id": {
          "format": "int32",
          "description": "The id of the product this shelf belongs to",
          "type": "integer"
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock number this shelf belongs to",
          "type": "integer"
        },
        "stock_shelf": {
          "description": "The shelf code",
          "type": "string"
        },
        "in_stock": {
          "format": "double",
          "description": "The amount currently in stock on this shelf",
          "type": "number"
        },
        "in_date": {
          "format": "date-time",
          "description": "The date when the stock was added to this shelf (Ed. Tulopäivä)",
          "type": "string"
        },
        "out_date": {
          "format": "date-time",
          "description": "The date when the stock was last removed from this shelf (Ed. ottopäivä)",
          "type": "string"
        },
        "inventory_tmp": {
          "format": "double",
          "description": "The temporary inventory count",
          "type": "number"
        },
        "inventory_bit": {
          "description": "Indicates if this shelf has been inventoried",
          "type": "boolean"
        },
        "inventory_date": {
          "format": "date-time",
          "description": "The date of the last inventory",
          "type": "string"
        },
        "shelf_type": {
          "format": "int32",
          "description": "The type of shelf",
          "type": "integer"
        },
        "shelf_instock_min": {
          "format": "double",
          "description": "The minimum amount to keep on this shelf",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Product]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Product"
        }
      }
    },
    "Microsoft.AspNetCore.JsonPatch.JsonPatchDocument[LemonRest.Models.Proxy.Product]": {
      "type": "object",
      "properties": {
        "Operations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Microsoft.AspNetCore.JsonPatch.Operations.Operation[LemonRest.Models.Proxy.Product]"
          },
          "readOnly": true
        }
      }
    },
    "Microsoft.AspNetCore.JsonPatch.Operations.Operation[LemonRest.Models.Proxy.Product]": {
      "type": "object",
      "properties": {
        "value": {
          "type": "object"
        },
        "path": {
          "type": "string"
        },
        "op": {
          "type": "string"
        },
        "from": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.LinkFilter": {
      "description": "Filter for querying project links. Inherits page and page_size from PageFilter.",
      "type": "object",
      "properties": {
        "updated_after": {
          "format": "date-time",
          "description": "Filter links updated on or after this date",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Filter links updated on or before this date",
          "type": "string"
        },
        "description": {
          "description": "Filter links whose description contains the given text",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Link]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.ProductGroupFilter": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "web_only": {
          "type": "boolean"
        },
        "parent_id": {
          "format": "int32",
          "type": "integer"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductGroup]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductGroup"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductGroup": {
      "description": "Group information for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product group",
          "type": "integer"
        },
        "parent_id": {
          "format": "int32",
          "description": "The id of the parent group",
          "type": "integer"
        },
        "name": {
          "description": "The name of the group",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The type of the group",
          "type": "integer"
        },
        "is_web": {
          "description": "Indicates if this group is visible on the web",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ProductCategoryFilter": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "web_only": {
          "type": "boolean"
        },
        "parent_id": {
          "format": "int32",
          "type": "integer"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductCategory]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductCategory"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.ProductSerialFilter": {
      "type": "object",
      "properties": {
        "serial_code": {
          "type": "string"
        },
        "father_serial": {
          "type": "string"
        },
        "stock": {
          "format": "int32",
          "type": "integer"
        },
        "in_stock": {
          "type": "boolean"
        },
        "only_empty": {
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.StockTransactionSerialNumber]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionSerialNumber"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.ProductBatchFilter": {
      "type": "object",
      "properties": {
        "supplier_code": {
          "type": "string"
        },
        "stock": {
          "format": "int32",
          "type": "integer"
        },
        "in_stock": {
          "type": "boolean"
        },
        "shelf": {
          "type": "string"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.StockTransactionBatch]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.StockTransactionBatch": {
      "description": "Batch information for a stock transaction",
      "type": "object",
      "properties": {
        "batchnr_amount": {
          "format": "double",
          "description": "The amount of the batch",
          "type": "number"
        },
        "batchnr_best_before": {
          "format": "date-time",
          "description": "The best before date for the batch",
          "type": "string"
        },
        "batchnr_dimension": {
          "description": "The dimension information for the batch",
          "type": "string"
        },
        "batchnr_height": {
          "format": "int32",
          "description": "The height of the batch",
          "type": "integer"
        },
        "batchnr_id": {
          "format": "int32",
          "description": "The unique id of the batch",
          "type": "integer"
        },
        "batchnr_info1": {
          "description": "Additional information field 1 for the batch",
          "type": "string"
        },
        "batchnr_info2": {
          "description": "Additional information field 2 for the batch",
          "type": "string"
        },
        "batchnr_info3": {
          "description": "Additional information field 3 for the batch",
          "type": "string"
        },
        "batchnr_info4": {
          "description": "Additional information field 4 for the batch",
          "type": "string"
        },
        "batchnr_length": {
          "format": "int32",
          "description": "The length of the batch",
          "type": "integer"
        },
        "batchnr_product_code": {
          "description": "The product code for this batch",
          "type": "string"
        },
        "batchnr_saldo": {
          "format": "double",
          "description": "The balance of the batch",
          "type": "number"
        },
        "batchnr_state": {
          "format": "int32",
          "description": "The state of the batch",
          "type": "integer"
        },
        "batchnr_suppliercode": {
          "description": "The supplier code for the batch",
          "type": "string"
        },
        "batchnr_tmp_amount": {
          "format": "double",
          "description": "The temporary amount for the batch",
          "type": "number"
        },
        "batchnr_width": {
          "format": "int32",
          "description": "The width of the batch",
          "type": "integer"
        },
        "stock_transaction_id": {
          "format": "int32",
          "description": "The id of the stock transaction this batch belongs to",
          "type": "integer"
        },
        "batchnr_stock_number": {
          "format": "int32",
          "description": "The stock number for this batch",
          "type": "integer"
        },
        "batchnr_stock_shelf": {
          "description": "The shelf code for this batch",
          "type": "string"
        },
        "batchnr_pallet_id": {
          "format": "int32",
          "description": "The pallet id for this batch",
          "type": "integer"
        },
        "batchnr_inventory_tmp": {
          "format": "double",
          "description": "The temporary inventory count for this batch",
          "type": "number"
        },
        "batchno_inventory_bit": {
          "description": "Indicates if this batch has been inventoried",
          "type": "boolean"
        },
        "worknumber": {
          "format": "int32",
          "description": "Production worknumber for this batch",
          "type": "integer"
        },
        "dd_statement": {
          "description": "Due diligence statement",
          "type": "string"
        },
        "dd_statement_ref": {
          "description": "Due diligence statement refence number",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProgramImageEncoded]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProgramImageEncoded"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProgramImageEncoded": {
      "description": "A program image variant where the image data is delivered as a Base64-encoded string instead of raw bytes",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The program image id",
          "type": "integer"
        },
        "object_id": {
          "format": "int32",
          "description": "The LemonSoft application id identifying the source entity type",
          "type": "integer"
        },
        "data_id": {
          "format": "int32",
          "description": "The id of the source record within the application context",
          "type": "integer"
        },
        "description": {
          "description": "The image description",
          "type": "string"
        },
        "prefix": {
          "description": "The image filename prefix",
          "type": "string"
        },
        "base64_encoded_bytes": {
          "description": "The image contents as a Base64-encoded string",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The program image type",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Product]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Product"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductGTINCode]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductGTINCode"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductGTINCode": {
      "description": "Product GTIN code information",
      "type": "object",
      "properties": {
        "ean_code": {
          "description": "The European Article Number (EAN) code for the product",
          "type": "string"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number for the product",
          "type": "integer"
        },
        "unit": {
          "description": "The unit for the product",
          "type": "string"
        },
        "additional_code": {
          "description": "The additional code for the product",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[System.Collections.Generic.IEnumerable[LemonRest.Models.Proxy.ProductStock]]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStock"
          }
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStock]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStock"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductBase]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductBase"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductBase": {
      "description": "Base product information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product",
          "type": "integer"
        },
        "sku": {
          "description": "The stock keeping unit (SKU) code for the product",
          "type": "string"
        },
        "search_code": {
          "description": "The search code for the product",
          "type": "string"
        },
        "name": {
          "description": "The name of the product",
          "type": "string"
        },
        "name2": {
          "description": "Additional name information for the product",
          "type": "string"
        },
        "ean_code": {
          "description": "The European Article Number (EAN) code for the product",
          "type": "string"
        },
        "price": {
          "format": "double",
          "description": "The price of the product",
          "type": "number"
        },
        "price_includes_tax": {
          "description": "Indicates if the product price includes tax",
          "type": "boolean"
        },
        "default_discount": {
          "format": "double",
          "description": "The default discount percentage for the product",
          "type": "number"
        },
        "group_code": {
          "format": "int32",
          "description": "The group code for the product",
          "type": "integer"
        },
        "is_serialnumber_followup": {
          "description": "Indicates if the product has serial number tracking",
          "type": "boolean"
        },
        "is_batchfollowup": {
          "description": "Indicates if the product has batch tracking",
          "type": "boolean"
        },
        "serialnumber_type": {
          "format": "int32",
          "description": "The type of serial number tracking",
          "type": "integer"
        },
        "size_type": {
          "format": "int32",
          "description": "The size type of the product",
          "type": "integer"
        },
        "color_code": {
          "format": "int32",
          "description": "The color code for the product",
          "type": "integer"
        },
        "stock_saldo_type": {
          "format": "int32",
          "description": "The type of stock balance calculation",
          "type": "integer"
        },
        "dimension_info": {
          "description": "The dimension information for the product",
          "type": "string"
        },
        "pricing": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProductBasePricing",
          "description": "The pricing information for the product"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductBasePricing": {
      "description": "Extended product pricing information for the base endpoint",
      "type": "object",
      "properties": {
        "exp_price": {
          "format": "double",
          "description": "The expense price for the product (kuluhinta)",
          "type": "number"
        },
        "average_price": {
          "format": "double",
          "description": "The average price for the product",
          "type": "number"
        },
        "previous_price": {
          "format": "double",
          "description": "The previous price for the product",
          "type": "number"
        },
        "previous_purchase_price": {
          "format": "double",
          "description": "The previous purchase price for the product",
          "type": "number"
        },
        "net_price": {
          "format": "double",
          "description": "The net price for the product",
          "type": "number"
        },
        "profit_min": {
          "format": "double",
          "description": "The minimum profit for the product (minimikate)",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[System.Decimal]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "format": "double",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ProductSaldoFilter": {
      "required": [
        "updated_after"
      ],
      "type": "object",
      "properties": {
        "updated_after": {
          "format": "date-time",
          "description": "Timestamp after product saldo should have changed",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductPreStockOut]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductPreStockOut"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductPreStockOut": {
      "description": "Pre-stock out information for a product",
      "type": "object",
      "properties": {
        "delivery_date": {
          "format": "date-time",
          "description": "The date when the delivery is expected",
          "type": "string"
        },
        "running_amount": {
          "format": "double",
          "description": "The running total amount",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductStock]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStock"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.MainStructureOriginUpdate": {
      "description": "Update information for a main structure origin",
      "type": "object",
      "properties": {
        "substructure_rows": {
          "description": "The substructure rows",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SubstructureFull"
          }
        },
        "product_code": {
          "description": "The product code",
          "type": "string"
        },
        "main_structure_id": {
          "format": "int32",
          "description": "The main structure's id",
          "type": "integer"
        },
        "work_number": {
          "format": "int32",
          "description": "The work number associated with the structure",
          "type": "integer"
        },
        "product_description": {
          "description": "The description of the product",
          "type": "string"
        },
        "product_description2": {
          "description": "Additional description for the product",
          "type": "string"
        },
        "handling": {
          "format": "int32",
          "description": "The handling type. Possible values are:\r\n  1 = Manufacturing (Valmistus): Used for manufacturing processes.\r\n  2 = Packet (Paketti): Represents a packaged product.\r\n  3 = Configurator (Tuotekonfiguraattori): Indicates a product configurator.\r\n  4 = ManufacturingPacket (Valmistus-paketti): Combines manufacturing and packet processes.\r\n  5 = ConfiguratorNewProduct (Tuotekonfiguraattori, uusi tuote): A new product created through a configurator.\r\n  6 = SalesPacket (Myyntipaketti): Represents a sales package.\r\n  7 = SalesManufacturing (Myyntirakenne): A sales-related product structure.",
          "type": "integer"
        },
        "price_type": {
          "format": "int32",
          "description": "The type of pricing",
          "type": "integer"
        },
        "all_levels_bit": {
          "description": "Indicates if all levels should be included",
          "type": "boolean"
        },
        "amount": {
          "format": "double",
          "description": "The amount for the structure",
          "type": "number"
        },
        "stock": {
          "format": "int32",
          "description": "The stock number",
          "type": "integer"
        },
        "dimension": {
          "description": "The dimension information",
          "type": "string"
        },
        "color": {
          "format": "int32",
          "description": "The color code",
          "type": "integer"
        },
        "structure_no_update_attributes": {
          "description": "The attributes that should not be updated in the structure",
          "type": "string"
        },
        "info1": {
          "description": "Additional information field 1",
          "type": "string"
        },
        "info2": {
          "description": "Additional information field 2",
          "type": "string"
        },
        "reservation_application": {
          "format": "int32",
          "description": "Reservation application type (Materiaalivaraus). Determines which application reserves materials for the structure.\r\nAllowed values:\r\n  0  = Default (oletus)\r\n  7  = Offer (Tarjous)\r\n  8  = SalesOrder (Myyntitilaus)\r\n  12 = Production (Tuotanto)\r\nOmit the field (or send null) to keep the existing value unchanged on PUT/POST. Sending an explicit\r\n0 resets the value to Default.",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.SubstructureFull": {
      "description": "Full information for a sub-structure",
      "type": "object",
      "properties": {
        "sub_structure_id": {
          "format": "int32",
          "description": "The id of the sub-structure",
          "type": "integer"
        },
        "main_structure_id": {
          "format": "int32",
          "description": "The id of the main structure this sub-structure belongs to",
          "type": "integer"
        },
        "product_description": {
          "description": "The description of the product",
          "type": "string"
        },
        "product_description2": {
          "description": "Additional description for the product",
          "type": "string"
        },
        "dimension": {
          "description": "The dimension information",
          "type": "string"
        },
        "info1": {
          "description": "Additional information field 1",
          "type": "string"
        },
        "info2": {
          "description": "Additional information field 2",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount for the structure",
          "type": "number"
        },
        "amount2": {
          "format": "double",
          "description": "The secondary amount for the structure",
          "type": "number"
        },
        "per": {
          "format": "int32",
          "description": "The per value",
          "type": "integer"
        },
        "unit": {
          "description": "The unit of measurement",
          "type": "string"
        },
        "waste": {
          "format": "double",
          "description": "The waste percentage",
          "type": "number"
        },
        "stock": {
          "format": "int32",
          "description": "The stock number",
          "type": "integer"
        },
        "row": {
          "format": "int32",
          "description": "The row number in the structure",
          "type": "integer"
        },
        "level": {
          "format": "int32",
          "description": "The level in the structure hierarchy",
          "type": "integer"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number",
          "type": "integer"
        },
        "passive_bit": {
          "description": "Indicates if this structure is passive",
          "type": "boolean"
        },
        "configure_attribute": {
          "format": "int32",
          "description": "The configure attribute for the sub-structure",
          "type": "integer"
        },
        "color": {
          "description": "The color value",
          "type": "string"
        },
        "note": {
          "description": "Additional notes for the sub-structure",
          "type": "string"
        },
        "askamount": {
          "description": "Indicates if amount should be asked",
          "type": "boolean"
        },
        "netprice": {
          "format": "double",
          "description": "The net price for the sub-structure",
          "type": "number"
        },
        "collected": {
          "format": "double",
          "description": "The amount collected",
          "type": "number"
        },
        "serial": {
          "description": "The serial number",
          "type": "string"
        },
        "bit1": {
          "description": "General purpose boolean flag",
          "type": "boolean"
        },
        "started": {
          "description": "Indicates if the sub-structure has been started",
          "type": "boolean"
        },
        "started_date": {
          "format": "date-time",
          "description": "The date when the sub-structure was started",
          "type": "string"
        },
        "subcontract": {
          "description": "Indicates if this is a subcontract",
          "type": "boolean"
        },
        "ready": {
          "description": "Indicates if the sub-structure is ready",
          "type": "boolean"
        },
        "ready_date": {
          "format": "date-time",
          "description": "The date when the sub-structure was marked as ready",
          "type": "string"
        },
        "doneamount": {
          "format": "double",
          "description": "The amount that has been completed",
          "type": "number"
        },
        "just_imported": {
          "description": "Indicates if this was just imported from a file",
          "type": "boolean"
        },
        "minamount": {
          "format": "double",
          "description": "The minimum amount required",
          "type": "number"
        },
        "color_code": {
          "format": "int32",
          "description": "The color code",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The type of the sub-structure. Possible values are:\r\n  1 = Production (Valmistus): Used for manufacturing processes.\r\n  2 = SemiProduct (Puolivalmiste): A semi-finished product.\r\n  3 = Material (Raaka-aine): Raw material.\r\n  4 = Part (Osto-osa): A purchased component.\r\n  5 = Title (Otsikko): A title or heading in the structure.\r\n  6 = SparePart (Varaosa): A spare part.",
          "type": "integer"
        },
        "parent_id": {
          "format": "int32",
          "description": "The id of the parent structure",
          "type": "integer"
        },
        "sub_workstage_id": {
          "format": "int32",
          "description": "The id of the sub workstage",
          "type": "integer"
        },
        "collected_bad": {
          "format": "double",
          "description": "The amount of bad collections",
          "type": "number"
        },
        "orginal_configure_attr": {
          "format": "int32",
          "description": "The original configure attribute",
          "type": "integer"
        },
        "product_batchnr_suppliercode": {
          "description": "The supplier code for the product batch",
          "type": "string"
        },
        "consumption": {
          "format": "double",
          "description": "The consumption amount",
          "type": "number"
        },
        "profit": {
          "format": "double",
          "description": "The profit amount",
          "type": "number"
        },
        "delivery_priority": {
          "format": "int32",
          "description": "The delivery priority",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number",
          "type": "integer"
        },
        "no_unravel": {
          "description": "Indicates if unraveling is disabled",
          "type": "boolean"
        },
        "configure_text": {
          "description": "The configuration text",
          "type": "string"
        },
        "dimension_type": {
          "format": "int32",
          "description": "The type of dimension",
          "type": "integer"
        },
        "original_id": {
          "format": "int32",
          "description": "The original id",
          "type": "integer"
        },
        "division_amount": {
          "description": "The division amount",
          "type": "string"
        },
        "workstage_type": {
          "format": "int32",
          "description": "The type of workstage",
          "type": "integer"
        },
        "manual_netprice": {
          "format": "double",
          "description": "The manual net price",
          "type": "number"
        },
        "manual_netprice_unit_amount": {
          "format": "double",
          "description": "The manual net price unit amount",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.StructureFilter": {
      "description": "Filter options for structure queries",
      "type": "object",
      "properties": {
        "product_code": {
          "description": "The product code to filter by",
          "type": "string"
        },
        "work_number": {
          "format": "int32",
          "description": "The work number for structure",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.MainStructureOrigin]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.MainStructureOrigin"
        }
      }
    },
    "LemonRest.Models.Proxy.MainStructureOrigin": {
      "description": "Origin information for a main structure",
      "type": "object",
      "properties": {
        "structure_rows": {
          "description": "The structure rows",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.GenericStructure"
          }
        },
        "product_code": {
          "description": "The product code",
          "type": "string"
        },
        "main_structure_id": {
          "format": "int32",
          "description": "The main structure's id",
          "type": "integer"
        },
        "work_number": {
          "format": "int32",
          "description": "The work number associated with the structure",
          "type": "integer"
        },
        "product_description": {
          "description": "The description of the product",
          "type": "string"
        },
        "product_description2": {
          "description": "Additional description for the product",
          "type": "string"
        },
        "handling": {
          "format": "int32",
          "description": "The handling type. Possible values are:\r\n  1 = Manufacturing (Valmistus): Used for manufacturing processes.\r\n  2 = Packet (Paketti): Represents a packaged product.\r\n  3 = Configurator (Tuotekonfiguraattori): Indicates a product configurator.\r\n  4 = ManufacturingPacket (Valmistus-paketti): Combines manufacturing and packet processes.\r\n  5 = ConfiguratorNewProduct (Tuotekonfiguraattori, uusi tuote): A new product created through a configurator.\r\n  6 = SalesPacket (Myyntipaketti): Represents a sales package.\r\n  7 = SalesManufacturing (Myyntirakenne): A sales-related product structure.",
          "type": "integer"
        },
        "price_type": {
          "format": "int32",
          "description": "The type of pricing",
          "type": "integer"
        },
        "all_levels_bit": {
          "description": "Indicates if all levels should be included",
          "type": "boolean"
        },
        "amount": {
          "format": "double",
          "description": "The amount for the structure",
          "type": "number"
        },
        "stock": {
          "format": "int32",
          "description": "The stock number",
          "type": "integer"
        },
        "dimension": {
          "description": "The dimension information",
          "type": "string"
        },
        "color": {
          "format": "int32",
          "description": "The color code",
          "type": "integer"
        },
        "structure_no_update_attributes": {
          "description": "The attributes that should not be updated in the structure",
          "type": "string"
        },
        "info1": {
          "description": "Additional information field 1",
          "type": "string"
        },
        "info2": {
          "description": "Additional information field 2",
          "type": "string"
        },
        "reservation_application": {
          "format": "int32",
          "description": "Reservation application type (Materiaalivaraus). Determines which application reserves materials for the structure.\r\nAllowed values:\r\n  0  = Default (oletus)\r\n  7  = Offer (Tarjous)\r\n  8  = SalesOrder (Myyntitilaus)\r\n  12 = Production (Tuotanto)\r\nOmit the field (or send null) to keep the existing value unchanged on PUT/POST. Sending an explicit\r\n0 resets the value to Default.",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.GenericStructure": {
      "description": "Generic structure information",
      "type": "object",
      "properties": {
        "main_structure": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.MainStructureFull",
          "description": "The main structure information"
        },
        "sub_structure": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.SubstructureFull",
          "description": "The sub-structure information"
        },
        "structure_rows": {
          "description": "The structure rows",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.GenericStructure"
          }
        },
        "product_code": {
          "description": "The product code",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.MainStructureFull": {
      "description": "Full information for a main structure",
      "type": "object",
      "properties": {
        "main_structure_id": {
          "format": "int32",
          "description": "The main structure's id",
          "type": "integer"
        },
        "work_number": {
          "format": "int32",
          "description": "The work number associated with the structure",
          "type": "integer"
        },
        "product_description": {
          "description": "The description of the product",
          "type": "string"
        },
        "product_description2": {
          "description": "Additional description for the product",
          "type": "string"
        },
        "handling": {
          "format": "int32",
          "description": "The handling type. Possible values are:\r\n  1 = Manufacturing (Valmistus): Used for manufacturing processes.\r\n  2 = Packet (Paketti): Represents a packaged product.\r\n  3 = Configurator (Tuotekonfiguraattori): Indicates a product configurator.\r\n  4 = ManufacturingPacket (Valmistus-paketti): Combines manufacturing and packet processes.\r\n  5 = ConfiguratorNewProduct (Tuotekonfiguraattori, uusi tuote): A new product created through a configurator.\r\n  6 = SalesPacket (Myyntipaketti): Represents a sales package.\r\n  7 = SalesManufacturing (Myyntirakenne): A sales-related product structure.",
          "type": "integer"
        },
        "price_type": {
          "format": "int32",
          "description": "The type of pricing",
          "type": "integer"
        },
        "all_levels_bit": {
          "description": "Indicates if all levels should be included",
          "type": "boolean"
        },
        "amount": {
          "format": "double",
          "description": "The amount for the structure",
          "type": "number"
        },
        "stock": {
          "format": "int32",
          "description": "The stock number",
          "type": "integer"
        },
        "dimension": {
          "description": "The dimension information",
          "type": "string"
        },
        "color": {
          "format": "int32",
          "description": "The color code",
          "type": "integer"
        },
        "structure_no_update_attributes": {
          "description": "The attributes that should not be updated in the structure",
          "type": "string"
        },
        "info1": {
          "description": "Additional information field 1",
          "type": "string"
        },
        "info2": {
          "description": "Additional information field 2",
          "type": "string"
        },
        "reservation_application": {
          "format": "int32",
          "description": "Reservation application type (Materiaalivaraus). Determines which application reserves materials for the structure.\r\nAllowed values:\r\n  0  = Default (oletus)\r\n  7  = Offer (Tarjous)\r\n  8  = SalesOrder (Myyntitilaus)\r\n  12 = Production (Tuotanto)\r\nOmit the field (or send null) to keep the existing value unchanged on PUT/POST. Sending an explicit\r\n0 resets the value to Default.",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.ProductStructureTree]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStructureTree"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductStructureTree": {
      "description": "The model for ProductStructureTree",
      "type": "object",
      "properties": {
        "parent": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProductMainStructure"
        },
        "nodes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.TreeNode"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductMainStructure": {
      "description": "Main structure information for a product",
      "type": "object",
      "properties": {
        "product_id": {
          "format": "int32",
          "description": "The id of the product",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code",
          "type": "string"
        },
        "main_amount": {
          "format": "double",
          "description": "The main amount for the structure",
          "type": "number"
        },
        "all_levels_bit": {
          "description": "Indicates if all levels should be included",
          "type": "boolean"
        },
        "amount": {
          "format": "double",
          "description": "The amount for the structure",
          "type": "number"
        },
        "dimension": {
          "description": "The dimension information",
          "type": "string"
        },
        "father_code": {
          "description": "The code of the parent product",
          "type": "string"
        },
        "handling": {
          "format": "int32",
          "description": "The handling type. Possible values are:\r\n  1 = Manufacturing (Valmistus): Used for manufacturing processes.\r\n  2 = Packet (Paketti): Represents a packaged product.\r\n  3 = Configurator (Tuotekonfiguraattori): Indicates a product configurator.\r\n  4 = ManufacturingPacket (Valmistus-paketti): Combines manufacturing and packet processes.\r\n  5 = ConfiguratorNewProduct (Tuotekonfiguraattori, uusi tuote): A new product created through a configurator.\r\n  6 = SalesPacket (Myyntipaketti): Represents a sales package.\r\n  7 = SalesManufacturing (Myyntirakenne): A sales-related product structure.",
          "type": "integer"
        },
        "structure_id": {
          "format": "int32",
          "description": "The unique id of the structure",
          "type": "integer"
        },
        "level": {
          "format": "int32",
          "description": "The level in the structure hierarchy",
          "type": "integer"
        },
        "price_type": {
          "format": "int32",
          "description": "The type of pricing",
          "type": "integer"
        },
        "product_description": {
          "description": "The description of the product",
          "type": "string"
        },
        "product_description2": {
          "description": "Additional description for the product",
          "type": "string"
        },
        "row": {
          "format": "int32",
          "description": "The row number in the structure",
          "type": "integer"
        },
        "stock": {
          "format": "int32",
          "description": "The stock number",
          "type": "integer"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number",
          "type": "integer"
        },
        "is_main_structure": {
          "description": "Indicates if this is the main structure",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.TreeNode": {
      "description": "A single tree node in product structure",
      "type": "object",
      "properties": {
        "node": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProductSubStructure"
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.TreeNode"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductSubStructure": {
      "description": "Sub-structure information for a product",
      "type": "object",
      "properties": {
        "sub_workstage_id": {
          "format": "int32",
          "description": "The id of the sub workstage",
          "type": "integer"
        },
        "ask_amount": {
          "description": "Indicates if amount should be asked (kysy valmiskirjauksessa)",
          "type": "boolean"
        },
        "collected": {
          "format": "double",
          "description": "The amount collected",
          "type": "number"
        },
        "collected_bad": {
          "format": "double",
          "description": "The amount of bad collections",
          "type": "number"
        },
        "color": {
          "description": "The color code",
          "type": "string"
        },
        "configure_attribute": {
          "format": "int32",
          "description": "The configure attribute",
          "type": "integer"
        },
        "father_id": {
          "format": "int32",
          "description": "The id of the parent structure",
          "type": "integer"
        },
        "info1": {
          "description": "Additional information field 1",
          "type": "string"
        },
        "info2": {
          "description": "Additional information field 2",
          "type": "string"
        },
        "missing": {
          "format": "double",
          "description": "The missing amount",
          "type": "number"
        },
        "net_price": {
          "format": "double",
          "description": "The net price",
          "type": "number"
        },
        "passive_bit": {
          "description": "Indicates if this structure is passive",
          "type": "boolean"
        },
        "per": {
          "format": "int32",
          "description": "The per value",
          "type": "integer"
        },
        "serial": {
          "description": "The serial number",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The type of the sub-structure",
          "type": "integer"
        },
        "unit": {
          "description": "The unit of measurement",
          "type": "string"
        },
        "waste": {
          "format": "double",
          "description": "The waste percentage",
          "type": "number"
        },
        "batch_numbers": {
          "description": "The batch numbers associated with this sub-structure",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
          }
        },
        "serial_numbers": {
          "description": "The serial numbers associated with this sub-structure",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionSerialNumber"
          }
        },
        "shelves": {
          "description": "The shelves associated with this sub-structure",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionShelf"
          }
        },
        "product_id": {
          "format": "int32",
          "description": "The id of the product",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code",
          "type": "string"
        },
        "main_amount": {
          "format": "double",
          "description": "The main amount for the structure",
          "type": "number"
        },
        "all_levels_bit": {
          "description": "Indicates if all levels should be included",
          "type": "boolean"
        },
        "amount": {
          "format": "double",
          "description": "The amount for the structure",
          "type": "number"
        },
        "dimension": {
          "description": "The dimension information",
          "type": "string"
        },
        "father_code": {
          "description": "The code of the parent product",
          "type": "string"
        },
        "handling": {
          "format": "int32",
          "description": "The handling type. Possible values are:\r\n  1 = Manufacturing (Valmistus): Used for manufacturing processes.\r\n  2 = Packet (Paketti): Represents a packaged product.\r\n  3 = Configurator (Tuotekonfiguraattori): Indicates a product configurator.\r\n  4 = ManufacturingPacket (Valmistus-paketti): Combines manufacturing and packet processes.\r\n  5 = ConfiguratorNewProduct (Tuotekonfiguraattori, uusi tuote): A new product created through a configurator.\r\n  6 = SalesPacket (Myyntipaketti): Represents a sales package.\r\n  7 = SalesManufacturing (Myyntirakenne): A sales-related product structure.",
          "type": "integer"
        },
        "structure_id": {
          "format": "int32",
          "description": "The unique id of the structure",
          "type": "integer"
        },
        "level": {
          "format": "int32",
          "description": "The level in the structure hierarchy",
          "type": "integer"
        },
        "price_type": {
          "format": "int32",
          "description": "The type of pricing",
          "type": "integer"
        },
        "product_description": {
          "description": "The description of the product",
          "type": "string"
        },
        "product_description2": {
          "description": "Additional description for the product",
          "type": "string"
        },
        "row": {
          "format": "int32",
          "description": "The row number in the structure",
          "type": "integer"
        },
        "stock": {
          "format": "int32",
          "description": "The stock number",
          "type": "integer"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number",
          "type": "integer"
        },
        "is_main_structure": {
          "description": "Indicates if this is the main structure",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.QueryFilters.CollectJobFilter": {
      "type": "object",
      "properties": {
        "person_number": {
          "format": "int32",
          "type": "integer"
        },
        "states": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "delivery_before": {
          "format": "date-time",
          "type": "string"
        },
        "delivery_after": {
          "format": "date-time",
          "type": "string"
        },
        "sort_field": {
          "type": "string"
        },
        "sort_ascending": {
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CollectJob]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectJob"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CollectJob": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        },
        "person_number": {
          "format": "int32",
          "type": "integer"
        },
        "person_name": {
          "type": "string"
        },
        "create_date": {
          "format": "date-time",
          "type": "string"
        },
        "start_date": {
          "format": "date-time",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "type": "string"
        },
        "weight": {
          "format": "double",
          "type": "number"
        },
        "packages": {
          "format": "double",
          "type": "number"
        },
        "volume": {
          "format": "double",
          "type": "number"
        },
        "state": {
          "format": "int32",
          "type": "integer"
        },
        "state_description": {
          "type": "string"
        },
        "delivery_date": {
          "format": "date-time",
          "type": "string"
        },
        "rows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectJobRow"
          }
        },
        "rows_count": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.CollectJobRow": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "job_id": {
          "format": "int32",
          "type": "integer"
        },
        "order": {
          "format": "int32",
          "type": "integer"
        },
        "product_code": {
          "type": "string"
        },
        "product_description": {
          "type": "string"
        },
        "product_description2": {
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "type": "integer"
        },
        "stock_description": {
          "type": "string"
        },
        "shelf": {
          "type": "string"
        },
        "ordered_amount": {
          "format": "double",
          "type": "number"
        },
        "ordered_unit": {
          "type": "string"
        },
        "already_collected_amount": {
          "format": "double",
          "type": "number"
        },
        "collected": {
          "format": "double",
          "type": "number"
        },
        "is_all_collected": {
          "type": "boolean"
        },
        "unit": {
          "type": "string"
        },
        "type": {
          "format": "int32",
          "type": "integer"
        },
        "owner_id": {
          "format": "int32",
          "type": "integer"
        },
        "owner_row_id": {
          "format": "int32",
          "type": "integer"
        },
        "owner_number": {
          "format": "int32",
          "type": "integer"
        },
        "weight": {
          "format": "double",
          "type": "number"
        },
        "packages": {
          "format": "double",
          "type": "number"
        },
        "volume": {
          "format": "double",
          "type": "number"
        },
        "state_bit": {
          "type": "boolean"
        },
        "delivery_date": {
          "format": "date-time",
          "type": "string"
        },
        "collect_amount_left": {
          "format": "double",
          "type": "number"
        },
        "delivery_customer_number": {
          "format": "int32",
          "type": "integer"
        },
        "delivery_customer_name": {
          "type": "string"
        },
        "serial_number": {
          "type": "string"
        },
        "orderer_customer_number": {
          "format": "int32",
          "type": "integer"
        },
        "orderer_customer_name": {
          "type": "string"
        },
        "collected_amount_temp": {
          "format": "double",
          "type": "number"
        },
        "product_type": {
          "format": "int32",
          "type": "integer"
        },
        "outward_stock": {
          "format": "int32",
          "type": "integer"
        },
        "shelves": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectTransactionShelf"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CollectTransactionShelf": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "transaction_id": {
          "format": "int32",
          "type": "integer"
        },
        "shelf": {
          "type": "string"
        },
        "product_code": {
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "type": "integer"
        },
        "collected": {
          "format": "double",
          "type": "number"
        },
        "shelf_instock": {
          "format": "double",
          "type": "number"
        },
        "collect_order": {
          "format": "int32",
          "type": "integer"
        },
        "stop_number": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.CollectJobRow]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.CollectJobRow"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CollectTransactionShelf]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectTransactionShelf"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CollectTransactionBatch]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectTransactionBatch"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CollectTransactionBatch": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "transaction_id": {
          "format": "int32",
          "type": "integer"
        },
        "batch_id": {
          "format": "int32",
          "type": "integer"
        },
        "batch_suppliercode": {
          "type": "string"
        },
        "product_code": {
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "type": "integer"
        },
        "shelf": {
          "type": "string"
        },
        "collected": {
          "format": "double",
          "type": "number"
        },
        "saldo": {
          "format": "double",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CollectTransactionSerial]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectTransactionSerial"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CollectTransactionSerial": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "transaction_id": {
          "format": "int32",
          "type": "integer"
        },
        "product_code": {
          "type": "string"
        },
        "serialnr_code": {
          "type": "string"
        },
        "serialnr_description": {
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "type": "integer"
        },
        "collected": {
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CollectTransactionSize]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectTransactionSize"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CollectTransactionSize": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "transaction_id": {
          "format": "int32",
          "type": "integer"
        },
        "stock_number": {
          "format": "int32",
          "type": "integer"
        },
        "product_code": {
          "type": "string"
        },
        "size": {
          "type": "string"
        },
        "ordered_amount": {
          "format": "double",
          "type": "number"
        },
        "saldo": {
          "format": "double",
          "type": "number"
        },
        "already_collected": {
          "format": "double",
          "type": "number"
        },
        "collected": {
          "format": "double",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.CollectRoutine": {
      "description": "Keräystapahtuman ruutini proxy",
      "type": "object",
      "properties": {
        "collect_row_id": {
          "format": "int32",
          "type": "integer"
        },
        "collected_amount_temp": {
          "format": "double",
          "type": "number"
        },
        "pallet_number": {
          "format": "int32",
          "type": "integer"
        },
        "shelves": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectTransactionShelf"
          }
        },
        "batches": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectTransactionBatch"
          }
        },
        "serials": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectTransactionSerial"
          }
        },
        "sizes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectTransactionSize"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.StockTransaction": {
      "description": "Stock transaction information",
      "required": [
        "type",
        "sectype",
        "product_code",
        "stock_number",
        "amount"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the stock transaction",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The type of the transaction. Possible values are:\r\n  1 = Withdrawal (Otto): A transaction for removing stock.\r\n  2 = Receipt (Tulo): A transaction for adding stock.\r\n  3 = Inventory (Inventointi): A transaction related to inventory adjustments.\r\n  4 = Manufacturing (Valmistus): A transaction related to manufacturing processes.\r\n  5 = Manufacturing Withdrawal (Valmistusotto): A manufacturing-related stock removal.",
          "type": "integer"
        },
        "sectype": {
          "format": "int32",
          "description": "The type of the transaction. The possible values are controlled by the codelist 'varastotapahtumat'.",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code for the transaction",
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock number for the transaction",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The date of the transaction",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount of the transaction",
          "type": "number"
        },
        "netprice": {
          "format": "double",
          "description": "The net price for the transaction",
          "type": "number"
        },
        "price_type": {
          "format": "int32",
          "description": "The type of pricing",
          "type": "integer"
        },
        "description": {
          "description": "The description of the transaction",
          "type": "string"
        },
        "costcenter": {
          "description": "The cost center for the transaction",
          "type": "string"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number for the transaction",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number for the transaction",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "The project phase id for the transaction",
          "type": "integer"
        },
        "unit": {
          "description": "The unit of measurement",
          "type": "string"
        },
        "shelf": {
          "description": "The shelf code for the transaction",
          "type": "string"
        },
        "stock_number_in": {
          "format": "int32",
          "description": "The incoming stock number for the transaction",
          "type": "integer"
        },
        "shelf_in": {
          "description": "The incoming shelf code for the transaction",
          "type": "string"
        },
        "no_price_update_on_transfer": {
          "description": "Indicates if price should not be updated on transfer",
          "type": "boolean"
        },
        "add_product_to_project_salesorder": {
          "description": "Add product to project sales order, only used when type is Withdrawal (Otto)",
          "type": "boolean"
        },
        "shelves": {
          "description": "The shelves associated with the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionShelf"
          }
        },
        "batches": {
          "description": "The batch numbers associated with the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
          }
        },
        "serials": {
          "description": "The serial numbers associated with the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionSerialNumber"
          }
        },
        "sizes": {
          "description": "The sizes associated with the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SizeAmount"
          }
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.StockTransactionFull]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionFull"
        }
      }
    },
    "LemonRest.Models.Proxy.StockTransactionFull": {
      "description": "The stock transaction model",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the stock transaction",
          "type": "integer"
        },
        "description": {
          "description": "The description of the transaction",
          "type": "string"
        },
        "net_price": {
          "format": "double",
          "description": "The net price for the transaction",
          "type": "number"
        },
        "person": {
          "format": "int32",
          "description": "The number of the person associated with the transaction",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code for the transaction",
          "type": "string"
        },
        "sales_price": {
          "format": "double",
          "description": "The sales price for the transaction",
          "type": "number"
        },
        "sec_type": {
          "format": "int32",
          "description": "The section type for the transaction",
          "type": "integer"
        },
        "shelf": {
          "description": "The shelf code for the transaction",
          "type": "string"
        },
        "source": {
          "format": "int32",
          "description": "The source of the transaction",
          "type": "integer"
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock number for the transaction",
          "type": "integer"
        },
        "stock_number_in": {
          "format": "int32",
          "description": "The incoming stock number for the transaction",
          "type": "integer"
        },
        "supplier": {
          "format": "int32",
          "description": "The supplier associated with the transaction",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The type of the transaction",
          "type": "integer"
        },
        "type_description": {
          "description": "The type description of the transaction",
          "type": "string"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number for the transaction",
          "type": "integer"
        },
        "amount": {
          "format": "double",
          "description": "The amount for the transaction",
          "type": "number"
        },
        "costcenter": {
          "description": "The cost center for the transaction",
          "type": "string"
        },
        "date": {
          "format": "date-time",
          "description": "The date of the transaction",
          "type": "string"
        },
        "price_type": {
          "format": "int32",
          "description": "The price type for the transaction",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number for the transaction",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "The project phase id for the transaction",
          "type": "integer"
        },
        "default_shelf": {
          "description": "The default shelf for the transaction",
          "type": "string"
        },
        "stock_unit": {
          "description": "The stock unit for the transaction",
          "type": "string"
        },
        "batch_numbers": {
          "description": "The batch numbers associated with the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
          }
        },
        "serial_numbers": {
          "description": "The serial numbers associated with the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionSerialNumber"
          }
        },
        "sizes": {
          "description": "The sizes associated with the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SizeAmount"
          }
        },
        "fail_codes": {
          "description": "The fail codes associated with the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionFailcode"
          }
        },
        "shelves": {
          "description": "The shelves associated with the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionShelf"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.StockTransactionFailcode": {
      "description": "The stock transaction fail code model",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the stock transaction fail code",
          "type": "integer"
        },
        "codelist_id": {
          "format": "int32",
          "description": "The codelist id of the stock transaction fail code",
          "type": "integer"
        },
        "transaction_id": {
          "format": "int32",
          "description": "The stock transaction id",
          "type": "integer"
        },
        "description": {
          "description": "The fail code description",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ProductStockSaldoFilter": {
      "type": "object",
      "properties": {
        "updated_after": {
          "format": "date-time",
          "description": "Timestamp after product saldo should have changed",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Timestamp before product saldo should have changed",
          "type": "string"
        },
        "product_code": {
          "description": "A list of product codes to filter by",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock number to filter by",
          "type": "integer"
        },
        "sort_desc": {
          "description": "Sorting order by id. Default is ascending (false).",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductStock]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStock"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.StockTransactionFilter": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "product_code": {
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "type": "integer"
        },
        "modified_before": {
          "format": "date-time",
          "type": "string"
        },
        "modified_after": {
          "format": "date-time",
          "type": "string"
        },
        "transaction_date_before": {
          "format": "date-time",
          "type": "string"
        },
        "transaction_date_after": {
          "format": "date-time",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "type": "integer"
        },
        "source": {
          "format": "int32",
          "type": "integer"
        },
        "search": {
          "type": "string"
        },
        "person": {
          "format": "int32",
          "type": "integer"
        },
        "work_number": {
          "format": "int32",
          "type": "integer"
        },
        "GetSalesOrderNumber": {
          "type": "boolean"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.StockTransactionCompact]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionCompact"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.StockTransactionCompact": {
      "description": "Stock transaction information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the stock transaction",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code for the transaction",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount for the transaction",
          "type": "number"
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock number for the transaction",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The date of the transaction",
          "type": "string"
        },
        "source": {
          "format": "int32",
          "description": "The source of the transaction",
          "type": "integer"
        },
        "description": {
          "description": "The description of the transaction",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The type of the transaction",
          "type": "integer"
        },
        "salesprice": {
          "format": "double",
          "description": "The sales price for the transaction",
          "type": "number"
        },
        "netprice": {
          "format": "double",
          "description": "The net price for the transaction",
          "type": "number"
        },
        "productionprice": {
          "format": "double",
          "description": "The production price for the transaction",
          "type": "number"
        },
        "person": {
          "format": "int32",
          "description": "The person associated with the transaction",
          "type": "integer"
        },
        "supplier": {
          "format": "int32",
          "description": "The supplier associated with the transaction",
          "type": "integer"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number for the transaction",
          "type": "integer"
        },
        "prev_amount": {
          "format": "double",
          "description": "The previous amount for the transaction",
          "type": "number"
        },
        "product_unit": {
          "description": "The product unit for the transaction",
          "type": "string"
        },
        "transfer_bit": {
          "description": "Indicates if the transaction is a transfer",
          "type": "boolean"
        },
        "sectype": {
          "format": "int32",
          "description": "The section type for the transaction",
          "type": "integer"
        },
        "prev_avgr_price": {
          "format": "double",
          "description": "The previous average price for the transaction",
          "type": "number"
        },
        "shelf": {
          "description": "The shelf code for the transaction",
          "type": "string"
        },
        "costcenter": {
          "description": "The cost center for the transaction",
          "type": "string"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number for the transaction",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "The project phase id for the transaction",
          "type": "integer"
        },
        "job_id": {
          "format": "int32",
          "description": "The job id for the transaction",
          "type": "integer"
        },
        "no_stock_update": {
          "description": "Indicates if the stock should not be updated",
          "type": "boolean"
        },
        "sub_structure_id": {
          "format": "int32",
          "description": "The sub-structure id for the transaction",
          "type": "integer"
        },
        "stock_purchase_order_number": {
          "description": "The stock purchase order number for the transaction",
          "type": "string"
        },
        "stock_sales_order_number": {
          "description": "The stock sales order number for the transaction",
          "type": "string"
        },
        "stock_sales_order_number2": {
          "format": "int32",
          "description": "The second stock sales order number for the transaction",
          "type": "integer"
        },
        "serialnumbers": {
          "description": "The serial numbers for the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionSerialNumber"
          }
        },
        "batchnumbers": {
          "description": "The batch numbers for the transaction",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.InputFormFilter": {
      "description": "Filtteri syöttölomakkeille",
      "type": "object",
      "properties": {
        "attribute_code": {
          "format": "int32",
          "description": "Ominaisuusrajaus syöttölomnakkeen nimikkeille",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductInputForm]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductInputForm"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductInputForm": {
      "description": "Product input form information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product input form",
          "type": "integer"
        },
        "description": {
          "description": "The description of the product input form",
          "type": "string"
        },
        "products": {
          "description": "The products in the input form",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductInputFormProduct"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductInputFormProduct": {
      "description": "Product input form product information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the product input form product",
          "type": "integer"
        },
        "inputform_id": {
          "format": "int32",
          "description": "The id of the input form this product belongs to",
          "type": "integer"
        },
        "product_id": {
          "description": "The product id for the input form product",
          "type": "string"
        },
        "product_code": {
          "description": "The product code for the input form product",
          "type": "string"
        },
        "product_description": {
          "description": "The product description for the input form product",
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock number for the input form product",
          "type": "integer"
        },
        "product_stock_numbers": {
          "description": "The product stock numbers for the input form product",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ComplaintFilter": {
      "type": "object",
      "properties": {
        "states": {
          "description": "Complaint states",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "types": {
          "description": "Complaint types",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "responsible_persons": {
          "description": "Responsible person numbers",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "numbers": {
          "description": "Complaint numbers",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "before_date": {
          "format": "date-time",
          "description": "Complaint date before",
          "type": "string"
        },
        "after_date": {
          "format": "date-time",
          "description": "Complaint date after",
          "type": "string"
        },
        "sales_order_number": {
          "format": "int32",
          "description": "Sales order number",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "Responsible person number",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "description": "Project number",
          "type": "integer"
        },
        "product_code": {
          "description": "Product code",
          "type": "string"
        },
        "sort_field": {
          "description": "Sort field",
          "type": "string"
        },
        "sort_ascending": {
          "description": "Sort order (True = ASC, False = DESC)",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Complaint]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Complaint"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Complaint": {
      "description": "Complaint information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the complaint",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The number of the complaint",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The date of the complaint",
          "type": "string"
        },
        "state": {
          "format": "int32",
          "description": "The state of the complaint",
          "type": "integer"
        },
        "state_description": {
          "description": "The state description of the complaint",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The type of the complaint",
          "type": "integer"
        },
        "type_description": {
          "description": "The type description of the complaint",
          "type": "string"
        },
        "reason_code": {
          "format": "int32",
          "description": "The reason code of the complaint",
          "type": "integer"
        },
        "reason_code_description": {
          "description": "The reason code description of the complaint",
          "type": "string"
        },
        "header": {
          "description": "The header of the complaint",
          "type": "string"
        },
        "description": {
          "description": "The description of the complaint",
          "type": "string"
        },
        "reason": {
          "description": "The reason for the complaint",
          "type": "string"
        },
        "prevent": {
          "description": "The prevent measures for the complaint",
          "type": "string"
        },
        "done": {
          "description": "The done status of the complaint",
          "type": "string"
        },
        "person": {
          "format": "int32",
          "description": "The person associated with the complaint",
          "type": "integer"
        },
        "person_name": {
          "description": "The person name associated with the complaint",
          "type": "string"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number associated with the complaint",
          "type": "integer"
        },
        "customer_name": {
          "description": "The customer name associated with the complaint",
          "type": "string"
        },
        "customer_name2": {
          "description": "The second customer name associated with the complaint",
          "type": "string"
        },
        "customer_contact": {
          "description": "The customer contact information for the complaint",
          "type": "string"
        },
        "customer_contact_email": {
          "description": "The customer contact email for the complaint",
          "type": "string"
        },
        "customer_phone": {
          "description": "The customer phone for the complaint",
          "type": "string"
        },
        "ordernr": {
          "format": "int32",
          "description": "The order number for the complaint",
          "type": "integer"
        },
        "reclamation_ordernr": {
          "format": "int32",
          "description": "The reclamation order number for the complaint",
          "type": "integer"
        },
        "project": {
          "format": "int32",
          "description": "The project associated with the complaint",
          "type": "integer"
        },
        "project_description": {
          "description": "The project description for the complaint",
          "type": "string"
        },
        "project_phase": {
          "format": "int32",
          "description": "The project phase for the complaint",
          "type": "integer"
        },
        "project_phase_description": {
          "description": "The project phase description for the complaint",
          "type": "string"
        },
        "production_hours": {
          "format": "double",
          "description": "The production hours for the complaint",
          "type": "number"
        },
        "production_amount": {
          "format": "double",
          "description": "The production amount for the complaint",
          "type": "number"
        },
        "production_faulty": {
          "format": "double",
          "description": "The production faulty amount for the complaint",
          "type": "number"
        },
        "program_id": {
          "format": "int32",
          "description": "The program id for the complaint",
          "type": "integer"
        },
        "program_key_id": {
          "format": "int32",
          "description": "The program key id for the complaint",
          "type": "integer"
        },
        "products": {
          "description": "The products associated with the complaint",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ComplaintProduct"
          }
        },
        "attributes": {
          "description": "The attributes associated with the complaint",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ComplaintAttribute"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ComplaintProduct": {
      "description": "Complaint product information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the complaint product",
          "type": "integer"
        },
        "complaint_id": {
          "format": "int32",
          "description": "The complaint id for the complaint product",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code for the complaint product",
          "type": "string"
        },
        "batch": {
          "description": "The batch for the complaint product",
          "type": "string"
        },
        "serial": {
          "description": "The serial for the complaint product",
          "type": "string"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number for the complaint product",
          "type": "integer"
        },
        "amount": {
          "format": "double",
          "description": "The amount for the complaint product",
          "type": "number"
        },
        "notes": {
          "description": "The notes for the complaint product",
          "type": "string"
        },
        "product_description": {
          "description": "The product description for the complaint product",
          "type": "string"
        },
        "reason_code": {
          "format": "int32",
          "description": "The reason code for the complaint product",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The person number for the complaint product",
          "type": "integer"
        },
        "quality_assurance_person": {
          "format": "int32",
          "description": "The quality assurance person for the complaint product",
          "type": "integer"
        },
        "send_message": {
          "description": "Indicates if a message should be sent for the complaint product",
          "type": "boolean"
        },
        "hours": {
          "format": "double",
          "description": "The hours for the complaint product",
          "type": "number"
        },
        "subworkstage_id": {
          "format": "int32",
          "description": "The sub workstage id for the complaint product",
          "type": "integer"
        },
        "source": {
          "format": "int32",
          "description": "The source for the complaint product",
          "type": "integer"
        },
        "machine": {
          "format": "int32",
          "description": "The machine for the complaint product",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.ComplaintAttribute": {
      "description": "Complaint attribute information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the complaint attribute",
          "type": "integer"
        },
        "complaint_id": {
          "format": "int32",
          "description": "The complaint id for the complaint attribute",
          "type": "integer"
        },
        "description": {
          "description": "The description of the complaint attribute",
          "type": "string"
        },
        "group_description": {
          "description": "The group description of the complaint attribute",
          "type": "string"
        },
        "is_checked": {
          "description": "Indicates if the complaint attribute is checked",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductionComplaintExtras": {
      "description": "Production complaint extras information",
      "type": "object",
      "properties": {
        "person_number": {
          "format": "int32",
          "description": "The person number for the production complaint extras",
          "type": "integer"
        },
        "production_hours": {
          "format": "double",
          "description": "The production hours for the production complaint extras",
          "type": "number"
        },
        "production_amount": {
          "format": "double",
          "description": "The production amount for the production complaint extras",
          "type": "number"
        },
        "production_faulty": {
          "format": "double",
          "description": "The production faulty amount for the production complaint extras",
          "type": "number"
        },
        "sub_workstage_id": {
          "format": "int32",
          "description": "The sub workstage id for the production complaint extras",
          "type": "integer"
        },
        "source": {
          "description": "The source for the production complaint extras",
          "enum": [
            "None",
            "JobStop",
            "JobDone",
            "JobList",
            "MaterialStandard",
            "ProductJobList",
            "JobDetail"
          ],
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Complaint]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Complaint"
        }
      }
    },
    "LemonRest.Models.QueryFilters.CollectTransactionFilter": {
      "type": "object",
      "properties": {
        "pallet_number": {
          "format": "int32",
          "type": "integer"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CollectTransaction]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CollectTransaction"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CollectTransaction": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "collect_job_id": {
          "format": "int32",
          "type": "integer"
        },
        "collect_row_id": {
          "format": "int32",
          "type": "integer"
        },
        "collect_pallet_id": {
          "format": "int32",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "type": "string"
        },
        "product_code": {
          "type": "string"
        },
        "product_description": {
          "type": "string"
        },
        "stock": {
          "format": "int32",
          "type": "integer"
        },
        "collected": {
          "format": "double",
          "type": "number"
        },
        "unit": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.InventoryListFilter": {
      "description": "Filter for inventory list",
      "type": "object",
      "properties": {
        "inputform": {
          "format": "int32",
          "type": "integer"
        },
        "get_collections": {
          "type": "boolean"
        },
        "sort_order": {
          "description": "ASC / DESC",
          "type": "string"
        },
        "sort_field": {
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProductStockInventory]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStockInventory"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductStockInventory": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "stock": {
          "format": "int32",
          "type": "integer"
        },
        "product_code": {
          "type": "string"
        },
        "product_description": {
          "type": "string"
        },
        "product_group": {
          "format": "int32",
          "type": "integer"
        },
        "product_sizetype": {
          "format": "int32",
          "type": "integer"
        },
        "is_serial": {
          "type": "boolean"
        },
        "is_batch": {
          "type": "boolean"
        },
        "stock_instock": {
          "format": "double",
          "type": "number"
        },
        "stock_unit": {
          "type": "string"
        },
        "is_inventoried": {
          "type": "boolean"
        },
        "stock_instock_tmp": {
          "format": "double",
          "type": "number"
        },
        "inventoried_saldo": {
          "format": "double",
          "type": "number"
        },
        "product_ean": {
          "type": "string"
        },
        "product_ean_codes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductGTINCode"
          }
        },
        "shelves": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionShelf"
          }
        },
        "serials": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionSerialNumber"
          }
        },
        "batches": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
          }
        },
        "sizes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SizeAmount"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ListInventoryRow": {
      "type": "object",
      "properties": {
        "product_stock_id": {
          "format": "int32",
          "type": "integer"
        },
        "inventoried_amount": {
          "format": "double",
          "type": "number"
        },
        "shelf": {
          "type": "string"
        },
        "serials": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionSerialNumber"
          }
        },
        "batches": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
          }
        },
        "sizes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SizeAmount"
          }
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[System.Collections.Generic.List[System.Int32]]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[System.String]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.MainWorkstageFilter": {
      "description": "Filter for the GET /main_ws/changed endpoint — returns main work stages whose state changed in the supplied date range. Inherits page and page_size from PageFilter.",
      "required": [
        "updated_after",
        "updated_before"
      ],
      "type": "object",
      "properties": {
        "updated_after": {
          "format": "date-time",
          "description": "Inclusive lower bound for the updated_at timestamp (required)",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Inclusive upper bound for the updated_at timestamp (required)",
          "type": "string"
        },
        "state": {
          "format": "int32",
          "description": "Optionally restrict the result to a single state value",
          "type": "integer"
        },
        "optimization": {
          "description": "Toggle optimizations on or off for this endpoint. Default is false.",
          "type": "boolean"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Production.ProductMainWorkStage]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductMainWorkStage"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Production.ProductMainWorkStage": {
      "description": "A main work stage (päätyövaihe) — represents one production work number with all its sub work stages",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the main work stage",
          "type": "integer"
        },
        "main_structure_id": {
          "format": "int32",
          "description": "The id of the underlying main structure",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The main work stage type code",
          "type": "integer"
        },
        "state": {
          "format": "int32",
          "description": "The state of the main work stage (tila)",
          "type": "integer"
        },
        "state_description": {
          "description": "The state's display description",
          "type": "string"
        },
        "abort_text": {
          "description": "Reason text when the work stage was aborted (peruutusteksti)",
          "type": "string"
        },
        "compilation_type": {
          "format": "int32",
          "description": "The compilation type code (koontityyppi)",
          "type": "integer"
        },
        "procent_completed": {
          "format": "double",
          "description": "The completion percentage of the main work stage",
          "type": "number"
        },
        "delivery_state": {
          "format": "int32",
          "description": "The delivery state code",
          "type": "integer"
        },
        "delivery_text": {
          "description": "The delivery state's display description",
          "type": "string"
        },
        "delivery_time": {
          "format": "date-time",
          "description": "The delivery time",
          "type": "string"
        },
        "start_time": {
          "format": "date-time",
          "description": "Planned start time of the work stage",
          "type": "string"
        },
        "end_time": {
          "format": "date-time",
          "description": "Planned end time of the work stage",
          "type": "string"
        },
        "dimension": {
          "description": "Dimension / classification code for the work stage",
          "type": "string"
        },
        "handedness": {
          "format": "int32",
          "description": "Handedness code (kätisyys)",
          "type": "integer"
        },
        "material_state": {
          "format": "int32",
          "description": "The material readiness state (materiaalitila)",
          "type": "integer"
        },
        "order_number": {
          "format": "int32",
          "description": "The sales order number this work stage is linked to (tilausnumero)",
          "type": "integer"
        },
        "priority": {
          "format": "int32",
          "description": "Priority value for scheduling",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code being produced (tuotekoodi). For possible values, refer to /api/products\r\n            [here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "product_description": {
          "description": "The product description",
          "type": "string"
        },
        "product_extra": {
          "description": "Additional product info",
          "type": "string"
        },
        "row_type": {
          "format": "int32",
          "description": "The row type (rivin tyyppi)",
          "type": "integer"
        },
        "salesorder_amount": {
          "format": "double",
          "description": "The amount on the originating sales order row",
          "type": "number"
        },
        "std_time": {
          "format": "double",
          "description": "Standard time for the work stage",
          "type": "number"
        },
        "work_amount": {
          "format": "double",
          "description": "The amount of work to be done",
          "type": "number"
        },
        "work_amount2": {
          "format": "double",
          "description": "Secondary work amount",
          "type": "number"
        },
        "product_stock": {
          "format": "int32",
          "description": "The product stock (warehouse) where the finished product is placed (varasto). For possible values, refer to /api/settings/products/stocks\r\n            [here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number (projektinumero). For possible values, refer to /api/projects\r\n            [here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "comment": {
          "description": "Free-text comment on the main work stage",
          "type": "string"
        },
        "sales_orderrow_delivery_date": {
          "format": "date-time",
          "description": "The delivery date of the underlying sales order row",
          "type": "string"
        },
        "sales_orderrow_id": {
          "format": "int32",
          "description": "The id of the underlying sales order row",
          "type": "integer"
        },
        "sub_structure_id": {
          "format": "int32",
          "description": "The id of the underlying sub structure",
          "type": "integer"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number (työnumero)",
          "type": "integer"
        },
        "customer_name": {
          "description": "The customer's name (asiakkaan nimi)",
          "type": "string"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number (asiakasnumero). For possible values, refer to /api/customers\r\n            [here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "delivery_id": {
          "format": "int32",
          "description": "The id of the delivery row when produced for a delivery",
          "type": "integer"
        },
        "batchnr": {
          "description": "The batch number / serial when produced as a batch (eränumero)",
          "type": "string"
        },
        "sub_workstages": {
          "description": "The sub work stages that make up this main work stage",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductSubWorkStage"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Production.ProductSubWorkStage": {
      "description": "A sub work stage (alatyövaihe) — one production step on a work number",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the sub work stage",
          "type": "integer"
        },
        "main_workstage_id": {
          "format": "int32",
          "description": "The parent main work stage id",
          "type": "integer"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number (työnumero) the sub work stage belongs to",
          "type": "integer"
        },
        "order_nro": {
          "format": "int32",
          "description": "The order position of the sub work stage",
          "type": "integer"
        },
        "sub_workstage_ordernro": {
          "format": "int32",
          "description": "The display order position",
          "type": "integer"
        },
        "suborder_nro": {
          "format": "int32",
          "description": "The sub order number when the work stage is split",
          "type": "integer"
        },
        "machine_id": {
          "format": "int32",
          "description": "The machine assigned to the sub work stage",
          "type": "integer"
        },
        "workphase_id": {
          "format": "int32",
          "description": "The work phase id (työvaihekoodi)",
          "type": "integer"
        },
        "description": {
          "description": "Description of the sub work stage",
          "type": "string"
        },
        "description2": {
          "description": "Secondary description",
          "type": "string"
        },
        "state": {
          "format": "int32",
          "description": "The state of the sub work stage (0 = open, 10 = started, 20 = paused, 90 = done)",
          "type": "integer"
        },
        "state_description": {
          "description": "The state's display description",
          "type": "string"
        },
        "productivity": {
          "format": "double",
          "description": "Productivity factor used in scheduling",
          "type": "number"
        },
        "capacity": {
          "format": "double",
          "description": "Capacity used by the sub work stage",
          "type": "number"
        },
        "capacity2": {
          "format": "double",
          "description": "Secondary capacity value",
          "type": "number"
        },
        "unit": {
          "format": "int32",
          "description": "The unit of measurement code",
          "type": "integer"
        },
        "setting_time": {
          "format": "int32",
          "description": "The setting time in minutes (asetusaika)",
          "type": "integer"
        },
        "settle_time": {
          "format": "int32",
          "description": "The settling / cleanup time in minutes (purkuaika)",
          "type": "integer"
        },
        "settle_days": {
          "format": "int32",
          "description": "Days between work stages (vuorokausia vaiheiden välissä)",
          "type": "integer"
        },
        "batch_amount": {
          "format": "double",
          "description": "Batch amount when produced in batches",
          "type": "number"
        },
        "info": {
          "description": "Free-text info on the sub work stage",
          "type": "string"
        },
        "program": {
          "description": "Machine program / NC program identifier",
          "type": "string"
        },
        "price": {
          "format": "double",
          "description": "The unit price for the sub work stage",
          "type": "number"
        },
        "start_code": {
          "format": "int32",
          "description": "The start code (0 = manual, 1 = automatic)",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer the work is done for (asiakasnumero). For possible values, refer to /api/customers\r\n            [here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_name": {
          "description": "The customer's name",
          "type": "string"
        },
        "delivery_customer_number": {
          "format": "int32",
          "description": "The delivery customer number. For possible values, refer to /api/customers",
          "type": "integer"
        },
        "delivery_customer_name": {
          "description": "The delivery customer's name",
          "type": "string"
        },
        "delivery_customer_contact": {
          "description": "The delivery customer's contact person",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount to produce",
          "type": "number"
        },
        "left": {
          "description": "Layout flag — left side of the part is processed",
          "type": "boolean"
        },
        "right": {
          "description": "Layout flag — right side of the part is processed",
          "type": "boolean"
        },
        "up": {
          "description": "Layout flag — top side of the part is processed",
          "type": "boolean"
        },
        "down": {
          "description": "Layout flag — bottom side of the part is processed",
          "type": "boolean"
        },
        "inner": {
          "description": "Layout flag — inner side of the part is processed",
          "type": "boolean"
        },
        "configure": {
          "description": "When true, the operator is required to configure the machine before starting",
          "type": "boolean"
        },
        "purchase_bit": {
          "description": "Indicates the sub work stage is fulfilled by a purchase order (alihankinta)",
          "type": "boolean"
        },
        "sales_price": {
          "format": "double",
          "description": "Sales price applied to the produced unit",
          "type": "number"
        },
        "net_price": {
          "format": "double",
          "description": "Net price applied to the produced unit",
          "type": "number"
        },
        "persons": {
          "format": "int32",
          "description": "Number of persons assigned to the sub work stage",
          "type": "integer"
        },
        "person_cost": {
          "format": "double",
          "description": "Person cost factor",
          "type": "number"
        },
        "waste": {
          "format": "double",
          "description": "Waste / scrap factor",
          "type": "number"
        },
        "duration": {
          "format": "int32",
          "description": "Duration of the sub work stage",
          "type": "integer"
        },
        "start_time": {
          "format": "date-time",
          "description": "Planned start time",
          "type": "string"
        },
        "end_time": {
          "format": "date-time",
          "description": "Planned end time",
          "type": "string"
        },
        "work_amount": {
          "format": "double",
          "description": "The amount of work to be done",
          "type": "number"
        },
        "work_amount2": {
          "format": "double",
          "description": "Secondary work amount",
          "type": "number"
        },
        "work_amount_done": {
          "format": "double",
          "description": "The amount of work that has been done",
          "type": "number"
        },
        "work_amount_left": {
          "format": "double",
          "description": "The amount of work still remaining",
          "type": "number"
        },
        "type": {
          "format": "int32",
          "description": "The sub work stage type code",
          "type": "integer"
        },
        "can_start": {
          "format": "int32",
          "description": "Indicates whether the sub work stage can be started (1 = yes, 0 = no)",
          "type": "integer"
        },
        "purchase_order": {
          "format": "int32",
          "description": "The id of the purchase order when this is a subcontracting stage",
          "type": "integer"
        },
        "compilation_worknumber": {
          "format": "int32",
          "description": "The work number of the compilation job (koontityö) when this stage belongs to one",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "The project phase id (projektivaihe). For possible values, refer to /api/projects/{number}/phase\r\n            [here](#tag/projects/operation/Project_GetPhases)",
          "type": "integer"
        },
        "person": {
          "description": "The assigned person (free text — may contain multiple names)",
          "type": "string"
        },
        "day_order": {
          "format": "int32",
          "description": "The day order position used when planning days",
          "type": "integer"
        },
        "duration_type": {
          "format": "int32",
          "description": "Duration type code",
          "type": "integer"
        },
        "machine_code": {
          "description": "Machine code (koneen koodi)",
          "type": "string"
        },
        "machine_description": {
          "description": "Machine description",
          "type": "string"
        },
        "product_code": {
          "description": "The product code being produced (tuotekoodi). For possible values, refer to /api/products",
          "type": "string"
        },
        "product_description": {
          "description": "The product description",
          "type": "string"
        },
        "product_extra": {
          "description": "Additional product info",
          "type": "string"
        },
        "product_stock": {
          "format": "int32",
          "description": "The product stock (warehouse) where the finished product is placed. For possible values, refer to /api/settings/products/stocks",
          "type": "integer"
        },
        "shelf": {
          "description": "The default shelf for stock postings",
          "type": "string"
        },
        "stage_type": {
          "format": "int32",
          "description": "Stage type code (0 = regular, 1 = compilation)",
          "type": "integer"
        },
        "standard_id": {
          "format": "int32",
          "description": "The id of the standard work phase definition (vakiovaihe) this stage was generated from",
          "type": "integer"
        },
        "main_structure_id": {
          "format": "int32",
          "description": "The main structure id",
          "type": "integer"
        },
        "delivery_text": {
          "description": "Free-text delivery info",
          "type": "string"
        },
        "order_delivery_text": {
          "description": "Free-text order delivery info",
          "type": "string"
        },
        "materials": {
          "description": "The materials consumed by the sub work stage",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.WorkstageMaterial"
          }
        },
        "tools": {
          "description": "The tools used by the sub work stage",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.WorkstageTool"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Production.WorkstageMaterial": {
      "description": "A material requirement on a sub work stage (työvaiheen materiaali)",
      "type": "object",
      "properties": {
        "sub_structure_id": {
          "format": "int32",
          "description": "The id of the product sub structure this row originates from",
          "type": "integer"
        },
        "main_structure_id": {
          "format": "int32",
          "description": "The id of the parent main structure",
          "type": "integer"
        },
        "product_code": {
          "description": "The product code of the material (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "product_description": {
          "description": "The product description",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The currently planned amount of material",
          "type": "number"
        },
        "demanded_amount": {
          "format": "double",
          "description": "The amount of material demanded by the work stage",
          "type": "number"
        },
        "collected": {
          "format": "double",
          "description": "The amount that has been collected so far (kerätty)",
          "type": "number"
        },
        "collected_bad": {
          "format": "double",
          "description": "The amount that has been collected and marked as bad / failed",
          "type": "number"
        },
        "unit": {
          "description": "The unit of measurement",
          "type": "string"
        },
        "stock": {
          "format": "int32",
          "description": "The stock (warehouse) the material is taken from (varasto). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "stock_description": {
          "description": "The stock's display description",
          "type": "string"
        },
        "stock_instock": {
          "format": "double",
          "description": "The current in-stock saldo of the material",
          "type": "number"
        },
        "is_serial": {
          "description": "Indicates the material is tracked by serial numbers",
          "type": "boolean"
        },
        "is_batch": {
          "description": "Indicates the material is tracked by batches",
          "type": "boolean"
        },
        "sub_structure_row": {
          "format": "int32",
          "description": "Row position on the sub structure",
          "type": "integer"
        },
        "level": {
          "format": "int32",
          "description": "Nesting level in the structure tree",
          "type": "integer"
        },
        "father_id": {
          "format": "int32",
          "description": "The id of the parent structure row",
          "type": "integer"
        },
        "is_passive": {
          "description": "Indicates whether this material row is passive (does not affect stock)",
          "type": "boolean"
        },
        "main_workstage_id": {
          "format": "int32",
          "description": "The main workstage this material belongs to",
          "type": "integer"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number (työnumero) the material is reserved for",
          "type": "integer"
        },
        "batchnr_suppliercode": {
          "description": "The supplier batch code for the material (toimittajan eränumero)",
          "type": "string"
        },
        "stock_saldo_type": {
          "format": "int32",
          "description": "0 = Negative stock amount check not required,\r\n1 = Inform about negative stock amount,\r\n2 = Prevent negative stock amount",
          "type": "integer"
        },
        "shelves": {
          "description": "Per-shelf breakdown of the material",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.WorkstageMaterialShelf"
          }
        },
        "batches": {
          "description": "Per-batch breakdown of the material",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.WorkstageMaterialBatch"
          }
        },
        "sub_structure_shelves": {
          "description": "Shelves configured on the sub structure",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductSubStructureShelf"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Production.WorkstageTool": {
      "description": "A tool assigned to a sub work stage (työkalu)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the tool assignment row",
          "type": "integer"
        },
        "tool_id": {
          "format": "int32",
          "description": "The internal tool id",
          "type": "integer"
        },
        "description": {
          "description": "The tool's display description",
          "type": "string"
        },
        "is_default": {
          "description": "Indicates this is the default tool for the sub work stage",
          "type": "boolean"
        },
        "usage_per_unit": {
          "format": "double",
          "description": "Tool wear / consumption per produced unit",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.WorkstageMaterialShelf": {
      "description": "A shelf-level entry for a workstage material row",
      "type": "object",
      "properties": {
        "shelf": {
          "description": "The shelf code (hylly)",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount on this shelf",
          "type": "number"
        },
        "is_default": {
          "description": "Indicates this is the default shelf for the material",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.WorkstageMaterialBatch": {
      "description": "A batch entry for a workstage material row",
      "type": "object",
      "properties": {
        "batchnr_id": {
          "format": "int32",
          "description": "The batch's internal id",
          "type": "integer"
        },
        "batchnr_suppliercode": {
          "description": "The supplier batch code (toimittajan eränumero)",
          "type": "string"
        },
        "tmp_amount": {
          "format": "double",
          "description": "Temporary amount used during the consumption transaction",
          "type": "number"
        },
        "stock": {
          "format": "int32",
          "description": "The stock the batch is located in (varasto). For possible values, refer to /api/settings/products/stocks",
          "type": "integer"
        },
        "batchnr_amount": {
          "format": "double",
          "description": "The available amount in the batch",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.ProductSubStructureShelf": {
      "description": "A shelf assignment on a product sub structure (rakenteen hylly)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the sub structure shelf row",
          "type": "integer"
        },
        "structure_id": {
          "format": "int32",
          "description": "The id of the sub structure this shelf row belongs to",
          "type": "integer"
        },
        "shelf": {
          "description": "The shelf code (hylly)",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount on this shelf",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Production.ProductSubWorkStage]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductSubWorkStage"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.WorkstageFilter": {
      "description": "Filter for querying main work stages. Inherits page and page_size from PageFilter.",
      "type": "object",
      "properties": {
        "product_code": {
          "description": "Filter by product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "worknumber": {
          "format": "int32",
          "description": "Filter by work number (työnumero)",
          "type": "integer"
        },
        "id": {
          "format": "int32",
          "description": "Filter by main work stage id",
          "type": "integer"
        },
        "main_structure_id": {
          "format": "int32",
          "description": "Filter by the parent main structure id",
          "type": "integer"
        },
        "sub_structure_id": {
          "format": "int32",
          "description": "Filter by the parent sub structure id",
          "type": "integer"
        },
        "product_description": {
          "description": "Filter by product description (contains match)",
          "type": "string"
        },
        "state": {
          "format": "int32",
          "description": "The state filter for workstages. By default returns workstages with state 0. Set to -1 to return all workstages.",
          "type": "integer"
        },
        "only_with_workstages": {
          "description": "When true, only return work stages that have sub-workstages.\r\nDefault false: all work stages are returned, including auto-generated stages (e.g. from material clicks).\r\nSet explicitly to true to return only work stages that have sub-workstages.",
          "type": "boolean"
        },
        "dont_include_passives": {
          "description": "When true, exclude passive work stages (sub_structure_passive_bit = 1).\r\nDefault false.",
          "type": "boolean"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Production.ProductMainWorkStage]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductMainWorkStage"
        }
      }
    },
    "LemonRest.Models.QueryFilters.SubWorkstageFilter": {
      "description": "Filter for subworkstages. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "only_startable": {
          "description": "When true, only sub work stages that can be started right now are returned",
          "type": "boolean"
        },
        "after_date": {
          "format": "date-time",
          "description": "Filter sub work stages whose planned start time is on or after this date",
          "type": "string"
        },
        "before_date": {
          "format": "date-time",
          "description": "Filter sub work stages whose planned start time is on or before this date",
          "type": "string"
        },
        "states": {
          "description": "Filter by one or more state codes",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "person": {
          "format": "int32",
          "description": "Filter by the assigned person number. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "read_materials": {
          "description": "When true, the response includes the materials reserved for each sub work stage",
          "type": "boolean"
        },
        "worknumbers": {
          "description": "Filter by one or more work numbers (työnumerot)",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "show_in_compilation": {
          "description": "Should sub_workstage_rowtype = 9 (in compilation) jobs be included.",
          "type": "boolean"
        },
        "machine_groups": {
          "description": "Filter by one or more machine group ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "machines": {
          "description": "Filter by one or more machine codes",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "project_number": {
          "format": "int32",
          "description": "Filter by project number (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "Filter by project phase id (projektivaihe). For possible values, refer to /api/projects/{number}/phase\r\n[here](#tag/projects/operation/Project_GetPhases)",
          "type": "integer"
        },
        "sales_order_number": {
          "format": "int32",
          "description": "Filter by sales order number",
          "type": "integer"
        },
        "only_own_machines": {
          "description": "When true, only sub work stages on the user's own machines are returned",
          "type": "boolean"
        },
        "material_code": {
          "description": "Filter sub work stages whose materials contain the given product code",
          "type": "string"
        },
        "workphases": {
          "description": "Filter by one or more work phase ids (työvaihekoodit)",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "customer_number": {
          "format": "int32",
          "description": "Filter by the customer number (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "sort_field": {
          "description": "Sort field. Default is \"sub_workstage_start_time\". Accepted shortcuts: id, product_code, state, customer_number, start_time, end_time",
          "type": "string"
        },
        "sort_order": {
          "description": "Sort order. \"ASC\" (default) or \"DESC\"",
          "type": "string"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Production.ProductSubWorkStage]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductSubWorkStage"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Production.ProductSubWorkStage]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductSubWorkStage"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Production.ProductionJobHandling]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductionJobHandling"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.ProductionJobHandling": {
      "description": "Job handling data returned by GET /api/production/{person}/main_ws/sub_ws/{id}/jobhandling — describes how a person should record work on a sub work stage",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the job handling entry",
          "type": "integer"
        },
        "sub_workstage_id": {
          "format": "int32",
          "description": "The sub work stage this handling belongs to",
          "type": "integer"
        },
        "person": {
          "format": "int32",
          "description": "The person number doing the job (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "job_hours": {
          "format": "double",
          "description": "The hours already logged on the job",
          "type": "number"
        },
        "amount": {
          "format": "double",
          "description": "The amount already produced on the job",
          "type": "number"
        },
        "setting_cost": {
          "format": "int32",
          "description": "The accumulated setting cost (asetuskustannus)",
          "type": "integer"
        },
        "hide_ready_option": {
          "description": "When true, the \"ready\" option is hidden from the worker UI",
          "type": "boolean"
        },
        "job_done": {
          "description": "Indicates the job is already done",
          "type": "boolean"
        },
        "next_job_info": {
          "description": "Free-text info about the next job in the chain",
          "type": "string"
        },
        "job_start_time": {
          "format": "date-time",
          "description": "Timestamp when the worker started the job",
          "type": "string"
        },
        "workhour_count": {
          "format": "int32",
          "description": "The number of recorded workhour entries for this job",
          "type": "integer"
        },
        "stock": {
          "format": "int32",
          "description": "The default stock for stock postings on this job. For possible values, refer to /api/settings/products/stocks",
          "type": "integer"
        },
        "shelf": {
          "description": "The default shelf for stock postings on this job",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ProductionJobStart": {
      "description": "Proxy for starting a job",
      "type": "object",
      "properties": {
        "machine_code": {
          "description": "Machine code. Uses default machine from job if empty/does not exist",
          "type": "string"
        },
        "comment_main": {
          "description": "Job's comment. comment_main = null keeps existing comment.",
          "type": "string"
        },
        "tools": {
          "description": "Job's selected tools, list of id-numbers",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "batchnr": {
          "description": "Job's pre-filled batchnumber which is being produced",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.ProductionJobDone": {
      "description": "Model for completion entry",
      "type": "object",
      "properties": {
        "sub_workstage_id": {
          "format": "int32",
          "description": "The id of the sub work stage being completed",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The person number completing the job (henkilönumero). For possible values, refer to /api/persons",
          "type": "integer"
        },
        "done_amount": {
          "format": "double",
          "description": "The produced amount",
          "type": "number"
        },
        "job_done": {
          "description": "When true, the sub work stage is marked fully done",
          "type": "boolean"
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock the produced amount is placed in. For possible values, refer to /api/settings/products/stocks",
          "type": "integer"
        },
        "shelf": {
          "description": "The shelf for the produced amount",
          "type": "string"
        },
        "setting_cost": {
          "format": "int32",
          "description": "The setting cost recorded against the job",
          "type": "integer"
        },
        "next_job_info": {
          "description": "Free-text info passed to the next job",
          "type": "string"
        },
        "job_comment": {
          "description": "Free-text comment for the completion entry",
          "type": "string"
        },
        "start_date": {
          "format": "date-time",
          "description": "The job's start date",
          "type": "string"
        },
        "done_date": {
          "format": "date-time",
          "description": "The completion date",
          "type": "string"
        },
        "hours": {
          "format": "double",
          "description": "Hours recorded for the completion",
          "type": "number"
        },
        "what_to_do_with_other_workhours": {
          "format": "int32",
          "description": "What to do with the other concurrent workhours when the job ends",
          "type": "integer"
        },
        "failed_amount": {
          "format": "double",
          "description": "The failed amount that did not pass quality",
          "type": "number"
        },
        "failed_date": {
          "format": "date-time",
          "description": "The date of the failure",
          "type": "string"
        },
        "failed_description": {
          "description": "Free-text failure description",
          "type": "string"
        },
        "failed_sec_type": {
          "format": "int32",
          "description": "The fail second-level type code",
          "type": "integer"
        },
        "failed_add_costprice": {
          "description": "When true, the failed amount's cost is added back to the cost base",
          "type": "boolean"
        },
        "fail_codes": {
          "description": "The fail codes recorded against the failed amount",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "serials": {
          "description": "Serial numbers produced",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductionJobDoneSerial"
          }
        },
        "batches": {
          "description": "Stock transaction batches recorded for the produced amount",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
          }
        },
        "material_consumptions": {
          "description": "Material consumption entries for the job",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.MaterialConsumption"
          }
        },
        "standard_inspections": {
          "description": "Standard inspection results recorded with the completion",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.JobDoneStandardInspection"
          }
        },
        "compilation_amounts": {
          "description": "Compilation job amounts produced (for compilation work numbers)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductionJobCompilationAmount"
          }
        },
        "failed_compilation_amounts": {
          "description": "Compilation job amounts that failed quality control",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductionJobCompilationAmount"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Production.ProductionJobDoneSerial": {
      "description": "Model for serials in completion entry",
      "type": "object",
      "properties": {
        "serialnr_code": {
          "description": "The serial number code (sarjanumero)",
          "type": "string"
        },
        "serialnr_description": {
          "description": "The serial number's display description",
          "type": "string"
        },
        "serialnr_product_code": {
          "description": "The product code the serial belongs to",
          "type": "string"
        },
        "serialnr_worknumber": {
          "format": "int32",
          "description": "The work number the serial is produced on",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.MaterialConsumption": {
      "description": "Model for material consumption",
      "type": "object",
      "properties": {
        "structure_id": {
          "format": "int32",
          "description": "The id of the sub structure row being consumed",
          "type": "integer"
        },
        "consumption_amount": {
          "format": "double",
          "description": "The amount consumed",
          "type": "number"
        },
        "defective_amount": {
          "format": "double",
          "description": "The amount lost as defective",
          "type": "number"
        },
        "shelves": {
          "description": "Per-shelf breakdown of the consumption",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.MaterialConsumptionShelf"
          }
        },
        "batches": {
          "description": "Per-batch breakdown of the consumption",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.MaterialConsumptionBatch"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Production.JobDoneStandardInspection": {
      "description": "Model for standard inspections in completion entry",
      "type": "object",
      "properties": {
        "definition_id": {
          "format": "int32",
          "description": "The inspection definition id",
          "type": "integer"
        },
        "value": {
          "format": "double",
          "description": "The measured / recorded value",
          "type": "number"
        },
        "comment": {
          "description": "Free-text comment on the inspection result",
          "type": "string"
        },
        "batch": {
          "description": "The batch number being inspected",
          "type": "string"
        },
        "serial": {
          "description": "The serial number being inspected",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.ProductionJobCompilationAmount": {
      "description": "Model for compilation amount in completion entry",
      "type": "object",
      "properties": {
        "worknumber": {
          "format": "int32",
          "description": "Worknumber",
          "type": "integer"
        },
        "main_structure_id": {
          "format": "int32",
          "description": "Main structure id",
          "type": "integer"
        },
        "amount": {
          "format": "double",
          "description": "Amount",
          "type": "number"
        },
        "shelf": {
          "description": "Shelf",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.MaterialConsumptionShelf": {
      "description": "Shelf model for material consumption",
      "type": "object",
      "properties": {
        "shelf": {
          "description": "The shelf code (hylly)",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount taken from this shelf",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.MaterialConsumptionBatch": {
      "description": "Batch model for material consumption",
      "type": "object",
      "properties": {
        "batchnr_id": {
          "format": "int32",
          "description": "The batch's internal id",
          "type": "integer"
        },
        "batchnr_suppliercode": {
          "description": "The supplier batch code",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount taken from this batch",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.PostEndJob": {
      "description": "Payload for the legacy end_job endpoint — combines main work stage, sub structures and end job data",
      "type": "object",
      "properties": {
        "main_ws": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductMainWorkStage",
          "description": "The main work stage being finalized"
        },
        "sub_structures": {
          "description": "The sub structures affected by the end job",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductSubStructure"
          }
        },
        "end_job_data": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductionEndJob",
          "description": "The end job data (produced amounts, failures, etc.)"
        }
      }
    },
    "LemonRest.Models.Proxy.Production.ProductionEndJob": {
      "description": "Payload used by the legacy end_job endpoint — finalizes a sub work stage with the produced and failed amounts",
      "type": "object",
      "properties": {
        "done": {
          "description": "Indicates the job is fully done",
          "type": "boolean"
        },
        "endTime": {
          "format": "date-time",
          "description": "The timestamp when the job was ended",
          "type": "string"
        },
        "hours": {
          "format": "double",
          "description": "The hours recorded on the job",
          "type": "number"
        },
        "amount": {
          "format": "double",
          "description": "The produced amount",
          "type": "number"
        },
        "amount2": {
          "format": "double",
          "description": "Secondary produced amount",
          "type": "number"
        },
        "failed_amount": {
          "format": "double",
          "description": "The amount that failed quality control",
          "type": "number"
        },
        "money": {
          "format": "double",
          "description": "The money / cost recorded against the job",
          "type": "number"
        },
        "stock_shelf": {
          "description": "The stock shelf used for the produced amount",
          "type": "string"
        },
        "info": {
          "description": "Free-text info",
          "type": "string"
        },
        "payroll_type": {
          "format": "int32",
          "description": "The payroll type code applied to the recorded hours",
          "type": "integer"
        },
        "fail_date": {
          "format": "date-time",
          "description": "The date of the failure (when reporting failed production)",
          "type": "string"
        },
        "fail_codes": {
          "description": "The fail codes recorded against the failed amount",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "fail_description": {
          "description": "Free-text failure description",
          "type": "string"
        },
        "fail_sec_type": {
          "format": "int32",
          "description": "The fail second-level type code",
          "type": "integer"
        },
        "create_sub_contract": {
          "description": "When true, a subcontracting purchase order is created from this job",
          "type": "boolean"
        },
        "purchase_order_type": {
          "format": "int32",
          "description": "The purchase order type code used when create_sub_contract is true",
          "type": "integer"
        },
        "what_to_do_with_other_workhours": {
          "format": "int32",
          "description": "What to do with the other concurrent workhours when the job ends",
          "type": "integer"
        },
        "transaction_batches": {
          "description": "Stock transaction batches recorded against the produced amount",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
          }
        },
        "serial_numbers": {
          "description": "Serial numbers recorded against the produced amount",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionSerialNumber"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Production.ProductJobSerialNumber]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.ProductJobSerialNumber"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Production.ProductJobSerialNumber": {
      "description": "A production job serial number (tuotannon sarjanumero)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the serial entry",
          "type": "integer"
        },
        "job_id": {
          "format": "int32",
          "description": "The job id the serial belongs to",
          "type": "integer"
        },
        "serial": {
          "description": "The serial number value",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Production.WorkstageMaterial]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Production.WorkstageMaterial"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.StructurePicking": {
      "description": "Production picking model — used by POST /main_ws/{id}/picking to record collected material amounts (keräily)",
      "type": "object",
      "properties": {
        "sub_structure_id": {
          "format": "int32",
          "description": "The sub structure row being picked from",
          "type": "integer"
        },
        "picked_amount": {
          "format": "double",
          "description": "The amount that has been picked",
          "type": "number"
        },
        "batch": {
          "description": "The batch number picked (when applicable)",
          "type": "string"
        },
        "stock": {
          "format": "int32",
          "description": "The stock the material is picked from. For possible values, refer to /api/settings/products/stocks",
          "type": "integer"
        },
        "shelf": {
          "description": "The shelf the material is picked from",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.NewStructurePicking": {
      "description": "New production picking model — used by PUT /main_ws/{worknumber}/picking to add new picked materials onto a work number (uusi keräily)",
      "type": "object",
      "properties": {
        "product_code": {
          "description": "The product code of the new material (tuotekoodi). For possible values, refer to /api/products",
          "type": "string"
        },
        "picked_amount": {
          "format": "double",
          "description": "The amount that has been picked",
          "type": "number"
        },
        "sub_structure_row": {
          "format": "int32",
          "description": "The row position on the sub structure",
          "type": "integer"
        },
        "level": {
          "format": "int32",
          "description": "The nesting level in the structure tree",
          "type": "integer"
        },
        "father_id": {
          "format": "int32",
          "description": "The id of the parent structure row",
          "type": "integer"
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock number the material is picked from. For possible values, refer to /api/settings/products/stocks",
          "type": "integer"
        },
        "batch": {
          "description": "The batch number picked (when applicable)",
          "type": "string"
        },
        "subworkstage_id": {
          "format": "int32",
          "description": "The sub work stage the material is consumed by",
          "type": "integer"
        },
        "shelf": {
          "description": "The shelf the material is picked from",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Machine]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Machine"
        }
      }
    },
    "LemonRest.Models.Proxy.Machine": {
      "description": "A production machine (kone) used in sub work stages",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the machine",
          "type": "integer"
        },
        "group_id": {
          "format": "int32",
          "description": "The id of the machine group",
          "type": "integer"
        },
        "code": {
          "description": "The machine code",
          "type": "string"
        },
        "description": {
          "description": "The machine's display description",
          "type": "string"
        },
        "hour_price": {
          "format": "double",
          "description": "The hourly cost rate for the machine",
          "type": "number"
        },
        "capacity": {
          "format": "double",
          "description": "The machine's nominal capacity",
          "type": "number"
        },
        "capacity_unit": {
          "description": "The unit of the capacity value",
          "type": "string"
        },
        "costcenter": {
          "description": "The machine's default cost center (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n            [here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "father_code": {
          "description": "The parent machine's code in the hierarchy",
          "type": "string"
        },
        "level": {
          "format": "int32",
          "description": "The nesting level in the machine hierarchy",
          "type": "integer"
        },
        "order": {
          "format": "int32",
          "description": "The display order",
          "type": "integer"
        },
        "is_low_level": {
          "description": "Indicates this is a low-level (leaf) machine entry",
          "type": "boolean"
        },
        "load_type": {
          "format": "int32",
          "description": "The load type code",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The machine type code",
          "type": "integer"
        },
        "load_factor": {
          "format": "int32",
          "description": "The load factor used in scheduling",
          "type": "integer"
        },
        "is_calculation_required": {
          "description": "Indicates that the machine requires calculation",
          "type": "boolean"
        },
        "stock": {
          "format": "int32",
          "description": "The default stock for the machine. For possible values, refer to /api/settings/products/stocks",
          "type": "integer"
        },
        "dimension_code": {
          "description": "The dimension classification code for the machine",
          "type": "string"
        },
        "is_overload_capacity": {
          "description": "Indicates the machine allows overload capacity",
          "type": "boolean"
        },
        "is_disabled": {
          "description": "Indicates the machine is disabled / inactive",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.QueryFilters.MachineFilter": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "type": {
          "format": "int32",
          "type": "integer"
        },
        "hour_price": {
          "format": "double",
          "type": "number"
        },
        "capacity": {
          "format": "double",
          "type": "number"
        },
        "is_disabled": {
          "type": "boolean"
        },
        "group_id": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Machine]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Machine"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Link]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.MaterialStandardInspectionArguments": {
      "description": "Arguments for initializing material standard inspection list",
      "type": "object",
      "properties": {
        "person_number": {
          "format": "int32",
          "type": "integer"
        },
        "serial_number": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "batch_number": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ProjectFilter": {
      "description": "Filter for querying projects. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "project_number": {
          "description": "Filter by project numbers. Accepts a list of project numbers",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "project_type": {
          "description": "Filter by project types. Accepts a list of project type ids. For possible values, refer to /api/codelist/description?filter.codeListFilter=PROJECT_TYPE\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "project_state": {
          "format": "int32",
          "description": "Filter by a single project state. For possible values, refer to /api/settings/states/{state_source}\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "Filter by the project customer's number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "orderer_customer_number": {
          "format": "int32",
          "description": "Filter by the orderer customer's number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "invoicing_customer_id": {
          "format": "int32",
          "description": "Filter by the invoicing customer's internal id",
          "type": "integer"
        },
        "created_before": {
          "format": "date-time",
          "description": "Filter projects created on or before this date (project_date)",
          "type": "string"
        },
        "created_after": {
          "format": "date-time",
          "description": "Filter projects created on or after this date (project_date)",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Filter projects last edited on or before this date (edit_date)",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "description": "Filter projects last edited on or after this date (edit_date)",
          "type": "string"
        },
        "states": {
          "description": "Filter by a list of project states (alternative to project_state for multi-state filtering)",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "contact_personnumber": {
          "format": "int32",
          "description": "Filter projects that have the given person number assigned as a project contact",
          "type": "integer"
        },
        "show_models": {
          "description": "When set to false, model/template projects (project_number = 0) are excluded from the result",
          "type": "boolean"
        },
        "only_actives": {
          "description": "When set to true, only active projects are returned (state_number &lt; 90)",
          "type": "boolean"
        },
        "get_links": {
          "description": "When set to true, external links are fetched and attached to each project in the response",
          "type": "boolean"
        },
        "costcenter": {
          "description": "Filter by cost center code (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "get_lists": {
          "description": "When set to true (default), child collections such as phases, contacts, and customers are included in each project",
          "type": "boolean"
        },
        "sort_field": {
          "description": "Sort field (database column name). Default is \"project_id\". Common values: project_id, project_date, project_number, project_startdate.\r\nFalls back to default if column does not exist.",
          "type": "string"
        },
        "sort_desc": {
          "description": "Sorting order. Default is ascending (false).",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Project]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Project"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Project": {
      "description": "The project model with full details including phases, contacts, customers, worksite, and links",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The project's id (same as project_id)",
          "type": "integer"
        },
        "project_id": {
          "format": "int32",
          "description": "The project's internal id",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "description": "The project's number (projektinumero)",
          "type": "integer"
        },
        "project_state": {
          "format": "int32",
          "description": "The project state (tila). For possible values, refer to /api/settings/states/{state_source}\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "sales_order_number": {
          "format": "int32",
          "description": "The linked sales order number if the project was created from an order (tilausnumero)",
          "type": "integer"
        },
        "project_description": {
          "description": "Short description of the project",
          "type": "string"
        },
        "project_fulldescription": {
          "description": "Long, free-form description of the project",
          "type": "string"
        },
        "offered": {
          "format": "double",
          "description": "Total amount offered for the project (tarjottu)",
          "type": "number"
        },
        "invoiced": {
          "format": "double",
          "description": "Total amount invoiced for the project (laskutettu)",
          "type": "number"
        },
        "ordered": {
          "format": "double",
          "description": "Total amount ordered against the project (tilattu)",
          "type": "number"
        },
        "purchase_ordered": {
          "format": "double",
          "description": "Total amount of purchase orders linked to the project (ostotilaukset)",
          "type": "number"
        },
        "purchase_invoice": {
          "format": "double",
          "description": "Total amount of purchase invoices linked to the project (ostolaskut)",
          "type": "number"
        },
        "payroll": {
          "format": "double",
          "description": "Total payroll cost recorded against the project (palkat)",
          "type": "number"
        },
        "workcosts": {
          "format": "double",
          "description": "Total work cost recorded against the project (työkustannukset)",
          "type": "number"
        },
        "project_profit_purchase": {
          "format": "double",
          "description": "Project profit from purchases (ostokate)",
          "type": "number"
        },
        "project_profit_travel": {
          "format": "double",
          "description": "Project profit from travel expenses (matkakate)",
          "type": "number"
        },
        "project_contacts": {
          "description": "Internal contacts on the project — Lemonsoft persons (henkilöt)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectContact"
          }
        },
        "project_customer_contacts": {
          "description": "Customer-side contacts on the project (free-text contact entries, not linked to a customer registry)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectCustomerContact"
          }
        },
        "project_phases": {
          "description": "The project's phases (vaiheet)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectPhase"
          }
        },
        "customer_name": {
          "description": "The customer's name",
          "type": "string"
        },
        "project_type": {
          "format": "int32",
          "description": "The project type (projektityyppi). For possible values, refer to /api/codelist/description?filter.codeListFilter=PROJECT_TYPE\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "project_date": {
          "format": "date-time",
          "description": "The project date (projektin päiväys)",
          "type": "string"
        },
        "project_startdate": {
          "format": "date-time",
          "description": "The project's planned start date",
          "type": "string"
        },
        "project_enddate": {
          "format": "date-time",
          "description": "The project's planned end date",
          "type": "string"
        },
        "project_commissioning_date": {
          "format": "date-time",
          "description": "The date the project was commissioned/handed over (käyttöönottopäivä)",
          "type": "string"
        },
        "project_owner": {
          "description": "Name of the project owner (projektin omistaja)",
          "type": "string"
        },
        "person_manager_number": {
          "format": "int32",
          "description": "The project manager's person number (vastuuhenkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "project_note": {
          "description": "Free-form note attached to the project",
          "type": "string"
        },
        "project_customer_number": {
          "format": "int32",
          "description": "The project customer's number (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "project_calculate_type": {
          "format": "int32",
          "description": "The project's calculation type (laskentatapa)",
          "type": "integer"
        },
        "project_worksitecode": {
          "description": "The worksite code on the project (työmaakoodi)",
          "type": "string"
        },
        "project_worksitenumber": {
          "description": "The worksite number on the project (työmaanumero)",
          "type": "string"
        },
        "project_report_type": {
          "format": "int32",
          "description": "The project's report type (raporttityyppi)",
          "type": "integer"
        },
        "project_lta": {
          "description": "The LTA (collective agreement) code for the project. For possible values, refer to /api/settings/ltas\r\n[here](#tag/Settings/operation/Settings_GetLtas)",
          "type": "string"
        },
        "site": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Site",
          "description": "The worksite (työmaa) attached to the project"
        },
        "codelist_costcenter": {
          "description": "The cost center code for the project (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "project_contract_type": {
          "format": "int32",
          "description": "The project's contract type (sopimustyyppi)",
          "type": "integer"
        },
        "project_invoicing_type": {
          "format": "int32",
          "description": "The project's invoicing type (laskutustyyppi). For possible values, refer to /api/codelist/description?filter.codeListFilter=INVOICING_TYPE\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "invoicing_customer_id": {
          "format": "int32",
          "description": "The invoicing customer's internal id (laskutusasiakas)",
          "type": "integer"
        },
        "invoicing_customer_number": {
          "format": "int32",
          "description": "The invoicing customer's number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "orderer_customer_id": {
          "format": "int32",
          "description": "The orderer customer's internal id (tilaaja-asiakas)",
          "type": "integer"
        },
        "orderer_customer_number": {
          "format": "int32",
          "description": "The orderer customer's number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "project_customers": {
          "description": "Per-customer invoicing splits for the project (laskutusasiakkaat ja prosenttiosuudet)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectCustomer"
          }
        },
        "purchaserow_handle": {
          "format": "int32",
          "description": "How purchase order rows are handled for this project (0–2)",
          "maximum": 2,
          "minimum": 0,
          "type": "integer"
        },
        "project_text": {
          "description": "Free-form text attached to the project (printable on documents)",
          "type": "string"
        },
        "project_working_time_instructions": {
          "description": "Working time instructions shown for the project (työaikaohje)",
          "type": "string"
        },
        "project_enterprise": {
          "format": "int32",
          "description": "The enterprise/business unit the project belongs to (yritys)",
          "type": "integer"
        },
        "project_invoice_ordermark": {
          "description": "Order mark printed on the project's invoices (laskun tilausmerkki)",
          "type": "string"
        },
        "project_work_pricelist": {
          "format": "int32",
          "description": "Work pricelist applied to the project (työn hinnasto)",
          "type": "integer"
        },
        "seller": {
          "format": "int32",
          "description": "The seller's person number (myyjänumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "modified_date": {
          "format": "date-time",
          "description": "Timestamp when the project was last modified",
          "type": "string"
        },
        "team": {
          "format": "int32",
          "description": "The team responsible for the project. For possible values, refer to /api/settings/teams\r\n[here](#tag/Settings/operation/Settings_GetTeams)",
          "type": "integer"
        },
        "team_description": {
          "description": "The team's description (read-only)",
          "type": "string"
        },
        "public_bit": {
          "description": "Indicates if the project is public (visible to all users)",
          "type": "boolean"
        },
        "links": {
          "description": "External links attached to the project. Only populated when the request specifies get_links = true",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProjectContact": {
      "description": "An internal contact (Lemonsoft person) attached to the project",
      "type": "object",
      "properties": {
        "project_contact_id": {
          "format": "int32",
          "description": "The project contact's id",
          "type": "integer"
        },
        "project_id": {
          "format": "int32",
          "description": "The project's internal id this contact belongs to",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The contact person's number (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "person_name": {
          "description": "The contact person's name (read-only)",
          "type": "string"
        },
        "project_steering_bit": {
          "description": "Indicates if this contact is part of the project's steering group (ohjausryhmä)",
          "type": "boolean"
        },
        "project_role": {
          "format": "int32",
          "description": "The contact's role on the project",
          "type": "integer"
        },
        "project_contacts_reference": {
          "description": "Indicates if this contact acts as the project reference person",
          "type": "boolean"
        },
        "project_contact_skills": {
          "description": "Skills/competencies attached to this project contact",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectContactSkill"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProjectCustomerContact": {
      "description": "A free-text customer contact on the project — not linked to the customer registry",
      "type": "object",
      "properties": {
        "project_customer_contact_id": {
          "format": "int32",
          "description": "The project customer contact's id",
          "type": "integer"
        },
        "project_id": {
          "format": "int32",
          "description": "The project's internal id this contact belongs to",
          "type": "integer"
        },
        "contact_name": {
          "description": "The contact's name",
          "type": "string"
        },
        "contact_email": {
          "description": "The contact's email address",
          "type": "string"
        },
        "contact_tel": {
          "description": "The contact's phone number",
          "type": "string"
        },
        "contact_fax": {
          "description": "The contact's fax number",
          "type": "string"
        },
        "contact_description": {
          "description": "Short description of the contact",
          "type": "string"
        },
        "contact_notes": {
          "description": "Free-form notes about the contact",
          "type": "string"
        },
        "contact_role": {
          "format": "int32",
          "description": "The contact's role on the project",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.ProjectPhase": {
      "description": "A phase (vaihe) of a project — used to plan and track work and material on sub-parts of the project",
      "type": "object",
      "properties": {
        "project_number": {
          "format": "int32",
          "description": "The project's number this phase belongs to",
          "type": "integer"
        },
        "product_description": {
          "description": "The phase product's description (read-only, derived from product_code)",
          "type": "string"
        },
        "phase_description": {
          "description": "The phase description (read-only mirror of project_phase_description)",
          "type": "string"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "The project phase's id",
          "type": "integer"
        },
        "project_phase_father_id": {
          "format": "int32",
          "description": "The parent phase id if this phase is a sub-phase (alivaihe)",
          "type": "integer"
        },
        "project_id": {
          "format": "int32",
          "description": "The project's internal id this phase belongs to",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The responsible person's number (vastuuhenkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "project_phase_state": {
          "format": "int32",
          "description": "The phase's state (vaiheen tila). For possible values, refer to /api/settings/states/{state_source}\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "project_phase_type": {
          "format": "int32",
          "description": "The phase's type (vaiheen tyyppi). For possible values, refer to /api/codelist/description?filter.codeListFilter=PROJECTPHASES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "project_phase_part_payment": {
          "format": "double",
          "description": "The phase's part payment amount (osamaksu)",
          "type": "number"
        },
        "project_phase_number": {
          "format": "int32",
          "description": "The phase's running number within the project (vaiheen numero)",
          "type": "integer"
        },
        "project_person_name": {
          "description": "The responsible person's display name (read-only)",
          "type": "string"
        },
        "project_phase_header": {
          "description": "The phase's header text",
          "type": "string"
        },
        "project_phase_description": {
          "description": "The phase's description",
          "type": "string"
        },
        "project_phase_start_date": {
          "format": "date-time",
          "description": "The phase's planned start date",
          "type": "string"
        },
        "start_time": {
          "format": "date-time",
          "description": "The phase's planned start time",
          "type": "string"
        },
        "project_phase_end_date": {
          "format": "date-time",
          "description": "The phase's planned end date",
          "type": "string"
        },
        "end_time": {
          "format": "date-time",
          "description": "The phase's planned end time",
          "type": "string"
        },
        "project_phase_code": {
          "description": "The phase's code (vaihekoodi)",
          "type": "string"
        },
        "phase_plan_workhour": {
          "format": "double",
          "description": "Planned workhours for the phase (suunniteltu työtunnit)",
          "type": "number"
        },
        "phase_plan_work": {
          "format": "double",
          "description": "Planned work cost for the phase (suunniteltu työ)",
          "type": "number"
        },
        "phase_plan_material": {
          "format": "double",
          "description": "Planned material cost for the phase (suunniteltu materiaali)",
          "type": "number"
        },
        "phase_actual_workhour": {
          "format": "double",
          "description": "Actual workhours recorded on the phase (toteutuneet työtunnit)",
          "type": "number"
        },
        "phase_actual_work": {
          "format": "double",
          "description": "Actual work cost recorded on the phase (toteutunut työ)",
          "type": "number"
        },
        "phase_actual_material": {
          "format": "double",
          "description": "Actual material cost recorded on the phase (toteutunut materiaali)",
          "type": "number"
        },
        "phase_coming_workhour": {
          "format": "double",
          "description": "Workhours still to come on the phase (tulevat työtunnit)",
          "type": "number"
        },
        "phase_coming_work": {
          "format": "double",
          "description": "Work cost still to come on the phase (tuleva työ)",
          "type": "number"
        },
        "phase_coming_material": {
          "format": "double",
          "description": "Material cost still to come on the phase (tuleva materiaali)",
          "type": "number"
        },
        "project_crm_type": {
          "format": "int32",
          "description": "The CRM transaction type linked to the phase. For possible values, refer to /api/settings/crm_types\r\n[here](#tag/Settings/operation/Settings_GetCrmTypes)",
          "type": "integer"
        },
        "project_order": {
          "format": "int32",
          "description": "The phase's ordering value at the project level",
          "type": "integer"
        },
        "project_phase_order": {
          "format": "int32",
          "description": "The phase's ordering value within the phase list",
          "type": "integer"
        },
        "person_name": {
          "description": "The responsible person's display name (read-only)",
          "type": "string"
        },
        "product_code": {
          "description": "The product code attached to the phase (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work number linked to the phase (työnumero)",
          "type": "integer"
        },
        "project_phase_dimension": {
          "description": "The phase's dimension code (kohdistus/dimensio)",
          "type": "string"
        },
        "project_phase_amount": {
          "format": "double",
          "description": "The phase's quantity (määrä)",
          "type": "number"
        },
        "project_phase_amount2": {
          "format": "double",
          "description": "The phase's secondary quantity (määrä 2)",
          "type": "number"
        },
        "project_phase_mat_profit": {
          "format": "double",
          "description": "The phase's material profit (materiaalikate)",
          "type": "number"
        },
        "project_phase_work_profit": {
          "format": "double",
          "description": "The phase's work profit (työkate)",
          "type": "number"
        },
        "project_phase_account": {
          "description": "The accounting account assigned to the phase (tili). For possible values, refer to /api/settings/chart_of_accounts\r\n[here](#tag/Settings/operation/Settings_GetChartOfAccounts)",
          "type": "string"
        },
        "workhour_price": {
          "format": "double",
          "description": "The workhour price for the phase (tuntihinta)",
          "type": "number"
        },
        "project_phase_readiness": {
          "format": "double",
          "description": "The phase's completion percentage (valmiusaste)",
          "type": "number"
        },
        "project_phase_subcosts": {
          "format": "double",
          "description": "Subcontracting costs on the phase (alihankinta)",
          "type": "number"
        },
        "project_phase_cost1": {
          "format": "double",
          "description": "Additional cost field 1 on the phase",
          "type": "number"
        },
        "project_phase_cost2": {
          "format": "double",
          "description": "Additional cost field 2 on the phase",
          "type": "number"
        },
        "project_phase_skills": {
          "description": "Skills/competencies required on the phase",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectPhaseSkill"
          }
        },
        "project_phase_related_phase_id": {
          "format": "int32",
          "description": "Id of a related phase, if any (liittyvä vaihe)",
          "type": "integer"
        },
        "project_phase_installment_order_number": {
          "format": "int32",
          "description": "The phase's installment/order number on the invoicing plan (maksuerän järjestysnumero)",
          "type": "integer"
        },
        "delivery_customer_id": {
          "format": "int32",
          "description": "The delivery customer's internal id (toimitusasiakas)",
          "type": "integer"
        },
        "invoicing_customer_id": {
          "format": "int32",
          "description": "The invoicing customer's internal id (laskutusasiakas)",
          "type": "integer"
        },
        "orderer_customer_id": {
          "format": "int32",
          "description": "The orderer customer's internal id (tilaaja-asiakas)",
          "type": "integer"
        },
        "project_phase_commissioning_date": {
          "format": "date-time",
          "description": "The date the phase was commissioned/handed over (käyttöönottopäivä)",
          "type": "string"
        },
        "salary_exp_amount": {
          "format": "double",
          "description": "Salary expense quantity recorded on the phase",
          "type": "number"
        },
        "salary_exp": {
          "format": "double",
          "description": "Salary expense amount recorded on the phase (palkkakulut)",
          "type": "number"
        },
        "material_exp": {
          "format": "double",
          "description": "Material expense amount recorded on the phase (materiaalikulut)",
          "type": "number"
        },
        "subcontract_exp": {
          "format": "double",
          "description": "Subcontract expense amount recorded on the phase (alihankintakulut)",
          "type": "number"
        },
        "travel_exp": {
          "format": "double",
          "description": "Travel expense amount recorded on the phase (matkakulut)",
          "type": "number"
        },
        "allowance_exp": {
          "format": "double",
          "description": "Daily allowance expense amount recorded on the phase (päivärahat)",
          "type": "number"
        },
        "project_phase_contacts": {
          "description": "Contacts assigned to the phase",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectPhaseContact"
          }
        },
        "worktime_invoicing_type": {
          "format": "int32",
          "description": "The default invoicing type for work time recorded on the phase (työajan laskutustyyppi)",
          "type": "integer"
        },
        "worktime_material_invoicing_type": {
          "format": "int32",
          "description": "The default invoicing type for material recorded on the phase (materiaalin laskutustyyppi)",
          "type": "integer"
        },
        "extra_work": {
          "description": "Indicates if the phase is marked as extra work (lisätyö)",
          "type": "boolean"
        },
        "resource_capable_bit": {
          "description": "Indicates if the phase is resource-capable (resursoitavissa)",
          "type": "boolean"
        },
        "own_use_alv": {
          "description": "Indicates if the phase has VAT checked (oman käytön alv)",
          "type": "boolean"
        },
        "expenses": {
          "description": "Expense entries on the phase (kulukirjaukset)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectPhaseExpense"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Site": {
      "description": "Worksite information attached to a project (työmaa)",
      "type": "object",
      "properties": {
        "site_id": {
          "format": "int32",
          "description": "The site's internal id",
          "type": "integer"
        },
        "site_key": {
          "description": "The site's key code (työmaakoodi)",
          "type": "string"
        },
        "site_number": {
          "description": "The site's number (työmaanumero)",
          "type": "string"
        },
        "site_address": {
          "description": "The site's street address",
          "type": "string"
        },
        "site_postalcode": {
          "description": "The site's postal code",
          "type": "string"
        },
        "site_post_office": {
          "description": "The site's post office (city)",
          "type": "string"
        },
        "site_contact": {
          "description": "The site's contact person name",
          "type": "string"
        },
        "site_contact_phone": {
          "description": "The site contact's phone number",
          "type": "string"
        },
        "site_contact_email": {
          "description": "The site contact's email address",
          "type": "string"
        },
        "site_contact_address": {
          "description": "The site contact's street address",
          "type": "string"
        },
        "site_contact_postalcode": {
          "description": "The site contact's postal code",
          "type": "string"
        },
        "site_contact_post_office": {
          "description": "The site contact's post office (city)",
          "type": "string"
        },
        "site_contact_home_country": {
          "description": "The site contact's home country code",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ProjectCustomer": {
      "description": "An invoicing customer attached to the project — used when the project is split-invoiced across multiple customers",
      "type": "object",
      "properties": {
        "project_customer_id": {
          "format": "int32",
          "description": "The project customer's id",
          "type": "integer"
        },
        "project_id": {
          "format": "int32",
          "description": "The project's internal id",
          "type": "integer"
        },
        "customer_id": {
          "format": "int32",
          "description": "The customer's internal id",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer's number. For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_name": {
          "description": "The customer's name",
          "type": "string"
        },
        "customer_address1": {
          "description": "The customer's address line 1",
          "type": "string"
        },
        "customer_address2": {
          "description": "The customer's address line 2",
          "type": "string"
        },
        "customer_address3": {
          "description": "The customer's address line 3",
          "type": "string"
        },
        "customer_country": {
          "description": "The customer's country code. For possible values, refer to /api/codelist/description?filter.codeListFilter=COUNTRIES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "string"
        },
        "customer_contact": {
          "description": "The customer contact name",
          "type": "string"
        },
        "customer_contact_phone": {
          "description": "The customer contact's phone number",
          "type": "string"
        },
        "customer_contact_email": {
          "description": "The customer contact's email address",
          "type": "string"
        },
        "invoicing_percent": {
          "format": "double",
          "description": "The invoicing share for this customer as a percentage (laskutusprosentti)",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.ProjectContactSkill": {
      "description": "A skill/competency entry on a project contact (osaaminen)",
      "type": "object",
      "properties": {
        "project_contact_skill_id": {
          "format": "int32",
          "description": "The project contact skill's id",
          "type": "integer"
        },
        "project_contacts_id": {
          "format": "int32",
          "description": "The project contact id this skill is attached to",
          "type": "integer"
        },
        "person_skillprofile_id": {
          "format": "int32",
          "description": "The person's skill profile id (linked person_skillprofile)",
          "type": "integer"
        },
        "codelist_id": {
          "format": "int32",
          "description": "The codelist id describing the skill",
          "type": "integer"
        },
        "skill_description": {
          "description": "The skill description (read-only, derived from the codelist entry)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ProjectPhaseSkill": {
      "description": "A skill/competency requirement on a project phase",
      "type": "object",
      "properties": {
        "project_phase_skill_id": {
          "format": "int32",
          "description": "The phase skill's id",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "The project phase's id this skill belongs to",
          "type": "integer"
        },
        "codelist_id": {
          "format": "int32",
          "description": "The codelist id describing the skill",
          "type": "integer"
        },
        "codelist_description": {
          "description": "The skill's description (read-only, derived from the codelist entry)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.ProjectPhaseContact": {
      "description": "A contact (person) assigned to a project phase",
      "type": "object",
      "properties": {
        "project_phase_contact_id": {
          "format": "int32",
          "description": "The phase contact's id",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "The project phase's id this contact belongs to",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The contact person's number (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "person_name": {
          "description": "The contact person's name (read-only)",
          "type": "string"
        },
        "project_phase_team_bit": {
          "description": "Indicates if the contact is part of the phase's team (vaihetiimi)",
          "type": "boolean"
        },
        "project_phase_resource_amount": {
          "format": "int32",
          "description": "The amount of resource hours allocated to this contact on the phase",
          "type": "integer"
        },
        "project_contacts_total": {
          "format": "int32",
          "description": "Total number of contacts on the phase (read-only)",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.ProjectPhaseExpense": {
      "description": "A single expense row on a project phase (kulukirjaus) — used to record salary, material, subcontract, travel, and allowance amounts grouped by codelist",
      "type": "object",
      "properties": {
        "phase_id": {
          "format": "int32",
          "description": "The project phase's id this expense belongs to",
          "type": "integer"
        },
        "expense_id": {
          "format": "int32",
          "description": "The expense entry's id",
          "type": "integer"
        },
        "expense_group_id": {
          "format": "int32",
          "description": "The codelist id grouping the expense (e.g. 1 = salary). Defines the expense category",
          "type": "integer"
        },
        "expense_amount": {
          "format": "double",
          "description": "The expense quantity. Used together with expense_unitprice when expense_group_id = 1 (salary)",
          "type": "number"
        },
        "expense_unitprice": {
          "format": "double",
          "description": "The expense unit price. Used together with expense_amount when expense_group_id = 1 (salary)",
          "type": "number"
        },
        "expense_total": {
          "format": "double",
          "description": "The total expense amount. If omitted or zero, the system computes it as expense_amount × expense_unitprice",
          "type": "number"
        },
        "expense_locked": {
          "description": "Indicates if the expense entry is locked from updates. Locked entries are skipped on update",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Project]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Project"
        }
      }
    },
    "LemonRest.Models.QueryFilters.ProjectPhaseFilter": {
      "description": "Filter for querying project phases. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "sort_desc": {
          "description": "Sorting order. Default is ascending (false).",
          "type": "boolean"
        },
        "project_id": {
          "format": "int32",
          "description": "Filter by the parent project's internal id",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "description": "Filter by the parent project's number (projektinumero). When set, the returned phases also have project_number populated with this value",
          "type": "integer"
        },
        "state": {
          "format": "int32",
          "description": "Filter by phase state (vaiheen tila). For possible values, refer to /api/settings/states/{state_source}\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "Filter by phase type (vaiheen tyyppi). For possible values, refer to /api/codelist/description?filter.codeListFilter=PROJECTPHASES\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "id": {
          "format": "int32",
          "description": "Filter by phase id (project_phase_id)",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "Filter by the responsible person's number. For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "product_code": {
          "description": "Filter by product code attached to the phase. For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "worknumber": {
          "format": "int32",
          "description": "Filter by work number (työnumero)",
          "type": "integer"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[Lemonsoft.ProjectManagementLibrary.ProjectPhase]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Lemonsoft.ProjectManagementLibrary.ProjectPhase"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "Lemonsoft.ProjectManagementLibrary.ProjectPhase": {
      "type": "object",
      "properties": {
        "Project_phase_state": {
          "format": "int32",
          "type": "integer"
        },
        "SalaryExpAmount": {
          "format": "double",
          "type": "number"
        },
        "SalaryExp": {
          "format": "double",
          "type": "number"
        },
        "MaterialExp": {
          "format": "double",
          "type": "number"
        },
        "SubcontractExp": {
          "format": "double",
          "type": "number"
        },
        "TravelExp": {
          "format": "double",
          "type": "number"
        },
        "AllowanceExp": {
          "format": "double",
          "type": "number"
        },
        "Project": {
          "$ref": "#/definitions/Lemonsoft.ProjectManagementLibrary.Project"
        },
        "Project_number": {
          "format": "int32",
          "type": "integer"
        },
        "ProductDescription": {
          "type": "string"
        },
        "PhaseDescription": {
          "type": "string"
        },
        "Project_phase_id": {
          "format": "int32",
          "type": "integer"
        },
        "Project_phase_father_id": {
          "format": "int32",
          "type": "integer"
        },
        "Project_id": {
          "format": "int32",
          "type": "integer"
        },
        "Person_number": {
          "format": "int32",
          "type": "integer"
        },
        "Project_phase_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_phase_part_payment": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_number": {
          "format": "int32",
          "type": "integer"
        },
        "Project_person_name": {
          "type": "string"
        },
        "Project_phase_header": {
          "type": "string"
        },
        "Project_phase_description": {
          "type": "string"
        },
        "Project_phase_header_and_code": {
          "type": "string",
          "readOnly": true
        },
        "Project_phase_start_date": {
          "format": "date-time",
          "type": "string"
        },
        "Project_phase_end_date": {
          "format": "date-time",
          "type": "string"
        },
        "Project_phase_code": {
          "type": "string"
        },
        "Phase_plan_workhour": {
          "format": "double",
          "type": "number"
        },
        "Phase_plan_work": {
          "format": "double",
          "type": "number"
        },
        "Phase_plan_material": {
          "format": "double",
          "type": "number"
        },
        "Phase_actual_workhour": {
          "format": "double",
          "type": "number"
        },
        "Phase_actual_work": {
          "format": "double",
          "type": "number"
        },
        "Phase_actual_material": {
          "format": "double",
          "type": "number"
        },
        "Phase_coming_workhour": {
          "format": "double",
          "type": "number"
        },
        "Phase_coming_work": {
          "format": "double",
          "type": "number"
        },
        "Phase_coming_material": {
          "format": "double",
          "type": "number"
        },
        "Project_crm_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_order": {
          "format": "int32",
          "type": "integer"
        },
        "Project_phase_order": {
          "format": "int32",
          "type": "integer"
        },
        "Person_name": {
          "type": "string"
        },
        "Product_code": {
          "type": "string"
        },
        "Worknumber": {
          "format": "int32",
          "type": "integer"
        },
        "Project_phase_dimension": {
          "type": "string"
        },
        "Project_phase_amount": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_amount2": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_mat_profit": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_work_profit": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_account": {
          "type": "string"
        },
        "Workhour_price": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_readiness": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_subcosts": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_cost1": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_cost2": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_mustbedone": {
          "format": "double",
          "type": "number"
        },
        "Project_phase_settingtime": {
          "format": "int32",
          "type": "integer"
        },
        "Project_phase_settletime": {
          "format": "int32",
          "type": "integer"
        },
        "Project_phase_ahe": {
          "format": "double",
          "type": "number"
        }
      }
    },
    "Lemonsoft.ProjectManagementLibrary.Project": {
      "type": "object",
      "properties": {
        "Project_id": {
          "format": "int32",
          "type": "integer"
        },
        "Offered": {
          "format": "double",
          "type": "number"
        },
        "Invoiced": {
          "format": "double",
          "type": "number"
        },
        "Ordered": {
          "format": "double",
          "type": "number"
        },
        "Profit": {
          "format": "double",
          "type": "number"
        },
        "ProfitProcent": {
          "format": "double",
          "type": "number"
        },
        "PurchaseOrdered": {
          "format": "double",
          "type": "number"
        },
        "PurchaseInvoice": {
          "format": "double",
          "type": "number"
        },
        "Payroll": {
          "format": "double",
          "type": "number"
        },
        "WorkCosts": {
          "format": "double",
          "type": "number"
        },
        "Project_profit_purchase": {
          "format": "double",
          "type": "number"
        },
        "Project_profit_travel": {
          "format": "double",
          "type": "number"
        },
        "ProjectContacts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Lemonsoft.ProjectManagementLibrary.ProjectContact"
          }
        },
        "ProjectCustomerContacts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Lemonsoft.ProjectManagementLibrary.ProjectCustomerContact"
          }
        },
        "ProjectPhases": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Lemonsoft.ProjectManagementLibrary.ProjectPhase"
          }
        },
        "Project_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_date": {
          "format": "date-time",
          "type": "string"
        },
        "Edit_date": {
          "format": "date-time",
          "type": "string",
          "readOnly": true
        },
        "Project_owner": {
          "type": "string"
        },
        "Project_calculate_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_purchaserow_handle": {
          "format": "int32",
          "type": "integer"
        },
        "Project_text": {
          "type": "string"
        },
        "Project_workhour_invoice_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_workhour_material_invoice_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_purchase_invoice_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_travel_invoice_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_payment_term": {
          "format": "int32",
          "type": "integer"
        },
        "ProjectCustomerAgreementId": {
          "format": "int32",
          "type": "integer"
        },
        "Project_customer_reference": {
          "type": "string"
        },
        "Project_customer_order_number": {
          "type": "string"
        },
        "Project_invoice_ordermark": {
          "type": "string"
        },
        "Project_report_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_invoicing_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_work_pricelist": {
          "format": "int32",
          "type": "integer"
        },
        "Project_worksitecode": {
          "type": "string"
        },
        "Project_worksitenumber": {
          "type": "string"
        },
        "Project_enterprise": {
          "format": "int32",
          "type": "integer"
        },
        "Project_financing_type": {
          "format": "int32",
          "type": "integer"
        },
        "Project_FullDescription": {
          "type": "string"
        },
        "Project_startdate": {
          "format": "date-time",
          "type": "string"
        },
        "Project_enddate": {
          "format": "date-time",
          "type": "string"
        },
        "Person_manager_number": {
          "format": "int32",
          "type": "integer"
        },
        "Project_note": {
          "type": "string"
        },
        "MainDataPhases": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Lemonsoft.ProjectManagementLibrary.ProjectPhase"
          }
        },
        "Project_customer_number": {
          "format": "int32",
          "type": "integer"
        },
        "CustomerName": {
          "type": "string"
        },
        "Project_invoicing_customer_id": {
          "format": "int32",
          "type": "integer",
          "readOnly": true
        },
        "Project_invoicing_customer_name": {
          "type": "string",
          "readOnly": true
        },
        "Project_order_customer_name": {
          "type": "string",
          "readOnly": true
        },
        "Project_number": {
          "format": "int32",
          "type": "integer"
        },
        "Project_description": {
          "type": "string"
        }
      }
    },
    "Lemonsoft.ProjectManagementLibrary.ProjectContact": {
      "type": "object",
      "properties": {
        "Project": {
          "$ref": "#/definitions/Lemonsoft.ProjectManagementLibrary.Project"
        },
        "Project_contacts_id": {
          "format": "int32",
          "type": "integer"
        },
        "Project_id": {
          "format": "int32",
          "type": "integer"
        },
        "Person_number": {
          "format": "int32",
          "type": "integer"
        },
        "PersonName": {
          "type": "string"
        },
        "Project_steering_bit": {
          "type": "boolean"
        },
        "Project_contact_is_assistant_pm": {
          "type": "boolean"
        },
        "Project_role": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "Lemonsoft.ProjectManagementLibrary.ProjectCustomerContact": {
      "type": "object",
      "properties": {
        "Project": {
          "$ref": "#/definitions/Lemonsoft.ProjectManagementLibrary.Project"
        },
        "Project_customer_contacts_id": {
          "format": "int32",
          "type": "integer"
        },
        "Project_id": {
          "format": "int32",
          "type": "integer"
        },
        "Contact_name": {
          "type": "string"
        },
        "Contact_email": {
          "type": "string"
        },
        "Contact_tel": {
          "type": "string"
        },
        "Contact_fax": {
          "type": "string"
        },
        "Contact_desription": {
          "type": "string"
        },
        "Contact_notes": {
          "type": "string"
        },
        "Contact_role": {
          "format": "int32",
          "type": "integer"
        },
        "Customer_number": {
          "format": "int32",
          "type": "integer"
        },
        "Customer_contact_id": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.InvoiceFilter": {
      "description": "Filter for querying purchase invoices. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter",
      "type": "object",
      "properties": {
        "numbers": {
          "description": "Filter by invoice numbers. Accepts a list of invoice numbers",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "invoice_type": {
          "format": "int32",
          "description": "Filter by invoice type (ostolaskulaji). Default: -1 (all types)",
          "type": "integer"
        },
        "invoice_state": {
          "format": "int32",
          "description": "Filter by invoice state: 0 = Registered, 1 = Approved, 2 = In payment, 3 = Paid, 4 = In circulation, 5 = Rejected. Default: -1 (all states)",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "Filter by supplier's customer number (toimittajan asiakasnumero). Default: -1 (all). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "exported_bit": {
          "description": "Filter by exported status. When set, returns only invoices matching the exported state",
          "type": "boolean"
        },
        "description": {
          "description": "Filter by invoice description. Performs a contains search",
          "type": "string"
        },
        "created_before": {
          "format": "date-time",
          "description": "Filter invoices with invoice date before this date. Default: today + 5 years",
          "type": "string"
        },
        "created_after": {
          "format": "date-time",
          "description": "Filter invoices with invoice date after this date. Default: 1970-01-01",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Filter invoices modified before this date",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "description": "Filter invoices modified after this date",
          "type": "string"
        },
        "has_external_id": {
          "description": "When set to true, returns only invoices that have an external_id. When false, returns only invoices without external_id",
          "type": "boolean"
        },
        "external_id": {
          "format": "int32",
          "description": "Filter by exact external_id value",
          "type": "integer"
        },
        "include_dimension_descriptions": {
          "description": "When set to true, dimension descriptions (project, LTA, cost center, project phase) are included in the response for each invoice row",
          "type": "boolean"
        },
        "include_order_targetings": {
          "description": "When true, populates order_targetings on every invoice row. The list is populated only for\r\nrows whose targeting was recorded by the automatic invoice-targeting feature or via the\r\nLemonOnline targeting view; it is empty for invoices that were never targeted through those\r\nmechanisms (desktop-client legacy targeting paths are not reflected). Default false.",
          "type": "boolean"
        },
        "row_project_number": {
          "format": "int32",
          "description": "Filter by project number on invoice rows (projektinumero). Default: -1 (all). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "sort_field": {
          "description": "Sort field (database column name). Default is \"purchase_invoice_id\". Common values: purchase_invoice_id, purchase_invoice_date, purchase_invoice_number, purchase_invoice_duedate.\r\nFalls back to default if column does not exist.",
          "type": "string"
        },
        "sort_desc": {
          "description": "Sorting order. Default is ascending (false).",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PurchaseInvoice]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoice"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoice": {
      "description": "A purchase invoice (ostolasku) with header data, rows, payments, and circulation information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the purchase invoice",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The purchase invoice type (ostolaskulaji). For possible values, refer to /api/numberseries?filter.numberseries=2",
          "type": "integer"
        },
        "invoice_state": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceState",
          "description": "The state of the purchase invoice"
        },
        "number": {
          "format": "int32",
          "description": "The purchase invoice number",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The invoice date",
          "type": "string"
        },
        "description": {
          "description": "The invoice description or title (kuvaus)",
          "type": "string"
        },
        "totalsum": {
          "format": "double",
          "description": "The total amount of the invoice including taxes",
          "type": "number"
        },
        "payment_total": {
          "format": "double",
          "description": "The total amount of payments made in domestic currency",
          "type": "number"
        },
        "note": {
          "description": "The bank message or note",
          "type": "string"
        },
        "note_type": {
          "format": "int32",
          "description": "The bank message type",
          "type": "integer"
        },
        "note_text": {
          "description": "The bank message text",
          "type": "string"
        },
        "taxtype": {
          "description": "Indicates if taxes are included in prices",
          "type": "boolean"
        },
        "currency_code": {
          "description": "The currency code, ISO 4217 (valuuttakoodi). For possible values, refer to /api/settings/currency/{code}\r\n[here](#tag/Settings/operation/Settings_GetCurrency)",
          "type": "string"
        },
        "currency_rate": {
          "format": "double",
          "description": "The currency exchange rate (valuuttakurssi)",
          "type": "number"
        },
        "reference": {
          "description": "The invoice reference number (viite)",
          "type": "string"
        },
        "supplier_number": {
          "description": "The supplier's customer number (toimittajan asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "string"
        },
        "purchase_order_number": {
          "description": "The related purchase order number (tilausnumero)",
          "type": "string"
        },
        "payment_term": {
          "format": "int32",
          "description": "The payment term (maksuehto). For possible values, refer to /api/codelist/payment_term\r\n[here](#tag/codelist/operation/Codelist_ListPaymentTerms)",
          "type": "integer"
        },
        "duedate": {
          "format": "date-time",
          "description": "The invoice due date (eräpäivä)",
          "type": "string"
        },
        "exported_bit": {
          "description": "Indicates if the invoice has been exported to accounting",
          "type": "boolean"
        },
        "state_payed": {
          "description": "Indicates if the invoice has been fully paid",
          "type": "boolean"
        },
        "travelexpense_number": {
          "format": "int32",
          "description": "The related travel expense number",
          "type": "integer"
        },
        "project_invoice_number": {
          "format": "int32",
          "description": "The sales invoice number on project",
          "type": "integer"
        },
        "project_invoice_bit": {
          "description": "Indicates if the invoice should be invoiced to the project",
          "type": "boolean"
        },
        "payment_ban_bit": {
          "description": "Indicates if the invoice has a payment ban (maksukielto)",
          "type": "boolean"
        },
        "total_net": {
          "format": "double",
          "description": "The total amount without taxes",
          "type": "number"
        },
        "total_tax": {
          "format": "double",
          "description": "The total tax amount",
          "type": "number"
        },
        "customer_number": {
          "format": "int32",
          "description": "The supplier's customer number (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_name": {
          "description": "The supplier's name",
          "type": "string"
        },
        "customer_name_additional": {
          "description": "The supplier's additional name",
          "type": "string"
        },
        "street_address": {
          "description": "The supplier's street address",
          "type": "string"
        },
        "street_address_additional": {
          "description": "The supplier's additional street address",
          "type": "string"
        },
        "city": {
          "description": "The supplier's city",
          "type": "string"
        },
        "customer_country": {
          "description": "The supplier's country",
          "type": "string"
        },
        "account": {
          "description": "The bank account number (IBAN) for payment",
          "type": "string"
        },
        "swift": {
          "description": "The recipient bank's SWIFT/BIC code for foreign payments",
          "type": "string"
        },
        "bank": {
          "description": "The recipient bank's name",
          "type": "string"
        },
        "bank2": {
          "description": "The recipient bank's address line 1",
          "type": "string"
        },
        "bank3": {
          "description": "The recipient bank's address line 2",
          "type": "string"
        },
        "bank4": {
          "description": "The recipient bank's country",
          "type": "string"
        },
        "contractnumber": {
          "description": "The exchange rate contract number",
          "type": "string"
        },
        "payment_type": {
          "format": "int32",
          "description": "The payment type",
          "type": "integer"
        },
        "payment_share": {
          "format": "int32",
          "description": "The payment share type for foreign payments",
          "type": "integer"
        },
        "foreign_share": {
          "description": "The foreign payment share description",
          "type": "string"
        },
        "foreign_type": {
          "description": "The foreign payment type description",
          "type": "string"
        },
        "clearing": {
          "description": "The clearing code for customs",
          "type": "string"
        },
        "www_link": {
          "description": "A link to the invoice's original document (www)",
          "type": "string"
        },
        "online_url": {
          "description": "A direct URL for viewing the invoice online in LemonOnline",
          "type": "string"
        },
        "modified_date": {
          "format": "date-time",
          "description": "The timestamp of the last modification",
          "type": "string"
        },
        "value_date": {
          "format": "date-time",
          "description": "The value date (arvopäivä)",
          "type": "string"
        },
        "cash_date": {
          "format": "date-time",
          "description": "The first cash discount date (käteisalennuspäivä)",
          "type": "string"
        },
        "cash_date2": {
          "format": "date-time",
          "description": "The second cash discount date",
          "type": "string"
        },
        "cash_date3": {
          "format": "date-time",
          "description": "The third cash discount date",
          "type": "string"
        },
        "cash_amount": {
          "format": "double",
          "description": "The first cash discount amount (käteisalennussumma)",
          "type": "number"
        },
        "cash_amount2": {
          "format": "double",
          "description": "The second cash discount amount",
          "type": "number"
        },
        "cash_amount3": {
          "format": "double",
          "description": "The third cash discount amount",
          "type": "number"
        },
        "circulation_ready": {
          "description": "Indicates if the invoice is ready for circulation (kierrätysvalmis)",
          "type": "boolean"
        },
        "external_id": {
          "format": "int32",
          "description": "Purchase invoice ID in external system",
          "type": "integer"
        },
        "purchase_invoice_payments": {
          "description": "The purchase invoice payment entries",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoicePayment"
          }
        },
        "purchase_invoice_rows": {
          "description": "The purchase invoice rows (line items)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceRow"
          }
        },
        "purchase_invoice_circulations": {
          "description": "The purchase invoice circulation entries",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceCirculation"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoiceState": {
      "description": "The state of a purchase invoice",
      "type": "object",
      "properties": {
        "state": {
          "format": "int32",
          "description": "The state code: 0 = Registered (kirjattu), 1 = Approved (hyväksytty), 2 = In payment (maksussa), 3 = Paid (maksettu), 4 = In circulation (kierrossa), 5 = Rejected (hylätty)",
          "type": "integer"
        },
        "description": {
          "description": "The state description in Finnish",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoicePayment": {
      "description": "A payment entry for a purchase invoice",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the payment",
          "type": "integer"
        },
        "invoice_id": {
          "format": "int32",
          "description": "The purchase invoice id this payment belongs to",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The payment date",
          "type": "string"
        },
        "total": {
          "format": "double",
          "description": "The payment total in domestic currency",
          "type": "number"
        },
        "total_incurrency": {
          "format": "double",
          "description": "The payment total in invoice currency",
          "type": "number"
        },
        "currency_rate": {
          "format": "double",
          "description": "The currency exchange rate at the time of payment",
          "type": "number"
        },
        "accountlist_account": {
          "description": "The accounting account for this payment (tili). For possible values, refer to /api/settings/chart_of_accounts\r\n[here](#tag/Settings/operation/Settings_GetChartOfAccounts)",
          "type": "string"
        },
        "account_currency": {
          "description": "The payment currency code",
          "type": "string"
        },
        "costcenter_code": {
          "description": "The cost center code (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "batch": {
          "format": "int32",
          "description": "The payment batch id",
          "type": "integer"
        },
        "taxrate": {
          "format": "double",
          "description": "The tax rate percentage for the payment",
          "type": "number"
        },
        "description": {
          "description": "The payment description",
          "type": "string"
        },
        "identifier": {
          "description": "The payment identifier",
          "type": "string"
        },
        "project": {
          "format": "int32",
          "description": "The project number (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "lta": {
          "description": "The business area (liiketoiminta-alue). For possible values, refer to /api/settings/ltas\r\n[here](#tag/Settings/operation/Settings_GetLtas)",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "The payment type",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoiceRow": {
      "description": "A purchase invoice row representing a line item on the invoice",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the row",
          "type": "integer"
        },
        "invoice_id": {
          "format": "int32",
          "description": "The purchase invoice id this row belongs to",
          "type": "integer"
        },
        "row_number": {
          "format": "int32",
          "description": "The row number",
          "type": "integer"
        },
        "accountlist_account": {
          "description": "The accounting account for this row (tili). For possible values, refer to /api/settings/chart_of_accounts\r\n[here](#tag/Settings/operation/Settings_GetChartOfAccounts)",
          "type": "string"
        },
        "row_net": {
          "format": "double",
          "description": "The net amount for this row",
          "type": "number"
        },
        "taxrate": {
          "format": "double",
          "description": "The tax rate percentage for this row",
          "type": "number"
        },
        "taxamount": {
          "format": "double",
          "description": "The tax amount for this row",
          "type": "number"
        },
        "total": {
          "format": "double",
          "description": "The total amount for this row including taxes",
          "type": "number"
        },
        "description": {
          "description": "The first description line for the row",
          "type": "string"
        },
        "description2": {
          "description": "The second description line for the row",
          "type": "string"
        },
        "codelist_costcenter": {
          "description": "The cost center code (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "project_info": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectInfo",
          "description": "The project information related to this row"
        },
        "project_phase": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceProjectPhase",
          "description": "The project phase information (projektivaihe)"
        },
        "lta_description": {
          "description": "Description of the LTA dimension on this row. Populated when include_dimension_descriptions is true.",
          "type": "string"
        },
        "cost_center_description": {
          "description": "Description of the cost center on this row. Populated when include_dimension_descriptions is true.",
          "type": "string"
        },
        "project_phase_header": {
          "description": "Header (subject) of the project phase on this row. Populated when include_dimension_descriptions is true.",
          "type": "string"
        },
        "codelist_worknumber": {
          "format": "int32",
          "description": "The work number (työnumero)",
          "type": "integer"
        },
        "purchaseorder_number": {
          "format": "int32",
          "description": "The related purchase order number (tilausnumero)",
          "type": "integer"
        },
        "delivery_customer_number": {
          "format": "int32",
          "description": "The delivery customer number (toimitusasiakas). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The person number related to this row (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "note": {
          "description": "A note for the row",
          "type": "string"
        },
        "innernote": {
          "description": "An internal note for the row",
          "type": "string"
        },
        "project_invoice_bit": {
          "description": "Indicates if the row should be invoiced to the project",
          "type": "boolean"
        },
        "project_invoice_number": {
          "format": "int32",
          "description": "The sales invoice number on project",
          "type": "integer"
        },
        "assets_id": {
          "format": "int32",
          "description": "The fixed assets id (käyttöomaisuus)",
          "type": "integer"
        },
        "blocking": {
          "format": "int32",
          "description": "The stock update blocking mode. 0 = no blocking",
          "type": "integer"
        },
        "productcode": {
          "description": "The product code (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "productdescription": {
          "description": "The product description",
          "type": "string"
        },
        "discount": {
          "format": "double",
          "description": "The discount percentage for this row",
          "type": "number"
        },
        "deliverydate": {
          "format": "date-time",
          "description": "The delivery date for this row",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The quantity of units",
          "type": "number"
        },
        "unit": {
          "description": "The unit type (e.g., pcs, kg)",
          "type": "string"
        },
        "unitprice": {
          "format": "double",
          "description": "The unit price",
          "type": "number"
        },
        "expensegroup": {
          "format": "int32",
          "description": "The expense group",
          "type": "integer"
        },
        "lta": {
          "description": "The business area (liiketoiminta-alue). For possible values, refer to /api/settings/ltas\r\n[here](#tag/Settings/operation/Settings_GetLtas)",
          "type": "string"
        },
        "ean_code": {
          "description": "The EAN barcode for the product",
          "type": "string"
        },
        "worksitecode": {
          "description": "The worksite code (työmaakoodi)",
          "type": "string"
        },
        "worksitenumber": {
          "description": "The worksite number (työmaan numero)",
          "type": "string"
        },
        "receiptnumber": {
          "format": "int32",
          "description": "The e-receipt number",
          "type": "integer"
        },
        "worksite_bit": {
          "description": "Indicates if the row is related to a worksite",
          "type": "boolean"
        },
        "reporttull_bit": {
          "description": "Indicates if the row should be reported to customs",
          "type": "boolean"
        },
        "buyer_article_identifier": {
          "description": "The buyer's article identifier",
          "type": "string"
        },
        "order_targetings": {
          "description": "The order-row targeting entries for this row. Populated only when include_order_targetings\r\nis requested; null otherwise. When populated, the list reflects only targeting recorded by\r\nthe automatic invoice-targeting feature or via the LemonOnline targeting view, and is empty\r\nfor rows that were never targeted through those mechanisms (targeting made through the\r\ndesktop client's legacy targeting paths is not reflected here).",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderRowTargeting"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoiceCirculation": {
      "description": "Circulation entry for a purchase invoice inspection and approval workflow",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the circulation entry",
          "type": "integer"
        },
        "invoice_id": {
          "format": "int32",
          "description": "The purchase invoice id this circulation belongs to",
          "type": "integer"
        },
        "circulation_state": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceCirculationState",
          "description": "The circulation state"
        },
        "circulation_person": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceCirculationPerson",
          "description": "The person assigned to this circulation step"
        },
        "circulation_type": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceCirculationType",
          "description": "The circulation role type"
        },
        "note": {
          "description": "Notes related to the inspection",
          "type": "string"
        },
        "notification": {
          "description": "Indicates if a notification has been sent for this circulation step",
          "type": "boolean"
        },
        "circulation_checker": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceCirculationPerson",
          "description": "The person who handled/checked this circulation step"
        },
        "timestamp": {
          "format": "date-time",
          "description": "The timestamp when the circulation step was handled",
          "type": "string"
        },
        "order": {
          "format": "int32",
          "description": "The order in the circulation queue",
          "type": "integer"
        },
        "feedback": {
          "description": "Feedback text, e.g., when returning to inspection",
          "type": "string"
        },
        "checker_text": {
          "description": "Additional information about the checker when person number is 0, e.g., \"Purchase agreement\"",
          "type": "string"
        },
        "returned": {
          "description": "Indicates if the circulation was returned to inspection",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoiceProjectPhase": {
      "description": "Project phase information for a purchase invoice row",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The project phase id",
          "type": "integer"
        },
        "phase_number": {
          "format": "int32",
          "description": "The phase number",
          "type": "integer"
        },
        "header": {
          "description": "The phase header",
          "type": "string"
        },
        "description": {
          "description": "The phase description",
          "type": "string"
        },
        "phase_code": {
          "description": "The phase code",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseOrderRowTargeting": {
      "description": "A targeting (jyvitys) link between a purchase invoice row and a purchase order row",
      "type": "object",
      "properties": {
        "purchase_orderrow_id": {
          "format": "int32",
          "description": "The unique id of the targeted purchase order row",
          "type": "integer"
        },
        "purchase_order_id": {
          "format": "int32",
          "description": "The purchase order id the targeted row belongs to",
          "type": "integer"
        },
        "delivery_id": {
          "format": "int32",
          "description": "The delivery id this targeting entry was recorded against",
          "type": "integer"
        },
        "divided_sum": {
          "format": "double",
          "description": "The portion of the invoice row's sum targeted to this order row",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoiceCirculationState": {
      "description": "The state of a circulation step",
      "type": "object",
      "properties": {
        "state": {
          "format": "int32",
          "description": "The state code: 0 = Waiting (meneillään), 1 = Approved (hyväksytty), 2 = Rejected (hylätty)",
          "type": "integer"
        },
        "description": {
          "description": "The state description",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoiceCirculationPerson": {
      "description": "A person reference in the circulation workflow",
      "type": "object",
      "properties": {
        "number": {
          "format": "int32",
          "description": "The person number (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "name": {
          "description": "The person's name",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoiceCirculationType": {
      "description": "The role type for a circulation step",
      "type": "object",
      "properties": {
        "type": {
          "format": "int32",
          "description": "The role type code: 0 = Inspector (tarkastaja), 1 = Approver (hyväksyjä), 2 = Informative (tiedoksi)",
          "type": "integer"
        },
        "description": {
          "description": "The role type description",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PurchaseInvoice]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoice"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PurchaseOrderRow]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderRow"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseOrderRow": {
      "description": "A row on a purchase order (ostotilausrivi) representing a single product line. Inherits common row fields from Row",
      "required": [
        "total",
        "unit_price",
        "quantity"
      ],
      "type": "object",
      "properties": {
        "delivered": {
          "format": "double",
          "description": "The amount of product delivered amount for the purchase order row",
          "type": "number"
        },
        "delivery_info1": {
          "description": "The consignment number for the delivery (rahtikirja)",
          "type": "string"
        },
        "invoice_number": {
          "format": "int32",
          "description": "The invoice number for the delivery (laskunumero)",
          "type": "integer"
        },
        "jt": {
          "description": "Indicates if the sales purchase order row is backorder (jälkitoimitus)",
          "type": "boolean"
        },
        "row_delivery_date": {
          "format": "date-time",
          "description": "The estimated date and time for the purchase order row (toimituspvm)",
          "type": "string"
        },
        "asked_delivery_date": {
          "format": "date-time",
          "description": "The requested delivery date for the purchase order row (pyydetty aika)",
          "type": "string"
        },
        "row_delivery_text": {
          "description": "The text for the delivery of the sales order row (toimitustieto). Free text field",
          "type": "string"
        },
        "row_reference": {
          "description": "The reference for the sales order row (viite)",
          "type": "string"
        },
        "row_salesrow_id": {
          "format": "int32",
          "description": "The id of the related sales order row",
          "type": "integer"
        },
        "row_total_delivery": {
          "format": "double",
          "description": "The total amount of product delivered for the purchase order row",
          "type": "number"
        },
        "shelf": {
          "description": "The shelf for the purchase order row (hylly)",
          "type": "string"
        },
        "to_be_delivered": {
          "format": "double",
          "description": "The amount of product to be delivered for the purchase order row",
          "type": "number"
        },
        "purchase_order_id": {
          "format": "int32",
          "description": "The id of the purchase order",
          "type": "integer"
        },
        "row_product_batch_id": {
          "format": "int32",
          "description": "If the row was created from a product batch proposal, this is the id of the product batch (eränumerot painike)",
          "type": "integer"
        },
        "stock_unit": {
          "description": "The stock unit of the product (varastoyksikkö). For example: \"kpl\", \"kg\", \"m\". The available stock units are controlled via product stock units in codelists (varastoyksikkö). See /api/settings/stock_units/{languageCode}\r\nUsed for intrastat and unit conversions.\r\n[here](#tag/Settings/operation/Settings_GetUnits)",
          "type": "string"
        },
        "stock_inout_id": {
          "format": "int32",
          "description": "The stock transaction id for the purchase order row. readonly only",
          "type": "integer"
        },
        "autofill_product": {
          "description": "If set to true, the system autofills the product information based on the product code provided in the request",
          "default": false,
          "type": "boolean"
        },
        "row_sizes": {
          "description": "The sizes for the purchase order row",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SizeAmount"
          }
        },
        "serials": {
          "description": "The serials for the purchase order row",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SerialNumberTmp"
          }
        },
        "batches": {
          "description": "The batches for the purchase order row",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockTransactionBatch"
          }
        },
        "shelfList": {
          "description": "The shelves for the purchase order row",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderRowShelf"
          }
        },
        "confirmed": {
          "description": "Indicates if the purchase order row is confirmed (vahvistettu)",
          "type": "boolean"
        },
        "supp_date": {
          "format": "date-time",
          "description": "The supplier date for the purchase order row (lähetyspvm)",
          "type": "string"
        },
        "lta_create": {
          "description": "When true, the LTA identified by the row's {LemonRest.Models.Proxy.Row.lta} code is created on the fly if it does not\r\nyet exist, before the order is saved (LTA:n luonti lennossa tilauksen tallennuksen yhteydessä)",
          "default": false,
          "type": "boolean"
        },
        "lta_name": {
          "description": "The description for the LTA dimension when it is created on the fly via {LemonRest.Models.Proxy.PurchaseOrderRow.lta_create} (LTA-selite)",
          "type": "string"
        },
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "type": "integer"
        },
        "account": {
          "type": "string"
        },
        "cost_center": {
          "type": "string"
        },
        "project_code": {
          "type": "string"
        },
        "project_number": {
          "format": "int32",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "type": "integer"
        },
        "discount": {
          "format": "double",
          "type": "number"
        },
        "discount2": {
          "format": "double",
          "type": "number"
        },
        "discount3": {
          "format": "double",
          "type": "number"
        },
        "per": {
          "format": "double",
          "type": "number"
        },
        "sales_price": {
          "format": "double",
          "type": "number"
        },
        "total": {
          "format": "double",
          "type": "number"
        },
        "unit_price": {
          "format": "double",
          "type": "number"
        },
        "quantity": {
          "format": "double",
          "type": "number"
        },
        "quantity2": {
          "format": "double",
          "type": "number"
        },
        "color": {
          "type": "string"
        },
        "customer_discount_percentage": {
          "format": "double",
          "type": "number"
        },
        "dimension": {
          "type": "string"
        },
        "inner_note": {
          "type": "string"
        },
        "net_price": {
          "format": "double",
          "type": "number"
        },
        "no_stock_update": {
          "type": "boolean"
        },
        "note": {
          "type": "string"
        },
        "number": {
          "format": "int32",
          "type": "integer"
        },
        "position": {
          "type": "string"
        },
        "product_code": {
          "type": "string"
        },
        "product_name": {
          "type": "string"
        },
        "product_extra_name": {
          "type": "string"
        },
        "tax_amount": {
          "format": "double",
          "type": "number"
        },
        "tax_rate": {
          "format": "double",
          "type": "number"
        },
        "unit": {
          "type": "string"
        },
        "unit_net_price": {
          "format": "double",
          "type": "number"
        },
        "unit_net_price_currency": {
          "format": "double",
          "type": "number"
        },
        "unit_net_currency": {
          "type": "string"
        },
        "product_stock": {
          "format": "int32",
          "type": "integer"
        },
        "lta": {
          "type": "string"
        },
        "weight": {
          "format": "double",
          "type": "number"
        },
        "supplier_id": {
          "format": "int32",
          "type": "integer"
        },
        "row_serial": {
          "type": "string"
        },
        "is_serial_follow_up": {
          "type": "boolean"
        },
        "serialnumber_type": {
          "format": "int32",
          "type": "integer"
        },
        "is_batch_follow_up": {
          "type": "boolean"
        },
        "handedness": {
          "type": "string"
        },
        "price_info": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.SerialNumberTmp": {
      "description": "The serial number model for order row",
      "type": "object",
      "properties": {
        "row_id": {
          "format": "int32",
          "description": "The id of the row the serial is part of",
          "type": "integer"
        },
        "serialnr_code": {
          "description": "The serial number",
          "type": "string"
        },
        "serialnr_description": {
          "description": "A description for the serial number",
          "type": "string"
        },
        "serialnr_product_code": {
          "description": "The product code for the serial number",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseOrderRowShelf": {
      "description": "Shelf model for purchase order row arrival",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the shelf",
          "type": "integer"
        },
        "row_id": {
          "format": "int32",
          "description": "The id of the purchase order row",
          "type": "integer"
        },
        "shelf": {
          "description": "The shelf code",
          "type": "string"
        },
        "amount": {
          "format": "double",
          "description": "The amount of product on the shelf",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PurchaseInvoiceReadonly]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceReadonly"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoiceReadonly": {
      "description": "The locked state of a purchase invoice",
      "required": [
        "locked"
      ],
      "type": "object",
      "properties": {
        "locked": {
          "description": "Indicates if the invoice is locked (moved to accounting and cannot be modified)",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.QueryFilters.InvoiceAttachmentFilter": {
      "type": "object",
      "properties": {
        "numbers": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "invoice_type": {
          "format": "int32",
          "type": "integer"
        },
        "invoice_state": {
          "format": "int32",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "type": "integer"
        },
        "exported_bit": {
          "type": "boolean"
        },
        "description": {
          "type": "string"
        },
        "created_before": {
          "format": "date-time",
          "type": "string"
        },
        "created_after": {
          "format": "date-time",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "type": "string"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "System.Void": {
      "type": "object",
      "properties": {}
    },
    "System.Web.Http.Results.ResponseMessageResult": {
      "type": "object",
      "properties": {
        "Response": {
          "type": "object",
          "readOnly": true
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PurchaseInvoiceDuplicateCheck]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceDuplicateCheck"
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoiceDuplicateCheck": {
      "description": "Result of /api/purchase-invoice/{invoiceNumber}/duplicate-check. The flags and total_match_count\r\ncover the full match set; matching_invoices is a sample of at most 5 rows with\r\nsupplier-invoice-number matches first, then newest by invoice date.",
      "type": "object",
      "properties": {
        "duplicate_by_supplier_invoice_number": {
          "description": "True if at least one match shares the supplier's invoice number (the supplier_number field of\r\nthe purchase invoice)",
          "type": "boolean"
        },
        "duplicate_by_reference": {
          "description": "True if at least one match shares the reference (purchase_invoice_reference)",
          "type": "boolean"
        },
        "total_match_count": {
          "format": "int32",
          "description": "Total number of matching invoices (full match set, not just the sample)",
          "type": "integer"
        },
        "matching_invoices": {
          "description": "Sample of previously-recorded invoices that matched",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceDuplicateMatch"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseInvoiceDuplicateMatch": {
      "description": "One previously-recorded invoice in a duplicate-check result",
      "type": "object",
      "properties": {
        "invoice_id": {
          "format": "int32",
          "description": "The internal id of the matched invoice",
          "type": "integer"
        },
        "invoice_number": {
          "format": "int32",
          "description": "The purchase invoice number assigned at receipt, not the supplier's invoice number",
          "type": "integer"
        },
        "invoice_date": {
          "format": "date-time",
          "description": "The invoice date",
          "type": "string"
        },
        "total_amount": {
          "format": "double",
          "description": "The invoice total (including VAT)",
          "type": "number"
        },
        "state": {
          "format": "int32",
          "description": "State of the matched invoice (PurchaseInvoice_State: 0=booked, 1=approved, 2=in_bank,\r\n3=paid, 4=circulated, 5=abandoned, 6=payment_ban)",
          "type": "integer"
        },
        "matched_by_supplier_invoice_number": {
          "description": "True when this match shares the supplier's invoice number",
          "type": "boolean"
        },
        "matched_by_reference": {
          "description": "True when this match shares the reference",
          "type": "boolean"
        },
        "same_amount": {
          "description": "True when this match has the same total amount as the invoice under inspection",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PurchaseInvoiceRowFilter": {
      "description": "Filter for searching purchase invoice rows, newest first. Inherits page and page_size from\r\nPageFilter. Every filter is optional and they combine freely",
      "type": "object",
      "properties": {
        "supplier_number": {
          "format": "int32",
          "description": "Filter by the supplier's customer number (toimittajan asiakasnumero).\r\nFor possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "product_codes": {
          "description": "Filter by product codes. Without this filter rows are returned regardless of product code",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "date_from": {
          "format": "date-time",
          "description": "Filter rows whose invoice date is on or after this date",
          "type": "string"
        },
        "date_to": {
          "format": "date-time",
          "description": "Filter rows whose invoice date is on or before this date. The whole day is included",
          "type": "string"
        },
        "states": {
          "description": "Filter by invoice states (PurchaseInvoice_State values). Without this filter rows are\r\nreturned regardless of the invoice state. Values outside the enum are not an error, they\r\nsimply match nothing, so a mistyped state yields an empty result rather than a failure",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "description": {
          "description": "Filter by row description. Matches rows whose description contains the given text",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PurchaseInvoiceRow]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseInvoiceRow"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.PurchaseOrderFilter": {
      "description": "Filter for querying purchase orders. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "state": {
          "format": "int32",
          "description": "Filter by purchase order state (tila). For possible values, refer to /api/settings/states/2\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "Filter by supplier customer number (asiakasnumero). For possible values, refer to /api/customers. The customer_number's value corresponds to the number returned by /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "Filter by purchase order type (laji). For possible values, refer to /api/settings/purchaseorder_numberseries\r\n[here](#tag/Settings/operation/Settings_GetPurchaseOrderNumberseries)",
          "type": "integer"
        },
        "ordered_before": {
          "format": "date-time",
          "description": "Filter purchase orders with order date before this date (päiväys)",
          "type": "string"
        },
        "ordered_after": {
          "format": "date-time",
          "description": "Filter purchase orders with order date after this date (päiväys)",
          "type": "string"
        },
        "order_numbers": {
          "description": "Filter by purchase order numbers. Accepts a list of order numbers",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "updated_before": {
          "format": "date-time",
          "description": "Filter purchase orders with last-edited timestamp before this date",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "description": "Filter purchase orders with last-edited timestamp after this date",
          "type": "string"
        },
        "only_allowed_types": {
          "description": "When set to true, limits the result to purchase order types the current user is allowed to use",
          "type": "boolean"
        },
        "skip_models": {
          "description": "When set to true, excludes purchase order templates (negative or zero order numbers) from the result",
          "type": "boolean"
        },
        "sort_desc": {
          "description": "When set to true, the result is sorted in descending order by purchase order id",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PurchaseOrder]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrder"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseOrder": {
      "description": "The purchase order model (ostotilaus) with full header data, rows, delivery info, and links",
      "type": "object",
      "properties": {
        "currency_code": {
          "description": "The currency code for the purchase order (valuuttakoodi) in ISO 4217 format. For example: \"EUR\", \"USD\" or \"SEK\". For possible values, refer to /api/settings/currency/{code}\r\n[here](#tag/Settings/operation/Settings_GetCurrency)",
          "type": "string"
        },
        "delivery_date": {
          "format": "date-time",
          "description": "The delivery date for the purchase order (toimitusaika)",
          "type": "string"
        },
        "delivery_info1": {
          "description": "The delivery information for the purchase order (rahtikirja)",
          "type": "string"
        },
        "delivery_info2": {
          "description": "The additional delivery information for the purchase order",
          "type": "string"
        },
        "delivery_method": {
          "format": "int32",
          "description": "The delivery method for the purchase order (toimitustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_METHODS. The delivery method's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "language_code": {
          "description": "The language code for the purchase order (kielikoodi) in ISO 639-3 format. For possible values, refer to /api/settings/languages\r\n[here](#tag/Settings/operation/Settings_GetLanguages)",
          "type": "string"
        },
        "rows": {
          "description": "The rows of the purchase order",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderRow"
          }
        },
        "payment_term": {
          "format": "int32",
          "description": "The payement term for the purchase order (maksuehto). For possible values, refer to /api/codelist/payment_term. The payment term's value corresponds to the number returned by /api/codelist/payment_term\r\n[here](#tag/codelist/operation/Codelist_ListPaymentTerms)",
          "type": "integer"
        },
        "person_buyer_number": {
          "format": "int32",
          "description": "The buyer's person number for the purchase order (ostaja). For possible values, refer to /api/persons. The person_buyer_number's value corresponds to the number returned by /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "person_responsible_number": {
          "format": "int32",
          "description": "The responsible person for the purchase order (vastuuhenkilö). For possible values, refer to /api/persons. The person_responsible_number's value corresponds to the number returned by /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "currency_rate": {
          "format": "double",
          "description": "The currency rate for the purchase order (valuuttakurssi). Must be higher than 0",
          "type": "number"
        },
        "customer_address1": {
          "description": "The vendor's local address for the purchase order (lähiosoite)",
          "type": "string"
        },
        "customer_address2": {
          "description": "Extra address field for the customer address",
          "type": "string"
        },
        "customer_address3": {
          "description": "The vendor's address (osoite), formatted as \"{Postal Code} {Location}\", for example: \"00100 Helsinki\". Space is required between the postal code and location",
          "type": "string"
        },
        "customer_contact": {
          "description": "The vendor contact person for the purchase order (yhteyshenkilö)",
          "type": "string"
        },
        "customer_country": {
          "description": "The vendor's country for the purchase order",
          "type": "string"
        },
        "customer_name1": {
          "description": "The purchase order's vendor's name (nimi)",
          "type": "string"
        },
        "customer_name2": {
          "description": "Extra name field for vendor name in the purchase order",
          "type": "string"
        },
        "customer_number": {
          "format": "int32",
          "description": "The supplier customer number for the purchase order (asiakasnumero). For possible values, refer to /api/customers. The customer_number's value corresponds to the number returned by /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_reference": {
          "description": "The customer's reference for the purchase order (viitteenne)",
          "type": "string"
        },
        "purchase_order_date": {
          "format": "date-time",
          "description": "The date and time for the purchase order (päiväys)",
          "type": "string"
        },
        "delivery_code": {
          "description": "The delivery code for the purchase order (toimitustieto). This is a free text field",
          "type": "string"
        },
        "delivery_customer_address1": {
          "description": "The delivery customer's address (lähiosoite) for the purchase order, for example: \"Mannerheimintie 30\".",
          "type": "string"
        },
        "delivery_customer_address2": {
          "description": "The extra address field for the delivery customer's address",
          "type": "string"
        },
        "delivery_customer_address3": {
          "description": "The delivery customer's address (osoite), formatted as \"{Postal Code} {Location}\", for example: \"00100 Helsinki\".",
          "type": "string"
        },
        "delivery_customer_contact": {
          "description": "The delivery customer's contact person for the purchase order (yhteishenkilö)",
          "type": "string"
        },
        "delivery_customer_country": {
          "description": "The delivery customer's country for the purchase order",
          "type": "string"
        },
        "delivery_customer_name1": {
          "description": "The delivery customer's name for the purchase order (nimi)",
          "type": "string"
        },
        "delivery_customer_name2": {
          "description": "The extra name field for the delivery customer",
          "type": "string"
        },
        "delivery_customer_number": {
          "format": "int32",
          "description": "The delivery customer's number for the purchase order. For possible values, refer to /api/customers. The delivery_customer_number's value corresponds to the number returned by /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "delivery_term": {
          "format": "int32",
          "description": "The terms of delivery for purchase order (toimitusehto). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_TERMS. The delivery term's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "delivery_term_info": {
          "description": "Additional information for the purchase order's delivery terms  (toimitusehdon lisätieto)",
          "type": "string"
        },
        "delivery_text": {
          "description": "The delivery text for the purchase order (toimitusteksti). This is a free text field",
          "type": "string"
        },
        "deliverynotes": {
          "description": "The delivery text for the sales order (toimitusteksti). This is a free text field",
          "type": "string"
        },
        "description": {
          "description": "The description for the purchase order (kuvaus). This is a free text field",
          "type": "string"
        },
        "note": {
          "description": "A note for the purchase order (viesti)",
          "type": "string"
        },
        "order_number": {
          "format": "int32",
          "description": "The order number for the purchase order (numero)",
          "type": "integer"
        },
        "ordered_bit": {
          "description": "Indicates if the purchase order has been ordered (tilattu)",
          "type": "boolean"
        },
        "ordermark": {
          "description": "Mark for the purchase order (merkki)",
          "type": "string"
        },
        "our_reference": {
          "description": "Our organization's sales order reference number (viitteemme)",
          "type": "string"
        },
        "pricefactor": {
          "format": "double",
          "description": "The price factor for the purchase order (kulukerroin)",
          "type": "number"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number for the purchase order (projektinumero). For possible values, refer to /api/projects. The project_number's value corresponds to the number returned by /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "state": {
          "format": "int32",
          "description": "The state for the purchase order (tila). For possible values and descriptions, refer to /api/settings/states/2\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "taxtype_bit": {
          "description": "Indicates whether the order's prices include VAT (ALV, hinnat sisältävät arvolisäveron)",
          "type": "boolean"
        },
        "totalsum": {
          "format": "double",
          "description": "The total sum of the purchase order",
          "type": "number"
        },
        "type": {
          "format": "int32",
          "description": "The type for the purchase order (laji). For possible values, refer to /api/settings/purchaseorder_numberseries. The type value corresponds to the type returned by /api/settings/purchaseorder_numberseries\r\n[here](#tag/Settings/operation/Settings_GetPurchaseOrderNumberseries)",
          "type": "integer"
        },
        "purchase_order_id": {
          "format": "int32",
          "description": "The id for the purchase order",
          "type": "integer"
        },
        "delivery_info": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryInfo",
          "description": "The delivery information for the purchase order (toimitustiedot)"
        },
        "online_url": {
          "description": "Internal property for lemonsoft integrations",
          "type": "string"
        },
        "driver": {
          "format": "int32",
          "description": "The driver for the purchase order (kuljettaja). For possible values, refer to /api/codelist/description?filter.codeListFilter=DRIVERS. The driver's value corresponds to the ID returned by /api/codelist/description\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "driver_info": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.DriverInfo",
          "description": "The driver information for the purchase order (kuljettajan tiedot)"
        },
        "copy_from_order": {
          "format": "int32",
          "description": "The number of the purchase order used as a template for a new purchase order",
          "type": "integer"
        },
        "customerdata_from_payload": {
          "description": "If set to false, the system retrieves customer data from the customer registry for the purchase order\r\nand ignores the customer data provided in the payload.\r\n            \r\nThe following properties determine which customer data is retrieved from the customer registry:\r\n- customer_number: The supplier's properties are set\r\n- delivery_customer_number: The delivery customer's properties are set",
          "type": "boolean"
        },
        "links": {
          "description": "The links for the purchase order (linkit)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Link"
          }
        },
        "supp_date": {
          "format": "date-time",
          "description": "Gets or sets the supplier date for the purchase order (lähetyspvm)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PurchaseOrder]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrder"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.OrderDeliveryInfo]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryInfo"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PurchaseOrderDeliveyRowsFilter": {
      "description": "Filter for querying purchase order delivery rows. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "delivery_id": {
          "format": "int32",
          "description": "Filter by delivery row id",
          "type": "integer"
        },
        "orderrow_id": {
          "format": "int32",
          "description": "Filter by the id of the purchase order row the delivery row belongs to",
          "type": "integer"
        },
        "order_number": {
          "format": "int32",
          "description": "Filter by purchase order number (ostotilausnumero)",
          "type": "integer"
        },
        "delivery_date_before": {
          "format": "date-time",
          "description": "Filter delivery rows with delivery date before this date (toimituspäivä)",
          "type": "string"
        },
        "delivery_date_after": {
          "format": "date-time",
          "description": "Filter delivery rows with delivery date after this date (toimituspäivä)",
          "type": "string"
        },
        "delivery_amount": {
          "format": "double",
          "description": "Filter by delivered amount",
          "type": "number"
        },
        "delivery_consignment": {
          "description": "Filter by delivery consignment / shipper (lähettäjä). Matches when the field contains the given value",
          "type": "string"
        },
        "delivery_reference": {
          "description": "Filter by delivery reference (lähetyksen viite). Exact match",
          "type": "string"
        },
        "delivery_stock_id": {
          "format": "int32",
          "description": "Filter by the inward stock transaction id for the delivery row",
          "type": "integer"
        },
        "delivery_invoice_id": {
          "format": "int32",
          "description": "Filter by the invoice id for the delivery row",
          "type": "integer"
        },
        "deliveryinfo_id": {
          "format": "int32",
          "description": "Filter by the related delivery info id",
          "type": "integer"
        },
        "delivery_stock_id_out": {
          "format": "int32",
          "description": "Filter by the outward stock transaction id for the delivery row",
          "type": "integer"
        },
        "sort_desc": {
          "description": "When set to true, the result is sorted in descending order by purchase delivery id",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PurchaseDeliveryRow]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseDeliveryRow"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseDeliveryRow": {
      "description": "A delivery row for a purchase order (ostotilauksen toimitusrivi). Represents one delivery transaction recorded against a purchase order row",
      "type": "object",
      "properties": {
        "delivery_id": {
          "format": "int32",
          "description": "The id of the delivery row",
          "type": "integer"
        },
        "orderrow_id": {
          "format": "int32",
          "description": "The id of the purchase order row",
          "type": "integer"
        },
        "delivery_date": {
          "format": "date-time",
          "description": "The date and time for the delivery row (toimitusaika)",
          "type": "string"
        },
        "delivery_amount": {
          "format": "double",
          "description": "The amount of product delivered for the purchase order row",
          "type": "number"
        },
        "delivery_consignment": {
          "description": "The consignor for the delivery row (lähettäjä)",
          "type": "string"
        },
        "delivery_reference": {
          "description": "The delivery reference for the delivery row (lähetyksen viite)",
          "type": "string"
        },
        "delivery_stock_id": {
          "format": "int32",
          "description": "The stock id for the delivery row",
          "type": "integer"
        },
        "delivery_invoice_id": {
          "format": "int32",
          "description": "The invoice id for the delivery row",
          "type": "integer"
        },
        "deliveryinfo_id": {
          "format": "int32",
          "description": "the deliveryinfo id for the delivery row",
          "type": "integer"
        },
        "delivery_stock_id_out": {
          "format": "int32",
          "description": "The id of the outward stock transaction for the delivery row",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.OrderDeliveryInfoFilter": {
      "description": "Filter for querying purchase order delivery info entries. Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "Filter by delivery info id",
          "type": "integer"
        },
        "order_number": {
          "format": "int32",
          "description": "Filter by purchase order number (ostotilausnumero)",
          "type": "integer"
        },
        "state": {
          "format": "int32",
          "description": "Filter by delivery info state (tila)",
          "type": "integer"
        },
        "deliveryinfo_date_before": {
          "format": "date-time",
          "description": "Filter delivery info entries with delivery date before this date (toimituspäivä)",
          "type": "string"
        },
        "deliveryinfo_date_after": {
          "format": "date-time",
          "description": "Filter delivery info entries with delivery date after this date (toimituspäivä)",
          "type": "string"
        },
        "method": {
          "format": "int32",
          "description": "Filter by delivery method (toimitustapa). For possible values, refer to /api/codelist/description?filter.codeListFilter=DELIVERY_METHODS\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "description": {
          "description": "Filter by delivery description (sisältö). Matches when the field contains the given value",
          "type": "string"
        },
        "consignment": {
          "description": "Filter by consignment number (rahtikirja). Matches when the field contains the given value",
          "type": "string"
        },
        "departure": {
          "description": "Filter by departure location (lähtöpaikka). Matches when the field contains the given value",
          "type": "string"
        },
        "forwarder": {
          "description": "Filter by forwarder (huolitsija). Matches when the field contains the given value",
          "type": "string"
        },
        "instructions": {
          "description": "Filter by delivery instructions (kuljetusohjeet). Matches when the field contains the given value",
          "type": "string"
        },
        "info1": {
          "description": "Filter by additional info field 1 (muut tiedot). Matches when the field contains the given value",
          "type": "string"
        },
        "info2": {
          "description": "Filter by additional info field 2 (varauma). Matches when the field contains the given value",
          "type": "string"
        },
        "packages": {
          "format": "int32",
          "description": "Filter by number of shipment units (kollit)",
          "type": "integer"
        },
        "sort_desc": {
          "description": "When set to true, the result is sorted in descending order by purchase delivery id",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.OrderDeliveryInfo]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.OrderDeliveryInfo"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.PurchaseOrderRow]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderRow"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.ProjectSalaryProxy]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProjectSalaryProxy"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProjectSalaryProxy": {
      "description": "Aggregated salary totals for a project (projektin palkat), grouped by payment date and form of salary",
      "type": "object",
      "properties": {
        "date": {
          "format": "date-time",
          "description": "The payment date of the salary (palkanmaksupäivä)",
          "type": "string"
        },
        "form_of_salary_id": {
          "format": "int32",
          "description": "The internal ID of the form of salary (palkkalaji). For possible values, refer to /api/salary/form_of_salary",
          "type": "integer"
        },
        "form_of_salary_number": {
          "format": "int32",
          "description": "The form of salary's number (palkkalajinumero)",
          "type": "integer"
        },
        "sum": {
          "format": "double",
          "description": "The summed salary amount in currency for this row (palkkasumma)",
          "type": "number"
        },
        "amount": {
          "format": "double",
          "description": "The summed quantity (e.g. hours or pieces) for this row (määrä)",
          "type": "number"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number this salary row belongs to (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "project_phase": {
          "description": "The project phase code this salary row belongs to (projektivaihe). For possible values, refer to /api/projects/{number}/phase\r\n[here](#tag/projects/operation/Project_GetPhases)",
          "type": "string"
        },
        "ids": {
          "description": "Comma-separated list of underlying salary IDs aggregated into this row",
          "type": "string"
        },
        "period_start_date": {
          "format": "date-time",
          "description": "The earliest start date of the salary periods (palkkakauden alkupäivä) aggregated into this row. Only returned when the request is made with include_period_dates set to true, otherwise null",
          "type": "string"
        },
        "period_end_date": {
          "format": "date-time",
          "description": "The latest end date of the salary periods (palkkakauden loppupäivä) aggregated into this row. Only returned when the request is made with include_period_dates set to true, otherwise null",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.FormOfSalary]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.FormOfSalary"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.FormOfSalary": {
      "description": "A form of salary (palkkalaji) — the classification used on salary rows to determine taxation, accounting, and calculation behavior",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The internal ID of the form of salary",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The form of salary's number (palkkalajinumero) used to reference it on salary rows",
          "type": "integer"
        },
        "description": {
          "description": "The form of salary's description (kuvaus)",
          "type": "string"
        },
        "pieces_formula": {
          "description": "Formula used to calculate the quantity (kpl-kaava)",
          "type": "string"
        },
        "atprice_formula": {
          "description": "Formula used to calculate the unit price (à-hinta -kaava)",
          "type": "string"
        },
        "account": {
          "description": "The accounting account this form of salary posts to (tili). For possible values, refer to /api/settings/chart_of_accounts\r\n[here](#tag/Settings/operation/Settings_GetChartOfAccounts)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.SalaryFilter": {
      "description": "Filter for querying salaries (palkat). Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter.",
      "type": "object",
      "properties": {
        "person_number": {
          "format": "int32",
          "description": "Filter salaries by person number (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "only_approved": {
          "description": "When set to true (default), only approved salaries are returned. When false, all salaries (including unapproved drafts) are returned",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.Salary]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Salary"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Salary": {
      "description": "A salary (palkka) for a person, with header totals (gross, deductions, taxes) and the individual salary rows",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The internal ID of the salary",
          "type": "integer"
        },
        "payment_date": {
          "format": "date-time",
          "description": "The payment date of the salary (palkanmaksupäivä)",
          "type": "string"
        },
        "period_start_date": {
          "format": "date-time",
          "description": "The first day of the salary period this salary is paid for (palkkakauden alkupäivä). Null when the period has not been set",
          "type": "string"
        },
        "period_end_date": {
          "format": "date-time",
          "description": "The last day of the salary period this salary is paid for (palkkakauden loppupäivä). Null when the period has not been set",
          "type": "string"
        },
        "person_number": {
          "format": "int32",
          "description": "The person number this salary belongs to (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "description": {
          "description": "The description of the salary (kuvaus)",
          "type": "string"
        },
        "to_be_paid": {
          "format": "double",
          "description": "The net amount to be paid to the person (maksettava)",
          "type": "number"
        },
        "withholding_tax": {
          "format": "double",
          "description": "The withheld tax (ennakonpidätys)",
          "type": "number"
        },
        "pension_insurance": {
          "format": "double",
          "description": "The employee's pension insurance contribution (työntekijän eläkevakuutusmaksu)",
          "type": "number"
        },
        "unemployment_insurance": {
          "format": "double",
          "description": "The employee's unemployment insurance contribution (työntekijän työttömyysvakuutusmaksu)",
          "type": "number"
        },
        "union_fee": {
          "format": "double",
          "description": "The union membership fee deducted from the salary (ay-jäsenmaksu)",
          "type": "number"
        },
        "other_deductions": {
          "format": "double",
          "description": "Other deductions from the salary (muut vähennykset)",
          "type": "number"
        },
        "salary": {
          "format": "double",
          "description": "The gross salary amount paid in money (rahapalkka)",
          "type": "number"
        },
        "benefits_sum": {
          "format": "double",
          "description": "The sum of benefits in kind included in the salary (luontoisedut)",
          "type": "number"
        },
        "salary_sum": {
          "format": "double",
          "description": "The total gross salary including benefits (palkkasumma yhteensä)",
          "type": "number"
        },
        "compensations": {
          "format": "double",
          "description": "The sum of tax-free compensations paid with the salary (kustannusten korvaukset)",
          "type": "number"
        },
        "per_diem_payment_in_tax": {
          "format": "double",
          "description": "The portion of per diem payments treated as taxable (verollinen osa päivärahoista)",
          "type": "number"
        },
        "tax_type": {
          "format": "int32",
          "description": "The tax card type used for withholding tax calculation (verokorttilaji)",
          "type": "integer"
        },
        "tax_percent": {
          "format": "double",
          "description": "The primary tax percent from the tax card (veroprosentti)",
          "type": "number"
        },
        "tax_percent2": {
          "format": "double",
          "description": "The secondary (additional) tax percent applied above the income limit (lisäveroprosentti)",
          "type": "number"
        },
        "tax_income_limit": {
          "format": "double",
          "description": "The annual income limit from the tax card (tulorajatieto)",
          "type": "number"
        },
        "salary_sum_after_taxcard_start": {
          "format": "double",
          "description": "Salary sum after applying tax card changes during the year. Informative field that is used in cumulative salary",
          "type": "number"
        },
        "rows": {
          "description": "The salary rows (palkkarivit)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalaryRow"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.SalaryRow": {
      "description": "A salary row representing a single line item on a salary (palkkarivi)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The internal ID of the salary row",
          "type": "integer"
        },
        "salary_id": {
          "format": "int32",
          "description": "The ID of the parent salary this row belongs to",
          "type": "integer"
        },
        "form_of_salary": {
          "format": "int32",
          "description": "The form of salary number used on this row (palkkalaji). For possible values, refer to /api/salary/form_of_salary",
          "type": "integer"
        },
        "amount": {
          "format": "double",
          "description": "The quantity on this row (e.g. hours or pieces)",
          "type": "number"
        },
        "price": {
          "format": "double",
          "description": "The unit price on this row (à-hinta)",
          "type": "number"
        },
        "total": {
          "format": "double",
          "description": "The row total (amount × price)",
          "type": "number"
        },
        "date": {
          "format": "date-time",
          "description": "The date the row applies to (e.g. work date)",
          "type": "string"
        },
        "row_number": {
          "format": "int32",
          "description": "The row number on the salary (rivinumero)",
          "type": "integer"
        },
        "is_accounting": {
          "description": "Indicates whether this row is included in accounting postings",
          "type": "boolean"
        },
        "term": {
          "description": "The payment term associated with this row (maksukausi)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.SalaryCumulativeFilter": {
      "description": "Filter for querying a person's cumulative salary totals from the start of the year (kumulatiivinen palkkasaldo)",
      "type": "object",
      "properties": {
        "person_number": {
          "format": "int32",
          "description": "The person number whose cumulative salary totals are queried (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "before": {
          "format": "date-time",
          "description": "Cumulative totals are calculated for salaries with a payment date before this date (defaults to the current date)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Salary]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Salary"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.FormOfSalaryAttribute]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.FormOfSalaryAttribute"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.FormOfSalaryAttribute": {
      "description": "An attribute that can be linked to a form of salary (palkkalajin attribuutti) — used to classify forms of salary for reporting and calculation purposes",
      "type": "object",
      "properties": {
        "attribute_id": {
          "format": "int32",
          "description": "The internal ID of the attribute",
          "type": "integer"
        },
        "attribute_description": {
          "description": "The attribute's description (kuvaus)",
          "type": "string"
        },
        "attribute_group_id": {
          "format": "int32",
          "description": "The internal ID of the attribute group this attribute belongs to (attribuuttiryhmä)",
          "type": "integer"
        },
        "attribute_group_description": {
          "description": "The attribute group's description",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PayGrade]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PayGrade"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PayGrade": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.FunctionSettingFilter": {
      "description": "Function setting filter",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.FunctionSettingValue]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.FunctionSettingValue"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.FunctionSettingValue": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "function_id": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.CostCenterFilter": {
      "type": "object",
      "properties": {
        "level": {
          "format": "int32",
          "type": "integer"
        },
        "search": {
          "type": "string"
        },
        "also_passives": {
          "type": "boolean"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CostCenter]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CostCenter"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CostCenter": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "code": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "is_passive": {
          "type": "boolean"
        },
        "level": {
          "format": "int32",
          "type": "integer"
        },
        "is_programadd": {
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.CostCenterLevel]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CostCenterLevel"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CostCenterLevel": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        },
        "length": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.CostCenterSuggestionFilter": {
      "description": "Cost center suggestion filter",
      "type": "object",
      "properties": {
        "formofsalary": {
          "format": "int32",
          "description": "Form of salary number",
          "type": "integer"
        },
        "person": {
          "format": "int32",
          "description": "Person number",
          "type": "integer"
        },
        "customer": {
          "format": "int32",
          "description": "Customer number",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.LtaFilter": {
      "type": "object",
      "properties": {
        "also_passives": {
          "type": "boolean"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.LtaDimension]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.LtaDimension"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CodeBase]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CodeBase"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CompanyLocation]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CompanyLocation"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CompanyLocation": {
      "description": "Company location summary for settings lists.",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "location_id": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.NumberSeriesProject]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.NumberSeriesProject"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.NumberSeriesProject": {
      "description": "A project number series entry, used to allocate the next project number per project type",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The number series id",
          "type": "integer"
        },
        "project_type": {
          "format": "int32",
          "description": "The project type the series is bound to (projektityyppi). For possible values, refer to /api/codelist/description?filter.codeListFilter=PROJECT_TYPE\r\n[here](#tag/codelist/operation/Codelist_List)",
          "type": "integer"
        },
        "description": {
          "description": "Description of the number series",
          "type": "string"
        },
        "curr_number": {
          "format": "int32",
          "description": "The current running number — the next allocation uses this value + 1",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.SalesOrderNumberseries]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.SalesOrderNumberseries"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.SalesOrderNumberseries": {
      "description": "The model for sales order number series",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the sales order number series",
          "type": "integer"
        },
        "salesorder_type": {
          "format": "int32",
          "description": "The type of the sales order number series",
          "type": "integer"
        },
        "description": {
          "description": "The description for the sales order number series",
          "type": "string"
        },
        "curr_number": {
          "format": "int32",
          "description": "The current number for the sales order number series",
          "type": "integer"
        },
        "is_taxable": {
          "description": "Indicates if the sales order number series is taxable",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PurchaseOrderNumberseries]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PurchaseOrderNumberseries"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PurchaseOrderNumberseries": {
      "description": "The model for purchase order number series",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the purchase order number series",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The type of the purchase order number series",
          "type": "integer"
        },
        "description": {
          "description": "The description for the purchase order number series",
          "type": "string"
        },
        "curr_number": {
          "format": "int32",
          "description": "",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.State]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.State"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.State": {
      "type": "object",
      "properties": {
        "state_number": {
          "format": "int32",
          "type": "integer"
        },
        "state_description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.Stock": {
      "description": "Stock information",
      "required": [
        "number"
      ],
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the stock",
          "type": "integer"
        },
        "description": {
          "description": "The description of the stock location",
          "type": "string"
        },
        "number": {
          "format": "int32",
          "description": "The stock number",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The type of stock. The possible values are controlled by the codelist 'varastotyyppi'.",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number associated with this stock",
          "type": "integer"
        },
        "inventory_state": {
          "format": "int32",
          "description": "The inventory state. Possible values are:\r\n  0 = NotRunning (ei käynnissä): Inventory not currently active.\r\n  1 = InputBalancesZeroed (syöttösaldot nollattu): The input balances have been set to zero.\r\n  2 = FormsCreated (lomakkeet muodostettu): The inventory forms have been created.\r\n  3 = BalanceSaved (saldo tallessa): The balances have been saved.",
          "type": "integer"
        },
        "inventory_order": {
          "format": "int32",
          "description": "The inventory order. Possible values are:\r\n  0 = ShelfAddressThenProductCode (Hyllyosoite, tuotekoodi): Organizes items by shelf address first, then product code.\r\n  1 = ProductGroupThenProductCode (Tuoteryhmä, tuotekoodi): Organizes items by product group first, then product code.\r\n  2 = ProductCode (Tuotekoodi): Organizes items by product code only.",
          "type": "integer"
        },
        "shelf_type": {
          "format": "int32",
          "description": "The type of shelf. Possible values are:\r\n  0 = Fixed (Kiinteät, oletus): A fixed or permanent shelf type (default).\r\n  1 = Variable (Vaihtuva): A variable or adjustable shelf type.",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Stock]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Stock"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductCellList": {
      "description": "List of product cells",
      "type": "object",
      "properties": {
        "cells": {
          "description": "The cells in the list",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductCell"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductCell": {
      "description": "Cell information for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the cell",
          "type": "integer"
        },
        "code": {
          "description": "The cell code",
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock number this cell belongs to",
          "type": "integer"
        },
        "corridors": {
          "description": "The corridors in this cell",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductCorridor"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductCorridor": {
      "description": "Corridor information for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the corridor",
          "type": "integer"
        },
        "code": {
          "description": "The corridor code",
          "type": "string"
        },
        "sections": {
          "description": "The sections in this corridor",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductSection"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductSection": {
      "description": "Section information for a product",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the section",
          "type": "integer"
        },
        "code": {
          "description": "The section code",
          "type": "string"
        },
        "shelves": {
          "description": "The shelves in this section",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Shelf"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Shelf": {
      "description": "Shelf information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the shelf",
          "type": "integer"
        },
        "description": {
          "description": "The description of the shelf",
          "type": "string"
        },
        "stock_number": {
          "format": "int32",
          "description": "The stock number this shelf belongs to",
          "type": "integer"
        },
        "weight": {
          "format": "double",
          "description": "The weight capacity of the shelf",
          "type": "number"
        },
        "width": {
          "format": "double",
          "description": "The width of the shelf",
          "type": "number"
        },
        "height": {
          "format": "double",
          "description": "The height of the shelf",
          "type": "number"
        },
        "depth": {
          "format": "double",
          "description": "The depth of the shelf",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductCell]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductCell"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Shelf]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Shelf"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Shelf]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Shelf"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.StockShelfSearch]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockShelfSearch"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.StockShelfSearch": {
      "description": "Model for shelf select",
      "type": "object",
      "properties": {
        "shelf": {
          "description": "The shelf code",
          "type": "string"
        },
        "saldo": {
          "format": "double",
          "description": "The balance on the shelf",
          "type": "number"
        },
        "type": {
          "format": "int32",
          "description": "The type of shelf",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.NumberSeriesStockTransaction]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.NumberSeriesStockTransaction"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.NumberSeriesStockTransaction": {
      "description": "Number series information for stock transactions",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the number series",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The type of the number series",
          "type": "integer"
        },
        "description": {
          "description": "The description of the number series",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Language]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Language"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Language": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "company_use_bit": {
          "type": "boolean"
        },
        "ui_culture": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductionFailcode]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductionFailcode"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductionFailcode": {
      "description": "A failure / scrap code (hylkäyssyy) used when reporting bad production",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorkTimeReason]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeReason"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorkTimeRegulation]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WorkTimeRegulation"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.DeliveryPackageType]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.DeliveryPackageType"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.DeliveryPackageType": {
      "description": "The delivery package type model",
      "type": "object",
      "properties": {
        "package_code": {
          "description": "The package code for the delivery package",
          "type": "string"
        },
        "description": {
          "description": "The description for the delivery package",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.MobileAppPage]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.MobileAppPage"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.MobileAppPage": {
      "description": "Mobiili sovelluksen sivu",
      "type": "object",
      "properties": {
        "app": {
          "format": "int32",
          "type": "integer"
        },
        "page_id": {
          "type": "string"
        },
        "page_order": {
          "format": "int32",
          "type": "integer"
        },
        "can_be_default_page": {
          "type": "boolean"
        },
        "is_default_page": {
          "type": "boolean"
        },
        "is_page_hidden": {
          "type": "boolean"
        },
        "settings": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.MobileAppSetting"
          }
        },
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.MobileAppSetting": {
      "description": "Mobiili sovelluksen sivu kohtaiset asetukset",
      "type": "object",
      "properties": {
        "page_codeid": {
          "format": "int32",
          "type": "integer"
        },
        "field_id": {
          "type": "string"
        },
        "is_field_visibility": {
          "type": "boolean"
        },
        "field_order": {
          "format": "int32",
          "type": "integer"
        },
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.DeliveryMethod]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.DeliveryMethod"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.DeliveryMethod": {
      "description": "Delivery method with Unifaun integration code (toimitustapa)",
      "type": "object",
      "properties": {
        "unifauncode": {
          "description": "The Unifaun service code for this delivery method",
          "type": "string"
        },
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.Currency]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.Currency"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ExpenseType]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ExpenseType"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ExpenseType": {
      "description": "Kulutosite proxy",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        },
        "account": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.PayrollTaxType]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PayrollTaxType"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PayrollTaxType": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.StandardWorkPhase]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StandardWorkPhase"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.StandardWorkPhase": {
      "type": "object",
      "properties": {
        "number": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.NumberseriesComplaint]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.NumberseriesComplaint"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.NumberseriesComplaint": {
      "description": "Number series complaint information",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the number series complaint",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The type of the number series complaint",
          "type": "integer"
        },
        "description": {
          "description": "The description of the number series complaint",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.Team]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.Team"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.Team": {
      "description": "Team proxy",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "type": "integer"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ChartOfAccountsNode]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ChartOfAccountsNode"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ChartOfAccountsNode": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "number": {
          "type": "string"
        },
        "account_number_start": {
          "type": "string"
        },
        "account_number_end": {
          "type": "string"
        },
        "type": {
          "format": "int32",
          "type": "integer"
        },
        "type_description": {
          "type": "string"
        },
        "father": {
          "type": "string"
        },
        "dk_entry": {
          "format": "int32",
          "type": "integer"
        },
        "dk_entry_description": {
          "type": "string"
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ChartOfAccountsNode"
          }
        },
        "accounts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ChartAccount"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ChartAccount": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "account_number": {
          "type": "string"
        },
        "type": {
          "format": "int32",
          "type": "integer"
        },
        "type_description": {
          "type": "string"
        },
        "dk_entry": {
          "format": "int32",
          "type": "integer"
        },
        "dk_entry_description": {
          "type": "string"
        },
        "taxrate": {
          "format": "double",
          "description": "Tax rate in force today. For an older document use taxrate_old, see taxrate_date",
          "type": "number"
        },
        "taxrate_old": {
          "format": "double",
          "description": "Tax rate that applied before taxrate_date, zero when the account has never changed rate",
          "type": "number"
        },
        "taxrate_date": {
          "format": "date-time",
          "description": "Date the account's tax rate changed to taxrate. Null when it has never changed. A document dated\r\nbefore this uses taxrate_old — the rate that was correct then, which is not the same as the rate\r\nthat is correct now",
          "type": "string"
        },
        "tax_treatment": {
          "format": "int32",
          "type": "integer"
        },
        "use_costcenter": {
          "format": "int32",
          "description": "Whether a cost center is required on rows using this account: 0 = optional, 1 = required, 2 = not in use",
          "type": "integer"
        },
        "use_project": {
          "format": "int32",
          "description": "Whether a project is required on rows using this account: 0 = optional, 1 = required, 2 = not in use",
          "type": "integer"
        },
        "use_lta": {
          "format": "int32",
          "description": "Whether an LTA is required on rows using this account: 0 = optional, 1 = required, 2 = not in use",
          "type": "integer"
        },
        "project_phase_code": {
          "description": "Project phase code the account resolves a row's project phase from, empty when it has none",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CrmType]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CrmType"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CrmType": {
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "type": "integer"
        },
        "header": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "transaction_type": {
          "format": "int32",
          "type": "integer"
        },
        "codelist_id": {
          "format": "int32",
          "type": "integer"
        },
        "type_allow_change": {
          "type": "boolean"
        },
        "icon": {
          "format": "byte",
          "type": "string"
        },
        "sales_goal": {
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ShelfStop]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ShelfStop"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ShelfStop": {
      "description": "Shelf stop information for collection routes",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The unique id of the shelf stop",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The stop number in the collection route sequence",
          "type": "integer"
        },
        "description": {
          "description": "The description of the shelf stop",
          "type": "string"
        },
        "stock_number": {
          "description": "The stock number this shelf stop belongs to",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CustomerContactAttributeSetting]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerContactAttributeSetting"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerContactAttributeSetting": {
      "description": "A master setting entry for contact attributes",
      "type": "object",
      "properties": {
        "Id": {
          "format": "int32",
          "description": "The attribute setting id",
          "type": "integer"
        },
        "Description": {
          "description": "The attribute description",
          "type": "string"
        },
        "Group_id": {
          "format": "int32",
          "description": "The attribute group id",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.CustomerAttributeSetting]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.CustomerAttributeSetting"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.CustomerAttributeSetting": {
      "description": "A master setting entry for customer attributes",
      "type": "object",
      "properties": {
        "Id": {
          "format": "int32",
          "description": "The attribute setting id",
          "type": "integer"
        },
        "Description": {
          "description": "The attribute description",
          "type": "string"
        },
        "Group_id": {
          "format": "int32",
          "description": "The attribute group id",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PostingMatrixFilter": {
      "description": "The filters for querying posting matrix.",
      "type": "object",
      "properties": {
        "search": {
          "description": "The name of the posting matrix",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PostingMatrix]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PostingMatrix"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PostingMatrix": {
      "description": "The posting matrix (Tiliöintimatriisin).",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the posting matrix",
          "type": "integer"
        },
        "description": {
          "description": "The name of the posting matrix",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.PostingMatrixRowFilter": {
      "description": "The filters for querying posting matrix rows.",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the posting matrix row.",
          "type": "integer"
        },
        "posting_matrix_id": {
          "format": "int32",
          "description": "The id of the posting matrix the row belongs to. (Tiliöintimatriisi)",
          "type": "integer"
        },
        "product_group": {
          "format": "int32",
          "description": "The product group id (tuoteryhmä)",
          "type": "integer"
        },
        "account": {
          "description": "The account number assigned to the posting matrix row. (Tili)",
          "type": "string"
        },
        "vat_rate": {
          "format": "double",
          "description": "VAT rate assigned to the posting matrix row. (ALV)",
          "type": "number"
        },
        "costcenter_code": {
          "description": "The cost center assigned to the posting matrix row (kustannuspaikka)",
          "type": "string"
        },
        "sort_desc": {
          "description": "Sorting order by id. Default is ascending (false).",
          "type": "boolean"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.PostingMatrixRow]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.PostingMatrixRow"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.PostingMatrixRow": {
      "description": "The posting matrix row (Tiliöintimatriisin rivi).",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The id of the posting matrix row.",
          "type": "integer"
        },
        "posting_matrix_id": {
          "format": "int32",
          "description": "The id of the posting matrix the row belongs to. (Tiliöintimatriisi)",
          "type": "integer"
        },
        "product_group": {
          "format": "int32",
          "description": "The product group id (tuoteryhmä)",
          "type": "integer"
        },
        "product_group_description": {
          "description": "The description of the product group.",
          "type": "string"
        },
        "account": {
          "description": "The account number assigned to the posting matrix row. (Tili)",
          "type": "string"
        },
        "vat_rate": {
          "format": "double",
          "description": "The vat rate assigned to the posting matrix row. (ALV)",
          "type": "number"
        },
        "costcenter_code": {
          "description": "The cost center assigned to the posting matrix row (kustannuspaikka)",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.AccountingBlocking]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.AccountingBlocking"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.AccountingBlocking": {
      "description": "Blocking details in accounting",
      "type": "object",
      "properties": {
        "number": {
          "format": "int32",
          "description": "Number",
          "type": "integer"
        },
        "description": {
          "description": "Description",
          "type": "string"
        },
        "type": {
          "format": "int32",
          "description": "Time period type",
          "type": "integer"
        },
        "time": {
          "format": "int32",
          "description": "Time period length",
          "type": "integer"
        },
        "inuse_accounting": {
          "description": "Whether the blocking is in use in accounting",
          "type": "boolean"
        },
        "inuse_invoices": {
          "description": "Whether the blocking is in use in invoices",
          "type": "boolean"
        },
        "inuse_purchases": {
          "description": "Whether the blocking is in use in purchases",
          "type": "boolean"
        },
        "account": {
          "description": "Related account",
          "type": "string"
        },
        "blocking_class": {
          "format": "int32",
          "description": "Blocking class",
          "type": "integer"
        },
        "manualstart": {
          "description": "Whether the blocking is started manually",
          "type": "boolean"
        },
        "separation": {
          "description": "Whether separation is enabled",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.TaxRate]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.TaxRate"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.TaxRate": {
      "description": "A tax rate the organisation has configured. The set is what the ERP will accept on a row: a rate\r\noutside it cannot be posted, whatever the law says",
      "type": "object",
      "properties": {
        "taxrate_id": {
          "format": "int32",
          "description": "Identifier of the tax rate",
          "type": "integer"
        },
        "taxrate": {
          "format": "double",
          "description": "The rate itself, as a percentage",
          "type": "number"
        },
        "description": {
          "description": "Name shown to users, e.g. \"Normaali verokanta 24%\"",
          "type": "string"
        },
        "own_tax": {
          "description": "Whether the rate is the organisation's own tax rather than a statutory one",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.StateMachineVariant]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StateMachineVariant"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.StateMachineVariant": {
      "description": "State machine variant. One ProgramId can have several variants;\r\nexactly one of them carries is_default = true.",
      "required": [
        "key"
      ],
      "type": "object",
      "properties": {
        "state_machine_id": {
          "format": "int32",
          "description": "Surrogate id of the variant (primary key of dbo.StateProgram).",
          "type": "integer"
        },
        "program_id": {
          "format": "int32",
          "description": "Entity type the variant applies to. See StateProgramIdEnum (Customer = 9).",
          "type": "integer"
        },
        "key": {
          "description": "Stable key within program_id. Default value: \"default\".",
          "maxLength": 50,
          "minLength": 0,
          "type": "string"
        },
        "name": {
          "description": "Human-readable name for the variant.",
          "maxLength": 200,
          "minLength": 0,
          "type": "string"
        },
        "is_default": {
          "description": "True when this is the default variant for the program. At most one per program_id.",
          "type": "boolean"
        },
        "no_transition_check": {
          "description": "If true, transition validation is bypassed.",
          "type": "boolean"
        },
        "default_state_number": {
          "format": "int32",
          "description": "Default state number when new entities are created.",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.StateMachineVariant]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.StateMachineVariant"
        }
      }
    },
    "LemonRest.Models.QueryFilters.StockFilter": {
      "description": "Filter for querying changed product stock balances within a time window. The maximum allowed window is 10 minutes; if a larger window is requested, modified_after is automatically shifted forward to enforce the limit.",
      "type": "object",
      "properties": {
        "modified_before": {
          "format": "date-time",
          "description": "End of the time window. Only stock balances whose last change is at or before this timestamp are returned. Defaults to the current server time.",
          "type": "string"
        },
        "modified_after": {
          "format": "date-time",
          "description": "Start of the time window. Only stock balances whose last change is at or after this timestamp are returned. If the resulting window exceeds 10 minutes, this value is automatically moved forward so that the window ends at modified_before and spans exactly 10 minutes.",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.ProductStockStatus]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.ProductStockStatus"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.ProductStockStatus": {
      "description": "Stock balance status for a single product in a single stock location (varastosaldo)",
      "type": "object",
      "properties": {
        "product_id": {
          "format": "int32",
          "description": "The internal id of the product",
          "type": "integer"
        },
        "stock": {
          "format": "int32",
          "description": "The stock location number (varasto). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "stock_instock": {
          "format": "double",
          "description": "The current physical amount of the product in this stock location (varastosaldo)",
          "type": "number"
        },
        "free_saldo": {
          "format": "double",
          "description": "The free (uncommitted) balance available in this stock location (vapaa saldo)",
          "type": "number"
        },
        "outward": {
          "format": "double",
          "description": "The amount currently reserved for outgoing deliveries from this stock location",
          "type": "number"
        },
        "default_stock": {
          "description": "Indicates whether this stock location is the default stock for the product",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.QueryFilters.StockDeliveryFilter": {
      "description": "Filter for querying stock deliveries. Inherits page and page_size from PageFilter.",
      "type": "object",
      "properties": {
        "delivery_type": {
          "format": "int32",
          "description": "Filter by delivery type. 1=sales order (myyntitilaus), 2=purchase order (ostotilaus), 3=production (tuotanto), 4=production reservation (tuotantovaraus).",
          "type": "integer"
        },
        "delivery_stock_number": {
          "format": "int32",
          "description": "Filter by stock location number (varasto). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "delivery_product_code": {
          "description": "Filter by product code (tuotekoodi). Matches deliveries whose delivery_product_code contains the given string. For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "job_id": {
          "format": "int32",
          "description": "Filter by job id (for production-related deliveries)",
          "type": "integer"
        },
        "forecast_type": {
          "format": "int32",
          "description": "Filter by forecast type",
          "type": "integer"
        },
        "delivery_priority": {
          "format": "int32",
          "description": "Filter by delivery priority. 0=normal, 1=high, 2=critical",
          "type": "integer"
        },
        "order_id": {
          "format": "int32",
          "description": "Filter by the id of the source order or work order the delivery is bound to",
          "type": "integer"
        },
        "delivery_id": {
          "format": "int32",
          "description": "Filter by a specific delivery_id",
          "type": "integer"
        },
        "delivery_date_before": {
          "format": "date-time",
          "description": "Return only deliveries whose delivery_date is on or before this date. When a date with no time component is supplied, the filter automatically extends to the end of that day (23:59:59).",
          "type": "string"
        },
        "delivery_date_after": {
          "format": "date-time",
          "description": "Return only deliveries whose delivery_date is on or after this date.",
          "type": "string"
        },
        "sort_desc": {
          "description": "When true, results are sorted by delivery_id in descending order. Default is ascending.",
          "type": "boolean"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.StockDelivery]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.StockDelivery"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.StockDelivery": {
      "description": "A single stock delivery event representing material moving into or out of a stock location (varastotapahtuma)",
      "type": "object",
      "properties": {
        "delivery_id": {
          "format": "int32",
          "description": "The unique identifier for the stock delivery",
          "type": "integer"
        },
        "delivery_type": {
          "format": "int32",
          "description": "The type of the delivery. 1=sales order (myyntitilaus), 2=purchase order (ostotilaus), 3=production (tuotanto), 4=production reservation (tuotantovaraus). This value determines which of sales_order_number, purchase_order_number, or worknumber is populated on the row.",
          "type": "integer"
        },
        "delivery_product_code": {
          "description": "The product code being delivered (tuotekoodi). For possible values, refer to /api/products\r\n[here](#tag/products/operation/Product_List)",
          "type": "string"
        },
        "delivery_stock_number": {
          "format": "int32",
          "description": "The stock location number for the delivery (varasto). For possible values, refer to /api/settings/products/stocks\r\n[here](#tag/Settings/operation/Settings_GetProductStocks)",
          "type": "integer"
        },
        "delivery_date": {
          "format": "date-time",
          "description": "The planned or actual date of the delivery",
          "type": "string"
        },
        "delivery_amount": {
          "format": "double",
          "description": "The amount of product to be delivered",
          "type": "number"
        },
        "delivery_description": {
          "description": "Free-form description of the delivery",
          "type": "string"
        },
        "job_id": {
          "format": "int32",
          "description": "The job id associated with the delivery (for production-related deliveries)",
          "type": "integer"
        },
        "forecast_type": {
          "format": "int32",
          "description": "The forecast type of the delivery",
          "type": "integer"
        },
        "delivery_priority": {
          "format": "int32",
          "description": "The priority of the delivery. 0=normal, 1=high, 2=critical",
          "type": "integer"
        },
        "row_id": {
          "format": "int32",
          "description": "The row id on the underlying source document (order row, production row, etc.)",
          "type": "integer"
        },
        "order_id": {
          "format": "int32",
          "description": "The id of the source order or work order the delivery is bound to",
          "type": "integer"
        },
        "delivery_confirmed_at": {
          "format": "date-time",
          "description": "The date and time when the delivery was confirmed, or null if it has not been confirmed yet",
          "type": "string"
        },
        "sales_order_number": {
          "format": "int32",
          "description": "The sales order number this delivery belongs to (tilausnumero). Populated only when delivery_type = 1 (sales order). For possible values, refer to /api/orders\r\n[here](#tag/orders/operation/Order_List)",
          "type": "integer"
        },
        "purchase_order_number": {
          "format": "int32",
          "description": "The purchase order number this delivery belongs to. Populated only when delivery_type = 2 (purchase order). For possible values, refer to /api/purchaseorders\r\n[here](#tag/purchaseorders/operation/PurchaseOrder_List)",
          "type": "integer"
        },
        "worknumber": {
          "format": "int32",
          "description": "The work order number this delivery belongs to. Populated only when delivery_type = 3 (production) or 4 (production reservation).",
          "type": "integer"
        },
        "cumulative_saldo": {
          "format": "int32",
          "description": "The cumulative delivered amount for this delivery row up to and including this event",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Proxy.Substitute": {
      "description": "A person substitute (sijainen): the person who stands in for another person for a period of time.",
      "type": "object",
      "properties": {
        "substitute_id": {
          "format": "int32",
          "description": "The unique identifier of the substitute row.",
          "type": "integer"
        },
        "person_id": {
          "format": "int32",
          "description": "The identifier of the person who is being substituted.",
          "type": "integer"
        },
        "person_name": {
          "description": "The name of the person who is being substituted.",
          "type": "string"
        },
        "substitute_person_id": {
          "format": "int32",
          "description": "The identifier of the substitute person.",
          "type": "integer"
        },
        "substitute_person_name": {
          "description": "The name of the substitute person.",
          "type": "string"
        },
        "in_use": {
          "description": "Indicates whether the substitute row is in use.",
          "type": "boolean"
        },
        "start_date": {
          "format": "date-time",
          "description": "The date from which the substitution is effective, or null when unset.",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "description": "The date after which the substitution ends, or null when open ended.",
          "type": "string"
        },
        "description": {
          "description": "The description of the substitution.",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.GlobalTravelExpense": {
      "description": "A single travel expense row used when creating a travel expense (matkalasku) — one row represents one trip leg with its vehicle, route, kilometers, allowances, and passengers",
      "type": "object",
      "properties": {
        "passenger_list": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.TravelExpensePassenger"
          }
        },
        "id": {
          "format": "int32",
          "description": "The travel expense row id. Set to 0 when creating",
          "type": "integer"
        },
        "person": {
          "format": "int32",
          "description": "The person number of the traveller (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "person_name": {
          "description": "The traveller's name. Informational — the actual person is identified by the person number",
          "type": "string"
        },
        "description": {
          "description": "Free-text description of the trip (selite)",
          "type": "string"
        },
        "start_date": {
          "format": "date-time",
          "description": "The trip start date and time",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "description": "The trip end date and time",
          "type": "string"
        },
        "vehicle": {
          "format": "int32",
          "description": "The vehicle id used on this trip (ajoneuvo)",
          "type": "integer"
        },
        "vehicle_description": {
          "description": "The vehicle description (ajoneuvon kuvaus)",
          "type": "string"
        },
        "route": {
          "description": "The travel route as free text (matkareitti)",
          "type": "string"
        },
        "kilometers": {
          "format": "int32",
          "description": "The number of kilometers driven on the trip (kilometrit)",
          "type": "integer"
        },
        "customer": {
          "format": "int32",
          "description": "The customer number associated with the trip (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_name": {
          "description": "The customer's name. Informational — the actual customer is identified by the customer number",
          "type": "string"
        },
        "project": {
          "format": "int32",
          "description": "The project number associated with the trip (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "project_description": {
          "description": "The project description. Informational — the actual project is identified by the project number",
          "type": "string"
        },
        "costcenter": {
          "description": "The cost center for this trip (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "costcenter_description": {
          "description": "The cost center description. Informational — the actual cost center is identified by the costcenter code",
          "type": "string"
        },
        "passengers": {
          "format": "int32",
          "description": "The number of passengers carried on the trip (matkustajat)",
          "type": "integer"
        },
        "note": {
          "description": "Additional note for the trip (huomautus)",
          "type": "string"
        },
        "calculate_allowance": {
          "description": "When true, daily allowances, kilometer compensation and passenger compensation are calculated automatically from the travel times, kilometers and country (päiväraha-laskenta)",
          "type": "boolean"
        },
        "travel_time": {
          "format": "double",
          "description": "The duration of the trip in hours (matka-aika)",
          "type": "number"
        },
        "free_meal": {
          "description": "When true, a free meal was provided during the trip and the allowance is reduced accordingly (ilmainen ateria)",
          "type": "boolean"
        },
        "first_day_free_meals": {
          "format": "int32",
          "description": "Amount of free meals provided on the first travel day. Used to reduce the daily allowance for that day",
          "type": "integer"
        },
        "night_allowance": {
          "format": "double",
          "description": "The night allowance amount (yöraha)",
          "type": "number"
        },
        "night_allowance_fos": {
          "format": "int32",
          "description": "The form-of-salary code used to post the night allowance to payroll (yörahan palkkalaji)",
          "type": "integer"
        },
        "country_code": {
          "description": "The ISO country code where the trip took place. Defaults to \"FI\". Used when resolving daily allowance rates (maakoodi)",
          "type": "string"
        },
        "kilometers2": {
          "format": "double",
          "description": "Additional kilometers driven with a secondary compensation rate, e.g. with a trailer or load (lisäkilometrit)",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Proxy.TravelExpensePassenger": {
      "description": "A passenger carried on a travel expense row (matkustaja). The compensation paid for carrying a passenger is added to the travel expense",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The passenger entry id. Set to 0 when creating",
          "type": "integer"
        },
        "row_id": {
          "format": "int32",
          "description": "The id of the parent travel expense row this passenger belongs to",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The passenger's person number (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "start": {
          "format": "double",
          "description": "Kilometer reading at the start of the passenger's leg",
          "type": "number"
        },
        "end": {
          "format": "double",
          "description": "Kilometer reading at the end of the passenger's leg",
          "type": "number"
        },
        "total": {
          "format": "double",
          "description": "The total kilometers the passenger was carried",
          "type": "number"
        },
        "route": {
          "description": "The route the passenger travelled as free text",
          "type": "string"
        }
      }
    },
    "LemonRest.Models.QueryFilters.TravelExpenseFilter": {
      "description": "Filter for querying travel expenses (matkalaskut). Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter",
      "type": "object",
      "properties": {
        "type": {
          "format": "int32",
          "description": "Filter by travel expense type code (matkalaskun laji)",
          "type": "integer"
        },
        "state": {
          "description": "Filter by one or more travel expense state codes (tila). For possible values, refer to /api/settings/states/{state_source}\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "number": {
          "format": "int32",
          "description": "Filter by travel expense running number (matkalaskunumero)",
          "type": "integer"
        },
        "created_after": {
          "format": "date-time",
          "description": "Filter travel expenses created on or after this date",
          "type": "string"
        },
        "created_before": {
          "format": "date-time",
          "description": "Filter travel expenses created on or before this date",
          "type": "string"
        },
        "updated_after": {
          "format": "date-time",
          "description": "Filter travel expenses updated on or after this date",
          "type": "string"
        },
        "updated_before": {
          "format": "date-time",
          "description": "Filter travel expenses updated on or before this date",
          "type": "string"
        },
        "company_account_row": {
          "format": "int32",
          "description": "Filter by the company bank account row used for payment. For possible values, refer to /api/company/accounts\r\n[here](#tag/company/operation/Company_GetAccounts)",
          "type": "integer"
        },
        "currency_code": {
          "description": "Filter by currency code (valuuttakoodi). For possible values, refer to /api/settings/currency/{code}\r\n[here](#tag/Settings/operation/Settings_GetCurrency)",
          "type": "string"
        },
        "person_number": {
          "format": "int32",
          "description": "Filter by the traveller's person number (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "circulation": {
          "format": "int32",
          "description": "Filter by the circulation/approval id (kierrätys)",
          "type": "integer"
        },
        "paid": {
          "description": "Filter by paid status — true returns only paid travel expenses, false returns only unpaid",
          "type": "boolean"
        },
        "salary_id": {
          "format": "int32",
          "description": "Filter by the salary batch id the travel expense was transferred to payroll through (palkkaerä)",
          "type": "integer"
        },
        "circulation_ready_bit": {
          "description": "Filter by circulation ready bit — true returns travel expenses that have been marked ready for circulation",
          "type": "boolean"
        },
        "sort_desc": {
          "description": "When true, results are sorted by travel expense id in descending order (newest first). Defaults to ascending",
          "type": "boolean"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.TravelExpenseMainRaw]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.TravelExpenseMainRaw"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.TravelExpenseMainRaw": {
      "description": "Travel expense header model in raw form (matkalaskun pääsivu) — mirrors the underlying database fields and is used by POST /api/travelexpenses/raw and GET /api/travelexpenses for full read/write access to all columns",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The travel expense id",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The travel expense type code (matkalaskun laji)",
          "type": "integer"
        },
        "state": {
          "format": "int32",
          "description": "The travel expense state code (tila). For possible values, refer to /api/settings/states/{state_source}\r\n[here](#tag/Settings/operation/Settings_GetStateList)",
          "type": "integer"
        },
        "number": {
          "format": "int32",
          "description": "The travel expense running number (matkalaskunumero)",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The travel expense date (matkalaskun päivämäärä)",
          "type": "string"
        },
        "description": {
          "description": "Free-text description of the travel expense (selite)",
          "type": "string"
        },
        "company_account_row": {
          "format": "int32",
          "description": "The company bank account row used for payment (yrityksen pankkitili). For possible values, refer to /api/company/accounts\r\n[here](#tag/company/operation/Company_GetAccounts)",
          "type": "integer"
        },
        "total_sum": {
          "format": "double",
          "description": "The total sum of all rows on the travel expense (kokonaissumma)",
          "type": "number"
        },
        "currency_code": {
          "description": "The currency code of the travel expense (valuuttakoodi). For possible values, refer to /api/settings/currency/{code}\r\n[here](#tag/Settings/operation/Settings_GetCurrency)",
          "type": "string"
        },
        "currency_rate": {
          "format": "double",
          "description": "The currency rate used for converting the travel expense to the company's home currency (valuuttakurssi)",
          "type": "number"
        },
        "person_number": {
          "format": "int32",
          "description": "The traveller's person number (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "circulation": {
          "format": "int32",
          "description": "The circulation/approval id assigned to the travel expense (kierrätys)",
          "type": "integer"
        },
        "paid": {
          "description": "Indicates whether the travel expense has been paid",
          "type": "boolean"
        },
        "salary_id": {
          "format": "int32",
          "description": "The salary batch id this travel expense was paid through, if it has been transferred to payroll (palkkaerä)",
          "type": "integer"
        },
        "circulation_ready_bit": {
          "description": "When true, the travel expense has been marked ready to be circulated for approval (kierrätys valmis)",
          "type": "boolean"
        },
        "rows": {
          "description": "The travel expense rows (line items), one per trip leg",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.TravelExpenseRowRaw"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.TravelExpenseRowRaw": {
      "description": "A single travel expense row in raw form (matkalaskun rivi) — mirrors the underlying database columns including all calculated allowance fields and payroll posting codes",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The travel expense row id",
          "type": "integer"
        },
        "travel_expense_id": {
          "format": "int32",
          "description": "The id of the parent travel expense header this row belongs to",
          "type": "integer"
        },
        "vehicle": {
          "format": "int32",
          "description": "The primary vehicle id used on this row (ajoneuvo)",
          "type": "integer"
        },
        "passenger": {
          "format": "int32",
          "description": "The number of passengers carried (matkustajat)",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number associated with the trip (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_name": {
          "description": "The customer's name. Informational — the actual customer is identified by the customer number",
          "type": "string"
        },
        "route": {
          "description": "The travel route as free text (matkareitti)",
          "type": "string"
        },
        "start_date": {
          "format": "date-time",
          "description": "The trip start date and time",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "description": "The trip end date and time",
          "type": "string"
        },
        "meter_start": {
          "format": "double",
          "description": "Vehicle odometer reading at the start of the trip (mittarilukema alussa)",
          "type": "number"
        },
        "meter_end": {
          "format": "double",
          "description": "Vehicle odometer reading at the end of the trip (mittarilukema lopussa)",
          "type": "number"
        },
        "costcenter": {
          "description": "The cost center for the trip (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "project": {
          "format": "int32",
          "description": "The project number associated with the trip (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "allowance": {
          "format": "double",
          "description": "The amount of full daily allowance units (päiväraha kpl)",
          "type": "number"
        },
        "allowance_money": {
          "format": "double",
          "description": "The total money amount of full daily allowances (päiväraha-summa)",
          "type": "number"
        },
        "part_allowance": {
          "format": "double",
          "description": "The amount of partial daily allowance units (osapäiväraha kpl)",
          "type": "number"
        },
        "part_allowance_money": {
          "format": "double",
          "description": "The total money amount of partial daily allowances (osapäiväraha-summa)",
          "type": "number"
        },
        "travel_time": {
          "format": "double",
          "description": "The duration of the trip in hours (matka-aika)",
          "type": "number"
        },
        "kilometers": {
          "format": "double",
          "description": "The number of kilometers driven (kilometrit)",
          "type": "number"
        },
        "kilometers_money": {
          "format": "double",
          "description": "The total money amount of kilometer compensation (kilometrikorvaus)",
          "type": "number"
        },
        "note": {
          "description": "Additional note for the trip (huomautus)",
          "type": "string"
        },
        "free_meal": {
          "description": "When true, a free meal was provided during the trip and the allowance is reduced accordingly (ilmainen ateria)",
          "type": "boolean"
        },
        "country_code": {
          "description": "The ISO country code where the trip took place. Used when resolving daily allowance rates (maakoodi)",
          "type": "string"
        },
        "allowance_forms_of_salary": {
          "format": "int32",
          "description": "Form-of-salary code used when posting the full daily allowance to payroll (päivärahan palkkalaji)",
          "type": "integer"
        },
        "part_allowance_forms_of_salary": {
          "format": "int32",
          "description": "Form-of-salary code used when posting the partial daily allowance to payroll (osapäivärahan palkkalaji)",
          "type": "integer"
        },
        "passenger_forms_of_salary": {
          "format": "int32",
          "description": "Form-of-salary code used when posting passenger compensation to payroll (matkustajakorvauksen palkkalaji)",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "description": "The project phase id associated with the trip (projektivaihe). For possible values, refer to /api/projects/{number}/phase\r\n[here](#tag/projects/operation/Project_GetPhases)",
          "type": "integer"
        },
        "sales_order_id": {
          "format": "int32",
          "description": "The id of the sales order linked to this row, if any (tilausnumero)",
          "type": "integer"
        },
        "crm_id": {
          "format": "int32",
          "description": "The id of the CRM transaction linked to this row, if any (asiakkuustapahtuma)",
          "type": "integer"
        },
        "project_invoice_bit": {
          "description": "When true, the row will be billed to the customer via the project (projektilaskutus)",
          "type": "boolean"
        },
        "project_invoice_number": {
          "format": "int32",
          "description": "The project invoice number this row was invoiced through, if any",
          "type": "integer"
        },
        "vehicle2": {
          "format": "int32",
          "description": "Secondary vehicle id used on the row, e.g. with a trailer (toinen ajoneuvo)",
          "type": "integer"
        },
        "kilometers2": {
          "format": "double",
          "description": "Additional kilometers driven with the secondary compensation rate (lisäkilometrit)",
          "type": "number"
        },
        "kilometers_money2": {
          "format": "double",
          "description": "Money amount of the secondary kilometer compensation (lisäkilometrikorvaus)",
          "type": "number"
        },
        "meal_allowance_fos": {
          "format": "int32",
          "description": "Form-of-salary code used when posting meal allowance to payroll (ateriakorvauksen palkkalaji)",
          "type": "integer"
        },
        "meal_allowance": {
          "format": "double",
          "description": "The amount of meal allowance units (ateriakorvaus kpl)",
          "type": "number"
        },
        "meal_allowance_money": {
          "format": "double",
          "description": "The total money amount of meal allowances (ateriakorvaus-summa)",
          "type": "number"
        },
        "night_allowance_fos": {
          "format": "int32",
          "description": "Form-of-salary code used when posting night allowance to payroll (yörahan palkkalaji)",
          "type": "integer"
        },
        "night_allowance": {
          "format": "double",
          "description": "The amount of night allowance units (yöraha kpl)",
          "type": "number"
        },
        "night_allowance_money": {
          "format": "double",
          "description": "The total money amount of night allowances (yöraha-summa)",
          "type": "number"
        },
        "passenger_kilometers": {
          "format": "double",
          "description": "The number of kilometers a passenger was carried (matkustajakilometrit)",
          "type": "number"
        },
        "passenger_kilometers_money": {
          "format": "double",
          "description": "The total money amount of passenger kilometer compensation (matkustajakorvaus)",
          "type": "number"
        },
        "calculate_allowance_bit": {
          "description": "When true, daily allowances, kilometer compensation and passenger compensation are calculated automatically for this row (päiväraha-laskenta)",
          "type": "boolean"
        },
        "lta": {
          "description": "The LTA (long-term agreement) code applied to the row. For possible values, refer to /api/settings/ltas\r\n[here](#tag/Settings/operation/Settings_GetLtas)",
          "type": "string"
        },
        "project_invoicing_type": {
          "format": "int32",
          "description": "The invoicing type used when billing this row through the project (laskutuslaji)",
          "type": "integer"
        },
        "travel_regulation": {
          "format": "int32",
          "description": "The travel regulation/ruleset applied to the row (matkustussääntö)",
          "type": "integer"
        },
        "passengers": {
          "description": "The passengers carried on this row",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.TravelExpensePassenger"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.GlobalTravelExpenseSummary": {
      "description": "Travel expense summary model — used by POST /api/travelexpenses/summary to create a single travel expense from one or more child travel rows (matkalaskuyhteenveto)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The travel expense id. Must be 0 — updating an existing summary via this endpoint is not supported",
          "type": "integer"
        },
        "person": {
          "format": "int32",
          "description": "The person number of the traveller (henkilönumero). For possible values, refer to /api/persons\r\n[here](#tag/persons/operation/Person_GetPersons)",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The travel expense date — used as the date of the created travel expense header",
          "type": "string"
        },
        "description": {
          "description": "Free-text description for the travel expense header (selite)",
          "type": "string"
        },
        "rows": {
          "description": "The travel expense rows, one per trip leg. All rows must belong to the same person",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.GlobalTravelExpense"
          }
        }
      }
    },
    "LemonRest.Models.QueryFilters.MobileTravelFilter": {
      "description": "Filter for querying mobile travels (mobiilimatkat). Inherits page and page_size from PageFilter, and search and object_ids from BaseFilter. The person_number must match the logged-in user — a user can only query their own mobile travels",
      "type": "object",
      "properties": {
        "states": {
          "description": "Filter by one or more mobile travel state codes (tila)",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "person_number": {
          "format": "int32",
          "description": "Filter by the traveller's person number. Must match the logged-in user (henkilönumero)",
          "type": "integer"
        },
        "person_job_id": {
          "format": "int32",
          "description": "Filter by the person job (work assignment) id the trip relates to (henkilön työtehtävä)",
          "type": "integer"
        },
        "person_job_type": {
          "format": "int32",
          "description": "Filter by the person job type code the trip relates to",
          "type": "integer"
        },
        "object_ids": {
          "description": "Filter by a list of object ids. Returns only objects with matching ids",
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "search": {
          "description": "Free text search across relevant fields (e.g., description, reference)",
          "type": "string"
        },
        "page": {
          "format": "int32",
          "description": "If not defined, using default value of 1",
          "type": "integer"
        },
        "page_size": {
          "format": "int32",
          "description": "If not defined, using default value of 10",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.PagedListResponse[LemonRest.Models.Proxy.MobileTravel]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.MobileTravel"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_next_page": {
          "type": "boolean"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.MobileTravel": {
      "description": "Mobile travel model — a trip recorded via the Lemonsoft mobile app, optionally with one or more GPS-tracked routes that can later be converted into a regular travel expense (mobiilimatka)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The mobile travel id. Set to 0 when creating",
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "The mobile travel type code (matkan laji)",
          "type": "integer"
        },
        "state": {
          "format": "int32",
          "description": "The mobile travel state code (tila)",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "description": "The traveller's person number. Must match the logged-in user — a user can only manage their own mobile travels (henkilönumero)",
          "type": "integer"
        },
        "person_name": {
          "description": "The traveller's name. Informational",
          "type": "string"
        },
        "date": {
          "format": "date-time",
          "description": "The trip start date and time. Converted to the server's local time zone on create and update",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "description": "The trip end date and time. Converted to the server's local time zone on create and update",
          "type": "string"
        },
        "description": {
          "description": "Free-text description of the trip (selite)",
          "type": "string"
        },
        "vehicle": {
          "format": "int32",
          "description": "The vehicle id used on the trip (ajoneuvo)",
          "type": "integer"
        },
        "vehicle_description": {
          "description": "The vehicle description. Informational",
          "type": "string"
        },
        "route": {
          "description": "The travel route as free text (matkareitti)",
          "type": "string"
        },
        "is_route_manual": {
          "description": "When true, the route was entered manually instead of being tracked via GPS",
          "type": "boolean"
        },
        "km": {
          "format": "int32",
          "description": "The total kilometers driven on the trip",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "description": "The customer number associated with the trip (asiakasnumero). For possible values, refer to /api/customers\r\n[here](#tag/customers/operation/Customer_List)",
          "type": "integer"
        },
        "customer_name": {
          "description": "The customer's name. Informational",
          "type": "string"
        },
        "project_number": {
          "format": "int32",
          "description": "The project number associated with the trip (projektinumero). For possible values, refer to /api/projects\r\n[here](#tag/projects/operation/Project_List)",
          "type": "integer"
        },
        "project_description": {
          "description": "The project description. Informational",
          "type": "string"
        },
        "cost_center": {
          "description": "The cost center for the trip (kustannuspaikka). For possible values, refer to /api/settings/costcenters\r\n[here](#tag/Settings/operation/Settings_GetCostCenters)",
          "type": "string"
        },
        "cost_center_description": {
          "description": "The cost center description. Informational",
          "type": "string"
        },
        "passengers": {
          "format": "int32",
          "description": "The number of passengers carried on the trip (matkustajat)",
          "type": "integer"
        },
        "calculate_allowance": {
          "description": "When true, daily allowances, kilometer compensation and passenger compensation will be calculated automatically when the mobile travel is converted into a travel expense",
          "type": "boolean"
        },
        "person_job_id": {
          "format": "int32",
          "description": "The id of the person job (work assignment) the trip relates to, if any (henkilön työtehtävä)",
          "type": "integer"
        },
        "person_job_type": {
          "format": "int32",
          "description": "The type code of the person job the trip relates to",
          "type": "integer"
        },
        "travel_expense_id": {
          "format": "int32",
          "description": "The id of the travel expense this mobile travel has been converted into, if any. 0 when the trip has not yet been converted",
          "type": "integer"
        },
        "first_day_free_meals": {
          "format": "int32",
          "description": "Amount of free meals provided on the first travel day. Used to reduce the daily allowance for that day when the mobile travel is converted into a travel expense",
          "type": "integer"
        },
        "routes": {
          "description": "The GPS-tracked (or manually added) route legs of the mobile travel",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.MobileTravelRoute"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.MobileTravelRoute": {
      "description": "A single leg of a mobile travel route — typically captured automatically by the mobile app's GPS tracker, with start and end coordinates and addresses (matkareitin osa)",
      "type": "object",
      "properties": {
        "id": {
          "format": "int32",
          "description": "The route leg id. Set to 0 when creating",
          "type": "integer"
        },
        "travel_id": {
          "format": "int32",
          "description": "The id of the parent mobile travel this route leg belongs to",
          "type": "integer"
        },
        "date": {
          "format": "date-time",
          "description": "The start date and time of the route leg. Converted to the server's local time zone on create and update",
          "type": "string"
        },
        "end_date": {
          "format": "date-time",
          "description": "The end date and time of the route leg. Converted to the server's local time zone on create and update",
          "type": "string"
        },
        "start_address": {
          "description": "The starting address of the route leg, typically reverse-geocoded from the start coordinates",
          "type": "string"
        },
        "end_address": {
          "description": "The ending address of the route leg, typically reverse-geocoded from the end coordinates",
          "type": "string"
        },
        "km": {
          "format": "int32",
          "description": "The number of kilometers driven on this leg",
          "type": "integer"
        },
        "start_latitude": {
          "format": "double",
          "description": "Latitude (WGS 84) at the start of the route leg",
          "type": "number"
        },
        "start_longitude": {
          "format": "double",
          "description": "Longitude (WGS 84) at the start of the route leg",
          "type": "number"
        },
        "end_latitude": {
          "format": "double",
          "description": "Latitude (WGS 84) at the end of the route leg",
          "type": "number"
        },
        "end_longitude": {
          "format": "double",
          "description": "Longitude (WGS 84) at the end of the route leg",
          "type": "number"
        }
      }
    },
    "LemonRest.Models.Response.SingleObjectResponse[LemonRest.Models.Proxy.MobileTravel]": {
      "type": "object",
      "properties": {
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        },
        "ok": {
          "type": "boolean"
        },
        "result": {
          "$ref": "#/definitions/LemonRest.Models.Proxy.MobileTravel"
        }
      }
    },
    "LemonRest.Models.Proxy.UiControlCustomization": {
      "description": "A saved UI control customization (personalization) for a view.",
      "type": "object",
      "properties": {
        "guid": {
          "description": "GUID of the view the setting applies to.",
          "type": "string"
        },
        "ui_control_key": {
          "description": "UI control key.",
          "type": "string"
        },
        "ui_control_value": {
          "description": "UI control settings as JSON.",
          "type": "string"
        },
        "company_wide": {
          "description": "Whether the setting is stored company-wide (requires the administrator role).",
          "type": "boolean"
        }
      }
    },
    "LemonRest.Models.LogInTokenInstanceDatabase": {
      "required": [
        "Token",
        "Database",
        "InstanceId",
        "ApiKey"
      ],
      "type": "object",
      "properties": {
        "Token": {
          "type": "string"
        },
        "Database": {
          "type": "string"
        },
        "InstanceId": {
          "type": "string"
        },
        "ApiKey": {
          "type": "string"
        }
      }
    },
    "LemonRest.Models.Proxy.WorktimeRecord": {
      "description": "Worktime row for batch create/update via LemonREST.\r\nProperty names match worktimes table columns.\r\nDate values are Finland local wall-clock time.\r\nKeep in sync with KellokorttiWebApi/Models/LemonsoftREST/LemonsoftWorktimeDto.cs.",
      "required": [
        "person_number",
        "worktime_date"
      ],
      "type": "object",
      "properties": {
        "worktime_id": {
          "format": "int32",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_date": {
          "format": "date-time",
          "type": "string"
        },
        "worktime_enddate": {
          "format": "date-time",
          "type": "string"
        },
        "worktime_date_utc": {
          "format": "date-time",
          "description": "UTC instant for duration calculation (Finland-local columns use {LemonRest.Models.Proxy.WorktimeRecord.worktime_date} / {LemonRest.Models.Proxy.WorktimeRecord.worktime_enddate}).",
          "type": "string"
        },
        "worktime_enddate_utc": {
          "format": "date-time",
          "type": "string"
        },
        "worktime_hours": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_lunchcutback": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_state": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_invoice_bit": {
          "type": "boolean"
        },
        "worktime_description": {
          "type": "string"
        },
        "formofsalary_number": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_reason": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_workshift": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_event_type_id": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_source": {
          "format": "int32",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_costcenter": {
          "type": "string"
        },
        "worktime_lta": {
          "type": "string"
        },
        "worktime_worknumber": {
          "format": "int32",
          "type": "integer"
        },
        "job_id": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "LemonRest.Models.Response.ListResponse[LemonRest.Models.Proxy.WorktimeRecord]": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Proxy.WorktimeRecord"
          }
        },
        "result_count": {
          "format": "int32",
          "type": "integer"
        },
        "has_errors": {
          "type": "boolean"
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LemonRest.Models.Error"
          }
        }
      }
    },
    "LemonRest.Models.Proxy.WorktimePatchRecord": {
      "description": "Partial worktimes update via PATCH. Only non-null members are applied.\r\nKeep in sync with KellokorttiWebApi/Models/LemonsoftREST/LemonsoftWorktimePatchDto.cs.",
      "type": "object",
      "properties": {
        "worktime_id": {
          "format": "int32",
          "type": "integer"
        },
        "person_number": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_date": {
          "format": "date-time",
          "type": "string"
        },
        "worktime_enddate": {
          "format": "date-time",
          "type": "string"
        },
        "worktime_date_utc": {
          "format": "date-time",
          "type": "string"
        },
        "worktime_enddate_utc": {
          "format": "date-time",
          "type": "string"
        },
        "worktime_hours": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_lunchcutback": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_state": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_invoice_bit": {
          "type": "boolean"
        },
        "worktime_description": {
          "type": "string"
        },
        "formofsalary_number": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_reason": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_workshift": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_event_type_id": {
          "format": "int32",
          "type": "integer"
        },
        "project_number": {
          "format": "int32",
          "type": "integer"
        },
        "project_phase_id": {
          "format": "int32",
          "type": "integer"
        },
        "customer_number": {
          "format": "int32",
          "type": "integer"
        },
        "worktime_costcenter": {
          "type": "string"
        },
        "worktime_lta": {
          "type": "string"
        },
        "worktime_worknumber": {
          "format": "int32",
          "type": "integer"
        },
        "job_id": {
          "format": "int32",
          "type": "integer"
        }
      }
    }
  },
  "securityDefinitions": {
    "Session-Id": {
      "type": "apiKey",
      "description": "API Key Authentication",
      "name": "Session-Id",
      "in": "header"
    }
  },
  "tags": [
    {
      "name": "Accounting",
      "description": "",
      "x-displayName": "Accounting",
      "x-description": ""
    },
    {
      "name": "Agent",
      "description": "",
      "x-displayName": "Agent",
      "x-description": ""
    },
    {
      "name": "Async",
      "description": "",
      "x-displayName": "Async",
      "x-description": ""
    },
    {
      "name": "Authentication",
      "description": "",
      "x-displayName": "Authentication",
      "x-description": "The Authentication controller handles login and session management for the Lemonsoft REST API.\r\n\r\n### Authentication flow\r\n\r\n1. **Log in** by calling POST /api/auth/login with your username, password, database, and API key\r\n2. **Receive a session_id** in the response — this is your access token for all other endpoints\r\n3. **Include the session_id** in the `Session-Id` header of every subsequent API request\r\n4. **Monitor expiration** — the login response includes an expire_time (UTC) indicating when the session will expire\r\n5. **Renew before expiration** by calling POST /api/auth/renew with the same credentials to get a fresh session\r\n\r\n### Session management\r\n\r\n- Use GET /api/auth/alive to check if your current session is still valid\r\n- Sessions expire automatically — the expire_time field tells you exactly when\r\n- After expiration, the API returns HTTP 401 on all requests until you re-authenticate\r\n- There is no explicit logout endpoint — sessions expire naturally\r\n\r\n### Token-based login\r\n\r\nFor integrations that already have a valid authentication token (e.g., from Azure AD B2C), use POST /api/auth/login/token to exchange it for a REST API session without providing a username and password.\r\n"
    },
    {
      "name": "Automations",
      "description": "",
      "x-displayName": "Automations",
      "x-description": ""
    },
    {
      "name": "Campaign",
      "description": "",
      "x-displayName": "Campaign",
      "x-description": "The Campaign controller provides endpoints for managing campaigns (kohderyhmät) in Lemonsoft ERP.\r\n\r\nA campaign consists of header data, a list of contacts (target customers), associated products, custom attributes, and links to projects. Campaigns are used to organize marketing activities, events, and targeted customer outreach.\r\n\r\n### Campaign structure\r\n\r\n- **Contacts** — target customers and contact persons with tracking for whether they have been reached, whether a deal was made, and whether they have been invoiced\r\n- **Products** — products offered in the campaign with campaign-specific pricing\r\n- **Attributes** — custom boolean attributes that can be toggled per campaign\r\n- **Project links** — campaigns can be linked to one or more projects\r\n\r\n### Managing contacts and products\r\n\r\nWhen creating a campaign (POST), contacts and products can be included directly in the request body. When updating a campaign (PUT), only existing contacts and products are updated — use the dedicated POST /api/campaigns/contact and POST /api/campaigns/product endpoints to add new ones. Contacts and products can be removed with the DELETE /api/campaigns/contact and DELETE /api/campaigns/product endpoints.\r\n"
    },
    {
      "name": "Codelist",
      "description": "",
      "x-displayName": "Codelist",
      "x-description": "The Codelist controller provides endpoints for retrieving standardized code values (koodilistat) used across the Lemonsoft ERP system.\r\n\r\nCodelists define the valid values for fields such as delivery methods, countries, customer classes, product colors, and many more. Other API endpoints reference these codelist values — for example, a customer's `delivery_method` field contains a value from the DELIVERY_METHODS codelist.\r\n\r\n### Retrieving codelist values\r\n\r\nUse GET /api/codelist/description with the `CodeListFilter` parameter to retrieve a specific codelist type. Set CodeListFilter = CODELISTS (0) to get the full list of available types with their enum values.\r\n\r\n### Response model by type\r\n\r\nMost codelist types return entries with Id, Description, and a numeric CodeId. Some types differ:\r\n\r\n- **BUSINESSCODES, COUNTRIES, PROJECTPHASES** — return a string Code instead of numeric CodeId\r\n- **DELIVERYPACKAGE_TYPES** — includes an additional PackageCode field\r\n- **PERSON_ABSENCE_REASONS** — includes an additional TransferMaterialCode field\r\n\r\n### Payment terms\r\n\r\nPayment terms have their own dedicated endpoint at GET /api/codelist/payment_term, which returns the full payment term definitions including discount tiers and cash flow settings.\r\n\r\n### Expense groups\r\n\r\nExpense groups (kululajit) can be created, updated, and deleted through dedicated endpoints. Deletion is a soft delete — the record is marked as deleted but not permanently removed.\r\n"
    },
    {
      "name": "Company",
      "description": "",
      "x-displayName": "Company",
      "x-description": "The Company controller provides endpoints for retrieving company information (yritystiedot) in Lemonsoft ERP.\r\n\r\nThe company record holds the basic identity data of the organization (name, VAT number, OVT, GLN) together with its locations (toimipaikat) and bank accounts (pankkitilit). All endpoints in this controller are read-only.\r\n\r\n### Company structure\r\n\r\nA company consists of:\r\n- **Header data** — name, VAT (Y-tunnus), unit, OVT, GLN\r\n- **Locations** — one or more physical locations, each with address, cost center, LTA, dispute period, and late payment interest\r\n- **Bank accounts** — accounts grouped by purpose (invoicing, electronic invoicing, payments)\r\n\r\n### Bank account types\r\n\r\nBank accounts are retrieved via `/api/company/accounts` using the `account_type` filter:\r\n\r\n- **Invoicing** — accounts printed on outgoing invoices (default)\r\n- **ElectronicInvoicing** — accounts used in e-invoice (Finvoice) messages\r\n- **Payments** — accounts used for outgoing payment transactions\r\n"
    },
    {
      "name": "Contact",
      "description": "",
      "x-displayName": "Contact",
      "x-description": "The Contact controller provides endpoints for managing customer contact persons (yhteyshenkilöt) in Lemonsoft ERP.\r\n\r\nA contact is always linked to a single customer and holds the person's basic details (name, title, department), address, communication information, and language. Contacts can also be tagged with customer contact attributes — entries from `CustomerContactAttributeSetting` that classify the contact for specific purposes, such as newsletter recipients or invoicing contacts.\r\n\r\nThe `customer_id` of a contact is set from the route when creating and cannot be changed afterwards. On update, the attributes in the payload replace the contact's current attribute set.\r\n"
    },
    {
      "name": "Customer",
      "description": "",
      "x-displayName": "Customer",
      "x-description": "The Customer controller provides endpoints for managing customers (asiakkaat) in Lemonsoft ERP. This is the largest controller in the API, covering customers, service agreements, bank accounts, CRM transactions, contact persons, texts, circulations, and customer groups.\r\n\r\nA customer record can represent a customer, supplier, prospect, or any combination of these roles, controlled by the `is_customer`, `is_supplier`, and `is_prospect` flags.\r\n\r\n### Customer structure\r\n\r\nA customer consists of:\r\n- **Header data** — name, address, invoicing details, payment terms, delivery settings\r\n- **Contacts** — contact persons with their own addresses, attributes, and language settings\r\n- **Agreements** — service/maintenance agreements with product lines, recurrence patterns, and leasing data\r\n- **Bank accounts** — domestic and foreign bank account details\r\n- **CRM transactions** — activities, tasks, and appointments with attributes and participants\r\n- **Texts** — numbered text entries (1–10)\r\n- **Circulations** — approval workflow entries (Inspector or Approver)\r\n- **Dimension** — classification data (area, chain, segment, ABC group, etc.)\r\n\r\n### Key behaviors\r\n\r\n- **Customer number** is preserved on update — it cannot be changed after creation\r\n- **Base endpoint** (`/base`) returns a lighter response without sub-collections\r\n"
    },
    {
      "name": "Edi",
      "description": "",
      "x-displayName": "Edi",
      "x-description": ""
    },
    {
      "name": "ExceptionDays",
      "description": "",
      "x-displayName": "ExceptionDays",
      "x-description": ""
    },
    {
      "name": "File",
      "description": "",
      "x-displayName": "File",
      "x-description": "The File controller provides endpoints for managing file attachments in Lemonsoft ERP, spanning several distinct storage flows.\r\n\r\nFiles can be stored in LemonFiles (Azure Blob Storage) or attached directly to Lemonsoft records as job images (työnkuvaliitteet), program images (ohjelmankuvat), or production work number images. Each flow has its own storage backend and lifecycle, but all share the same `application_id` convention (e.g. 1=Customer, 2=Product, 8=SalesOrder) to identify the source entity type.\r\n\r\nFor LemonFiles blobs, the controller offers both a proxy upload (where the file bytes pass through the API) and a direct-upload flow that issues a short-lived Azure SAS URI so the client can upload straight to blob storage and then notify the API on completion. Blob names returned by the listing endpoint are URL-escaped and must be Base64-encoded before being used as route parameters in the SAS URI and download endpoints.\r\n"
    },
    {
      "name": "Holidays",
      "description": "",
      "x-displayName": "Holidays",
      "x-description": ""
    },
    {
      "name": "Invoice",
      "description": "",
      "x-displayName": "Invoice",
      "x-description": "The Invoice controller provides endpoints for managing sales invoices (myyntilaskut) in Lemonsoft ERP.\r\n\r\nAn invoice consists of header data, one or more invoice rows (line items), payment entries, and optional external links. Invoices can be created manually or generated directly from an existing sales order.\r\n\r\n### Invoice lifecycle\r\n\r\nAn invoice progresses through the following states automatically:\r\n\r\n**KIRJATTU** → **HYVÄKSYTTY** → **LASKUTETTU** → **ERÄÄNTYNYT** / **SUORITETTU**\r\n\r\nThe state is calculated in real time based on approval status, whether the invoice has been sent, the due date, and recorded payments. A fully paid invoice (open total = 0) is always marked as **SUORITETTU** regardless of other flags.\r\n\r\n### Three customer roles\r\n\r\nEach invoice can have up to three separate customer roles, each with their own address and contact data:\r\n\r\n- **Invoicing customer** (`customer_number`) — the party that receives and pays the invoice\r\n- **Delivery customer** (`delivery_customer_number`) — the party that receives the goods or services\r\n- **Orderer customer** (`orderer_customer_number`) — the party that placed the order\r\n\r\nThese can all be the same customer or three different ones depending on the business scenario.\r\n"
    },
    {
      "name": "Log",
      "description": "",
      "x-displayName": "Log",
      "x-description": "The Log controller provides endpoints for querying the audit log of deleted objects (poistolokit) across Lemonsoft ERP.\r\n\r\nThe log is partitioned by domain — customers, products, sales orders, work-time entries, and so on — selected via the `logType` query parameter. Two views are available: a lightweight ID-only listing for synchronisation scenarios, and a richer view that returns each deletion event with its timestamp, description, and supplementary context fields.\r\n\r\nWhen `startDate` and `endDate` are omitted, queries default to the past year. The `Worktime` (253) log type is sourced from a dedicated worktime history table; all other types share a common log record store.\r\n"
    },
    {
      "name": "Message",
      "description": "",
      "x-displayName": "Message",
      "x-description": ""
    },
    {
      "name": "NumberSeries",
      "description": "",
      "x-displayName": "NumberSeries",
      "x-description": "The NumberSeries controller provides a single endpoint for retrieving number series (numerosarjat) used in Lemonsoft ERP.\r\n\r\nNumber series assign sequential numbers to invoices, purchase invoices, products, and projects. Each number series belongs to one of four categories — Invoice, PurchaseInvoice, Product, or Project — and is sourced from a different Lemonsoft library depending on the category. The category is selected via the required `NumberSeries` filter parameter.\r\n"
    },
    {
      "name": "Offer",
      "description": "",
      "x-displayName": "Offer",
      "x-description": "The Offer controller provides endpoints for managing offers (tarjoukset) in Lemonsoft ERP.\r\n\r\nAn offer consists of header data, one or more rows (line items), external links, and a sales-phase position within a sales phase collection. Offers are versioned — each save increments the version string, and the previous versions remain accessible via the `version` query parameter on the `GET /{offerNumber}` endpoint.\r\n\r\n### Offer states\r\n\r\nAn offer is in one of four states at any time:\r\n\r\n**Open (kesken, 0)** → **Waiting (odottaa, 1)** / **Lost (menetetty, 2)** / **Won (kauppa, 3)**\r\n\r\nState is reflected by the `won_bit`, `lost_bit`, and `wait_bit` flags together with the matching `won_date`, `lost_date`, and `wait_date`. When the offer's state has been set, the matching `won_why` / `lost_why` / `wait_why` free-text field records the reason.\r\n\r\n### Offer structure\r\n\r\nAn offer consists of:\r\n- **Header data** — dates, sales phase, currency, payment term, delivery method, three customer roles (invoicing, delivery, orderer)\r\n- **Rows** — offer rows with product data, quantities, prices, discounts; can be managed individually (`/offerrows`) or in bulk (`/offerrowlist`)\r\n- **Links** — external links attached to the offer\r\n- **Sales phase** — the current phase within a sales phase collection\r\n\r\n### Key behaviors\r\n\r\n- **`PUT /offers` only updates existing rows** — to add new rows use POST `/{offerNumber}/offerrows` or `/offerrowlist`; to remove rows use the DELETE variants\r\n- **`productdata_from_payload` on rows** — when `false`, product data is resolved from the product registry by product_code and quantity; when `true` (default), the payload values are used as-is\r\n- **Versioning** — by default the list endpoint returns only the newest version of each offer; set `include_old_versions=true` to include all versions. Note that the `state` and `action_date_before/after` filters have no effect when querying old versions\r\n"
    },
    {
      "name": "Order",
      "description": "",
      "x-displayName": "Order",
      "x-description": ""
    },
    {
      "name": "Pallet",
      "description": "",
      "x-displayName": "Pallet",
      "x-description": "The Pallet controller provides endpoints for managing product stock pallets (tuotevarastolavat) and converting them into sales order delivery pallets (toimituslavat) in Lemonsoft ERP.\r\n\r\nA product stock pallet holds one or more rows describing the products and amounts on the pallet, may have child pallets, and lives at a specific stock (varasto) and shelf (hylly). Pallets are identified by two ids: `id` (the unique row id of the stock pallet) and `pallet_id` (a shared identifier that follows the pallet across stock, purchase order, and sales order contexts). Most lookup endpoints accept the `pallet_id` form via the `/main/{mainId}` route.\r\n\r\n### Key behaviors\r\n\r\n- **Inward / Outward transactions** — pallet movements are recorded by `POST /product/stockpallet/transaction` with `direction = 1` (Outward) or `2` (Inward). The endpoint processes every row, including child pallets, and supports both new and existing stock transaction batches.\r\n- **Transfers** — `POST /product/stockpallet/transfer` is a convenience operation that records an Outward transaction on the source and an Inward transaction on the destination in a single call.\r\n- **Conversions** — stock pallets can be created from a purchase order delivery pallet (`POST /product/stockpallet/{id}/frompurchaseorder`) and converted into a sales order delivery pallet (`PUT /product/stockpallet/tosalesorder` or `POST /salesorder/deliverypallet/fromstock`). Conversion to a sales order pallet is recursive across child pallets, and only rows whose product is on the target order are copied.\r\n"
    },
    {
      "name": "Person",
      "description": "",
      "x-displayName": "Person",
      "x-description": "The Person controller provides endpoints for managing persons (henkilöt) in Lemonsoft ERP and the surrounding HR / worktime data that lives on a person.\r\n\r\nA person is the central record for any human in the system — employees, subcontractors, contact persons. Beyond basic identity (name, contact info, language), a person carries employment data, payroll configuration, and a large set of related entries that are managed via dedicated sub-routes.\r\n\r\n### Person sub-resources\r\n\r\n- **Jobs** (`/jobs/...`) — assigned work items with a lifecycle of `start` → `pause` → `done`. Workers can be assigned and removed; planned start/end dates can be adjusted.\r\n- **Worktimes** (`/worktimes/...`) — recorded hours with materials, additions, and regulation-based rules\r\n- **Absences** (`/absences/...`) — vacation, sick leave, and other leaves with their own approval state. The `calculate` endpoint previews duration without persisting.\r\n- **eReceipts** (`/{person_number}/ereceipts`) — digital receipts that can be forwarded to purchase invoicing\r\n- **Planned shifts** (`/plannedshifts`) — shift planning rows\r\n- **Flex info** (`/{person_number}/flexinfo`) — current flex hour balance (liukumasaldo)\r\n- **Travel info** (`/{person_number}/travelinfo`) — accumulated kilometers and per-diem allowances\r\n\r\n### Key behaviors\r\n\r\n- **`hide_models` filter** — model persons (placeholder rows used by shift planning) are returned by default. Set `hide_models=true` to exclude them.\r\n- **Worktime form-of-salary resolution** — when posting worktimes via the `jobs/workday` or `jobs/daysummary` endpoints, the form of salary is resolved from the person's configuration. The `worktimefossummary` endpoint surfaces the resulting per-form summary.\r\n- **Kellokortti synchronization** — the `synchronizefromkellokortti` endpoint accepts a bulk payload of persons, groups and workshifts originating from the external Kellokortti time tracking system.\r\n"
    },
    {
      "name": "Pricelist",
      "description": "",
      "x-displayName": "Pricelist",
      "x-description": "The Pricelist controller provides endpoints for managing pricelists (hinnastot) in Lemonsoft ERP.\r\n\r\nA pricelist defines product pricing for a selected set of customers, products, product groups, suppliers, customer groups and projects. Each pricelist has header settings (type, default price, default discounts, tax handling, currency, validity dates) and six sub-collections that can be edited independently via the dedicated `POST` and `DELETE` routes (`/customers`, `/products`, `/product_groups`, `/cust_group_discounts`, `/supplier_discounts`, `/projects`).\r\n\r\n### Key behaviors\r\n\r\n- **`PUT /pricelists` only updates existing rows** — to add new entries to any sub-collection, use the dedicated `POST` endpoint. The pricelist number is also immutable after creation.\r\n- **Price lookup** — `GET /pricelists/{id}/{product_code}` computes the effective price (with discounts and tax) for a single product. Passing `id = 0` resolves the best applicable pricelist for the supplied customer, unit, and valid date.\r\n- **`get_ids` enrichment** — on the list endpoint, set `get_ids=true` to include the underlying customer and product register ids for each pricelist entry.\r\n"
    },
    {
      "name": "Product",
      "description": "",
      "x-displayName": "Product",
      "x-description": ""
    },
    {
      "name": "Production",
      "description": "",
      "x-displayName": "Production",
      "x-description": "The Production controller provides endpoints for managing production work stages (työvaiheet) in Lemonsoft ERP.\r\n\r\nA production work number is split into a single main work stage (päätyövaihe) and one or more sub work stages (alatyövaiheet). The main work stage represents the finished product, while each sub work stage represents one production step (machining, assembly, inspection, subcontracting) with its own materials, tools, machine and assigned person.\r\n\r\n### Sub work stage lifecycle\r\n\r\nA sub work stage progresses through the following states as workers act on it:\r\n\r\n**Open (avoin)** → **Started (aloitettu)** → **Paused (tauolla)** → **Started** → **Done (valmis)**\r\n\r\nThe transitions are driven by the `start_job`, `pause_job`, and completion entry / `end_job` endpoints. The main work stage's `procent_completed` is recalculated from the underlying sub work stages.\r\n\r\n### Key behaviors\r\n\r\n- **Completion entry vs. end_job** — `completion_entry` is the modern endpoint that records produced amount, failed amount, materials, batches, serials, and standard inspections in a single payload. The legacy `end_job` endpoint covers the same purpose with a different payload shape.\r\n- **Materials picking** — `POST /main_ws/{id}/picking` updates existing material rows; `PUT /main_ws/{worknumber}/picking` adds new material rows for materials not originally on the structure.\r\n- **Compilation jobs** — work numbers can be compilation jobs (`koontityö`) that aggregate amounts across several sub-jobs; `compilation_amounts` on the completion entry payload describes the per-row produced amounts.\r\n- **Bad production** — failed amounts are reported via the `bad_production` endpoint or on the completion entry's `failed_amount` field, both with fail codes (hylkäyssyyt).\r\n- **Serial numbers** — the `/main_ws/{id}/serials/{amount}` endpoint allocates new serial numbers from the configured number series; consume these in the completion entry's `serials` array.\r\n"
    },
    {
      "name": "Project",
      "description": "",
      "x-displayName": "Project",
      "x-description": "The Project controller provides endpoints for managing projects (projektit) in Lemonsoft ERP.\r\n\r\nA project consists of header data, one or more phases (vaiheet), internal and customer-side contacts, optional invoicing-customer splits, a worksite (työmaa), and external links. Project numbers are allocated per project type from the project number series — see /api/NumberSeries.\r\n\r\n### Project structure\r\n\r\n- **Header** — descriptions, dates, state, type, owner, manager, seller, team, cost center, contract and invoicing type, and totals (offered, ordered, invoiced, purchase costs, payroll, work costs, profits)\r\n- **Phases (`project_phases`)** — sub-parts of the project with their own state, dates, planned vs. actual workhours/work/material, expenses, skills, and contacts\r\n- **Internal contacts (`project_contacts`)** — Lemonsoft persons assigned to the project, optionally as steering group members or reference persons, with attached skill profiles\r\n- **Customer contacts (`project_customer_contacts`)** — free-text contact entries not linked to the customer registry\r\n- **Invoicing customers (`project_customers`)** — per-customer invoicing splits with percentage shares (used when a project is invoiced to multiple customers)\r\n- **Worksite (`site`)** — the worksite (työmaa) the project is performed on, with its own address and contact details\r\n- **Links (`links`)** — external references attached to the project; only populated when `get_links` = true\r\n\r\n### Key behaviors\r\n\r\n- **State transitions** are applied automatically. If the payload's `project_state` (or a phase's `project_phase_state`) differs from the current state, the project/phase state manager transitions the entity rather than overwriting the field directly.\r\n- **POST** creates the project together with all child collections in a single call. **PUT** only updates existing child objects — to add new phases or links use the dedicated POST endpoints (`/api/projects/{n}/phase`, `/api/projects/{n}/phases`, `/api/projects/{n}/links`).\r\n- **Worksite handling** is opt-in: the worksite is only created or updated when `site.site_key` or `site.site_number` is non-empty.\r\n- **Phase expenses** are grouped by codelist (`expense_group_id`). Locked entries are skipped on update, and for salary entries (`expense_group_id` = 1) the system computes `expense_total` from `expense_amount × expense_unitprice` if not provided.\r\n- The list endpoint's `get_lists` and `get_links` flags control whether child collections and external links are populated in the response — set both to false for lightweight header-only listings.\r\n"
    },
    {
      "name": "PurchaseInvoice",
      "description": "",
      "x-displayName": "PurchaseInvoice",
      "x-description": "The PurchaseInvoice controller provides endpoints for managing purchase invoices (ostolaskut) in Lemonsoft ERP.\r\n\r\nA purchase invoice consists of header data, one or more invoice rows (line items), payment entries, and circulation entries for the inspection and approval workflow. Attachments (PDF, images) can be uploaded and retrieved as ZIP files.\r\n\r\n### Purchase invoice lifecycle\r\n\r\nA purchase invoice progresses through the following states:\r\n\r\n**Kirjattu** (0) → **Kierrossa** (4) → **Hyväksytty** (1) → **Maksussa** (2) → **Maksettu** (3)\r\n\r\nAn invoice can also be **Hylätty** (5) if rejected during circulation.\r\n\r\n### Circulation workflow\r\n\r\nPurchase invoices support an inspection and approval workflow (kierrätys). Each circulation entry has:\r\n\r\n- **Role**: Inspector (0), Approver (1), or Informative (2)\r\n- **State**: Waiting (0), Approved (1), or Rejected (2)\r\n- **Person**: The person assigned to handle the circulation step\r\n\r\nThe `circulation_ready` flag on the invoice indicates whether it is ready to enter the circulation workflow.\r\n"
    },
    {
      "name": "PurchaseOrder",
      "description": "",
      "x-displayName": "PurchaseOrder",
      "x-description": "The PurchaseOrder controller provides endpoints for managing purchase orders (ostotilaukset) in Lemonsoft ERP.\r\n\r\nA purchase order consists of header data, one or more order rows (line items), optional delivery info entries, optional delivery pallets, and optional external links. Purchase orders can be created from scratch or copied from an existing template order via `copy_from_order`.\r\n\r\n### Supplier data handling\r\n\r\nThe `customerdata_from_payload` flag controls whether the supplier and delivery customer fields on the header are taken from the request payload or resolved from the customer registry. When set to `false`, the system looks up the customer records by `customer_number` (supplier) and `delivery_customer_number` (delivery customer) and overwrites the payload values.\r\n\r\n### Row delivery handling\r\n\r\nOrder rows support delivered amounts, serial numbers, batch numbers, sizes (`row_sizes`), and shelf lists. When a row's `delivered` value is greater than zero, the system creates a delivery info record and writes a delivery stock transaction automatically. Rows that already have batch numbers or serials have their shelf list rebuilt from the row's `shelf` field. JT/post-delivery (`jt`) is forced to false when the company setting disallows it.\r\n\r\n### autofill_product\r\n\r\nSetting `autofill_product` on a row resolves product-related fields (price, tax rate, account, cost center, LTA, discounts, sizes) from the customer/product registry and applies them to the row. Any non-empty fields provided in the payload still override the resolved values.\r\n\r\n### Delivery rows and delivery info\r\n\r\nDelivery rows (`delivery_rows`) and delivery info entries (`deliveryinfo`) are exposed as separate paged endpoints. Each delivery row represents one delivery transaction against a purchase order row; each delivery info groups delivery metadata (date, consignment, forwarder, package count) for one delivery event.\r\n"
    },
    {
      "name": "Salary",
      "description": "",
      "x-displayName": "Salary",
      "x-description": "The Salary controller provides read-only endpoints for querying salaries (palkat), forms of salary (palkkalajit), and form of salary attributes in Lemonsoft ERP.\r\n\r\nA salary consists of header data (gross totals, benefits, deductions, withholding tax, employee insurance contributions, tax card information) and one or more salary rows. Each row references a form of salary, which defines how the row is taxed, accounted for, and calculated.\r\n\r\n### Access rules\r\n\r\nA user can always fetch their own salary data without additional rights. Fetching another person's data has stricter requirements:\r\n\r\n- `/salaries` and `/cumulative` require a **WPL** or **OPL** license.\r\n- `/salaries` additionally requires the **Payroll** role (palkanlaskija).\r\n\r\nRequests that fail these checks return a 403 error in the response body.\r\n\r\n### Project salaries\r\n\r\n`/project/{project_number}` aggregates salary rows booked on a project, grouped by payment date and form of salary. The date range is optional and defaults to the past year ending at the current date.\r\n"
    },
    {
      "name": "Settings",
      "description": "",
      "x-displayName": "Settings",
      "x-description": ""
    },
    {
      "name": "StateMachine",
      "description": "",
      "x-displayName": "StateMachine",
      "x-description": ""
    },
    {
      "name": "Stock",
      "description": "",
      "x-displayName": "Stock",
      "x-description": "The Stock controller provides read-only endpoints for product stock balances and stock delivery events (varasto) in Lemonsoft ERP.\r\n\r\nTwo views are exposed: a near-real-time list of product stock saldo changes for incremental polling, and a paged list of upcoming and historical stock deliveries — events where material moves into or out of a stock location, originating from sales orders, purchase orders, or production.\r\n\r\n### Key behaviors\r\n\r\n- **10-minute polling window:** The stock balance list (`GET /api/stocks`) restricts the time window between `modified_after` and `modified_before` to a maximum of 10 minutes. If a wider window is requested, `modified_after` is silently moved forward so the window ends at `modified_before` and spans exactly 10 minutes. The endpoint is intended for incremental synchronization, not bulk historical export.\r\n- **Source document inferred from `delivery_type`:** Each stock delivery row carries one of three order-number fields populated according to its `delivery_type`: `sales_order_number` (when `delivery_type` = 1), `purchase_order_number` (when `delivery_type` = 2), or `worknumber` (when `delivery_type` = 3 or 4). The other two fields stay at their default. Consumers should branch on `delivery_type` when resolving the underlying source document.\r\n- **Confirmation state:** `delivery_confirmed_at` is `null` until the delivery has been confirmed in Lemonsoft; downstream systems can use it to distinguish planned from realized stock movements.\r\n"
    },
    {
      "name": "Substitutes",
      "description": "",
      "x-displayName": "Substitutes",
      "x-description": ""
    },
    {
      "name": "TravelExpense",
      "description": "",
      "x-displayName": "TravelExpense",
      "x-description": "The TravelExpense controller provides endpoints for managing travel expenses (matkalaskut) and mobile travels (mobiilimatkat) in Lemonsoft ERP.\r\n\r\nA travel expense consists of a header (person, date, description, currency, payment state) and one or more rows. Each row represents a single trip leg with its vehicle, route, kilometers, country, passengers, and the resulting daily, kilometer and passenger compensations. There are three different create flows: `POST /api/travelexpenses` takes a flat list of trip rows, `POST /api/travelexpenses/summary` takes a summary header with embedded rows, and `POST /api/travelexpenses/raw` writes a raw header + rows payload verbatim without any automatic calculation.\r\n\r\nWhen `calculate_allowance` is true on a row (or summary row), daily allowances, kilometer compensation and passenger compensation are calculated automatically from the travel times, country, kilometers and the company's travel regulations. Free meals reduce the allowance for the affected day; `first_day_free_meals` controls this for the first travel day. If the company setting `AUTO_CIRCULATION` is enabled, newly created travel expenses are automatically marked ready for circulation.\r\n\r\n### Mobile travels\r\n\r\nMobile travels are a separate domain accessed under `/api/travelexpenses/travels`. They represent trips recorded via the Lemonsoft mobile app, typically with one or more GPS-tracked route legs (start/end coordinates and addresses). A mobile travel can later be converted into a regular travel expense; the `travel_expense_id` field links the two. All mobile-travel endpoints are scoped to the logged-in user — a user can only read, create, update or delete their own mobile travels and route legs. Trip and route timestamps are normalized to the server's local time zone on create and update.\r\n"
    },
    {
      "name": "UiControlCustomizations",
      "description": "",
      "x-displayName": "UiControlCustomizations",
      "x-description": ""
    },
    {
      "name": "V1Authentication",
      "description": "",
      "x-displayName": "V1Authentication",
      "x-description": ""
    },
    {
      "name": "WorktimeRegulations",
      "description": "",
      "x-displayName": "WorktimeRegulations",
      "x-description": ""
    },
    {
      "name": "Worktimes",
      "description": "",
      "x-displayName": "Worktimes",
      "x-description": ""
    }
  ]
}