{
  "openapi": "3.0.4",
  "info": {
    "title": "Fluit Public API",
    "description": "REST API for integrating external systems with Fluit ERP: webshops, WMS, EDI,\nBI tools and custom integrations. The API is scoped to a single tenant (your company) —\nthe API key determines which company's data you read and write.\n\n# Getting started\n\n1. Create an API key in Fluit under **Settings → API keys**. The key is shown once —\n   store it securely. Keys are prefixed `fluit_live_sk_` (production) or `fluit_test_sk_` (test).\n2. Call the API with the key in the `X-Api-Key` header:\n\n```bash\ncurl https://api.erp.fluit.cloud/preview/items?pageSize=5 \\\n  -H \"X-Api-Key: fluit_live_sk_...\"\n```\n\n3. Create your first order (note the required `Idempotency-Key` on POST):\n\n```bash\ncurl -X POST https://api.erp.fluit.cloud/preview/orders \\\n  -H \"X-Api-Key: fluit_live_sk_...\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{ \"customerNumber\": \"CUST-001\", \"lines\": [ { \"itemNumber\": \"WIDGET-A\", \"quantity\": \"10\" } ] }'\n```\n\n# Conventions\n\n- **Business keys, not GUIDs.** Resources are addressed by their business keys, and `*Code`\n  is used for reference data (warehouses, payment terms, …). List the valid codes via the\n  Reference endpoints.\n\n  | Resource | Key in the URL |\n  | --- | --- |\n  | Customers | `customerNumber` |\n  | Items | `itemNumber` |\n  | Sales orders | `orderNumber`, lines by `lineNumber` |\n  | Suppliers | `supplierNumber` |\n  | Purchase orders | `orderNumber`, lines by `lineNumber` |\n\n  Sales orders and purchase orders live under different paths (`/orders` and\n  `/purchase-orders`), so an order number is only ever ambiguous across the two if you\n  reuse the same number series for both.\n- **Decimals are strings.** All monetary amounts and quantities are serialised as decimal\n  strings (`\"123.45\"`, invariant format) to avoid IEEE 754 floating-point errors.\n  Requests accept both strings and numbers; responses always return strings.\n  Check the item's `decimalPlaces` for how many decimals a quantity may have.\n- **Dates and times.** Dates are ISO 8601 (`2026-06-11`). Timestamps are UTC, but are\n  currently serialised **without a timezone designator** (`2026-06-09T22:07:47.7639194`,\n  no trailing `Z`). Most date parsers read that as *local* time — `new Date(...)` in\n  JavaScript and `datetime.fromisoformat(...)` in Python both produce a naive or\n  local-shifted value. Treat every response timestamp as UTC explicitly rather than\n  letting the parser guess. Request parameters do not have this problem: `modifiedSince`\n  accepts `Z`, a numeric offset or no designator and resolves all three to the same\n  instant.\n- **Fields are nullable unless the schema says otherwise.** This bites on fields that look\n  mandatory: `baseUnitCode` is null for items with no unit configured, `salesPrice` is null\n  for items with no list price, and `modifiedDate` is null for records that have never been\n  changed since creation. When syncing on `modifiedDate`, fall back to `createdDate`.\n- **Enums are strings.** Status fields and similar are serialised as enum names\n  (`Placed`, `Shipped`, …) and documented per field. Enum values in query-string filters are\n  matched case-insensitively; an unknown value returns `400` rather than an empty result.\n  Treat enum values as open — new ones may be added without a version bump.\n- **Resources link to themselves.** Every resource carries `links.self`, the canonical URL of\n  the resource. `POST` responses return the same representation as the corresponding `GET`,\n  with the URL in the `Location` header as well.\n- **PATCH is JSON Merge Patch.** Only fields present in the body are updated.\n  Pass `null` to clear a nullable field; omitted fields are left unchanged.\n  Unknown fields are silently ignored.\n- **Country codes** are ISO 3166-1 alpha-2 (`SE`), **currency codes** ISO 4217 (`SEK`).\n\n# Prices and stock\n\nTwo fields on the item representation are routinely mistaken for something they are not.\nBoth mistakes are silent — you get a plausible number, not an error.\n\n- **`salesPrice` is the item's list price, not the price anyone pays.** It ignores price\n  lists, customer agreements, campaigns and volume breaks. Call\n  `GET /preview/items/{itemNumber}/price` to get the price an order line would actually\n  receive, with `?customerNumber=` for customer-specific pricing and `?quantity=` for\n  volume tiers. The two commonly differ by double-digit percentages. Use `salesPrice`\n  only where you genuinely want an uncontracted reference price.\n- **The item list carries no stock.** `GET /preview/items` returns no quantity at all;\n  availability lives on `GET /preview/items/{itemNumber}/availability`, one call per item.\n  There is no bulk availability endpoint, so a catalogue sync with stock costs\n  1 + N requests against the per-minute quota. Fetch availability only for the items you\n  are about to display or order, rather than walking the whole catalogue, and remember\n  `availableQuantity` (on hand minus reservations) is the number you can promise —\n  not `quantityOnHand`.\n\n# Calling from a browser\n\nThe API sends `Access-Control-Allow-Origin: *` and allows `x-api-key` in the preflight,\nso a browser page can call `/preview` directly with no proxy. That is deliberate, and it\nsuits internal tools and prototypes.\n\nIt does not make the key safe in client code. Anything in a page's JavaScript is readable\nby every visitor, and a leaked key grants full access to the tenant's data. For anything\nuser-facing, keep the key on a server you control and let the browser talk to that server\ninstead — or have each user supply their own key at runtime.\n\n# Flows\n\n## Purchasing: order and receive goods\n\n1. `POST /preview/purchase-orders` with `supplierNumber` and lines. The order is created in\n   `Draft` and nothing is sent to the supplier yet. Omit `unitPrice` to use the supplier\n   price list, and `unit` to use the item's base unit.\n2. `POST /preview/purchase-orders/{orderNumber}/send` moves it to `Sent`. By default this\n   only records that the order went out — pass `{\"sendEmail\": true}` if you want Fluit to\n   email the PDF to the supplier rather than sending it yourself over EDI.\n3. `POST /preview/purchase-orders/{orderNumber}/confirm` when the supplier confirms. If they\n   came back with different quantities or dates, `PATCH` the affected lines first.\n4. `POST /preview/purchase-orders/{orderNumber}/lines/{lineNumber}/receive` as goods arrive.\n   Each call books stock, creates an inventory transaction and advances the line and order\n   to `PartiallyReceived` and then `Received`. Call it once per delivery for partial\n   deliveries.\n5. `POST /preview/purchase-orders/{orderNumber}/close` if the supplier will not deliver the\n   remainder — that settles the order without waiting for the outstanding quantity.\n\nReceiving is not reversible through this API, so retries matter: a repeated call with the\nsame `Idempotency-Key` replays the original response instead of booking the goods twice.\n\n## Configurator: sell a made-to-measure product\n\nSome items are not picked off a shelf — they are built to the customer's measurements and\nchoices. Curtains, blinds and awnings are the archetype: width and height drive the fabric\nconsumption, the fabric and the control type drive the price, and no two orders are alike.\nThese items are ordered through `/preview/configurations` rather than as a plain order line,\nso the choices survive into production.\n\n1. `GET /preview/items?isConfigurable=true` finds the items that have a configurator.\n2. `GET /preview/items/{itemNumber}/configuration` returns the whole form definition in one\n   call: the features, their input types and bounds, and the selectable options. Each\n   feature's `featureType` tells you which field to send back — `Number` → `number`,\n   `Selection` → `optionCode`, `Boolean` → `boolean`, `ItemSelection` → `itemNumber`,\n   `Text` → `text`. `Calculated` features take no input.\n3. `POST /preview/configurations/calculate` on every change while the customer configures.\n   It returns the price for the current choices plus `resolvedValues` — the derived numbers\n   such as area and fabric consumption, so you do not have to reimplement the formulas. An\n   incomplete configuration is a normal state, not an error: it comes back as `200` with\n   `isValid: false` and every problem listed in `validationErrors`, ready to show at the\n   right field. This is the one POST that does not require an `Idempotency-Key`.\n4. `POST /preview/configurations` once the customer is happy. The response carries a\n   `configurationNumber` — the business key for everything that follows — and the price.\n   `customerNumber` may be left out here and attached later, which is what a storefront that\n   configures before asking who the customer is needs.\n5. `POST /preview/configurations/{configurationNumber}/reconfigure` to change it later.\n   Every field is optional: omit `values` to keep the choices and change only the quantity,\n   pass `customerNumber` to claim an anonymous configuration. When `values` *is* present it\n   replaces the whole set. The response is the updated, repriced configuration.\n6. `POST /preview/configurations/{configurationNumber}/order` turns it into a sales order and\n   returns the order. Add freight or more lines through the order endpoints, then\n   `POST /preview/orders/{orderNumber}/place`. Behind the line, the configuration becomes a\n   work order carrying the exploded bill of materials and routing, so production knows what\n   to build.\n\nA configurator produces abandoned sessions: `DELETE /preview/configurations/{configurationNumber}`\ndiscards one that was never ordered. A configuration that has become an order is frozen —\nreconfiguring or deleting it returns `409`, and it disappears from\n`GET /preview/configurations` without leaving a tombstone, so store the `orderNumber` from\nthe /order response if you keep local copies.\n\n### Pricing a configuration\n\nThe price is the item's own price from the price hierarchy (customer price lists,\nagreements, campaigns, volume breaks) plus the configuration surcharge. Three things are\nworth knowing before you build against it:\n\n- **It is a live price, not a locked quote.** Both `calculate` and the order conversion run\n  the price engine at the moment they are called, so a campaign that starts or expires in\n  between moves the price. The order always uses the customer's currency; a `currencyCode`\n  passed to `calculate` affects that calculation only.\n- **Automatic customer discounts do not apply.** The composed price is set as a manual unit\n  price on the line, which bypasses the discount engine. Price lists, agreements, campaigns\n  and volume breaks are already reflected in the base price.\n- **A choice that links an item does not change the price by itself.** When an option has a\n  `linkedItemNumber`, that item is added to the bill of materials as a cost line and the\n  option's `priceImpact` is deliberately ignored. To make a choice cost more, give it a\n  `priceImpact` without a linked item, or drive the price from a `Calculated` feature.\n\n# Pagination and syncing\n\nList endpoints are paginated with `?page=` (1-based) and `?pageSize=` (default 50, max 200)\nand respond with:\n\n```json\n{ \"items\": [], \"totalCount\": 0, \"page\": 1, \"pageSize\": 50,\n  \"totalPages\": 0, \"hasPreviousPage\": false, \"hasNextPage\": false }\n```\n\nFor incremental sync, poll with `?modifiedSince=` (UTC ISO 8601): store the timestamp at\nwhich you started the previous sync and pass it on the next run. Both created and modified\nrecords are returned.\n\n# Idempotency\n\nAll POST requests require an `Idempotency-Key` header — a unique value (UUID recommended,\nmax 255 characters) per logical attempt. The one exception is\n`POST /preview/configurations/calculate`, which has no side effects and is a POST only\nbecause its input does not fit in a URL:\n\n- **Retrying with the same key and body** returns the original response unchanged\n  (marked with the `Idempotency-Replayed: true` header) instead of e.g. creating\n  a duplicate order after a network timeout.\n- **Reusing a key** for a different endpoint or body returns `422 Unprocessable Entity`\n  with `code: \"idempotencyKey.conflict\"`.\n- **Concurrent requests** with the same key are serialised; if the first is still running\n  after 30 s the second receives `503` with a `Retry-After` header.\n- Stored responses expire after **24 hours**.\n\nGenerate a new key for every new logical request; reuse the key only when retrying\nthe same request.\n\n# Errors\n\nErrors follow RFC 7807 (`application/problem+json`):\n\n```json\n{\n  \"type\": \"https://tools.ietf.org/html/rfc7231#section-6.5.1\",\n  \"title\": \"customerNumber\",\n  \"detail\": \"Customer 'CUST-999' not found.\",\n  \"status\": 400\n}\n```\n\n| Status | Meaning |\n| ------ | ------- |\n| 400 | Validation error — an unknown business key, an invalid request body field, or an unknown enum value in a query filter |\n| 401 | Missing or invalid API key |\n| 403 | The API key is valid but not permitted to perform the operation |\n| 404 | The resource in the URL does not exist |\n| 409 | The operation conflicts with the resource's state (e.g. cancelling a shipped order) |\n| 413 | `POST` body larger than 1 MB, when the request declares a `Content-Length` |\n| 422 | Idempotency-Key reused for a different request |\n| 429 | Rate limit exceeded — back off per the `Retry-After` header |\n| 500 | Unexpected server error. Safe to retry with the same `Idempotency-Key` — server errors are never replayed from cache |\n\nField-level problems are listed in the `errors` extension array, one entry per violation with a\n`code` (the field or business rule) and a `description`. Request body constraints published in\nthis document — required fields, maximum lengths, patterns and ranges — are enforced; a violation\nreturns `400` with the offending field in `errors`. Nested fields use a dotted path,\ne.g. `lines[0].discountPercent`.\n\nTwo cases fall outside this shape and return a plain `400` without a problem+json body:\na request body that is not well-formed JSON, and a query parameter other than an enum filter\n(`page`, `pageSize`, `quantity`, dates and `modifiedSince`) that cannot be parsed into its\ndeclared type. Enum filters such as `?status=` are parsed by the API itself and do produce\nthe `errors` array.\n\n# Rate limiting\n\nRequests are limited to **1000 per minute per API key** (fixed window). `429` responses\ncarry `Retry-After` in seconds — honour it rather than retrying on a fixed delay.\n\nWhere the quota headers `X-RateLimit-Limit`, `X-RateLimit-Remaining` and\n`X-RateLimit-Reset` are present they describe the current window, but they are not\nemitted on every deployment. Treat them as advisory: read them when they are there,\nand never make your backoff conditional on finding them. Code that only slows down once\n`X-RateLimit-Remaining` gets low will otherwise run flat out into a `429`.\n\n# Preview status\n\nThe API is mounted under `/preview` and is in preview: the schema can change without\nnotice until the stable `/v1` release. Breaking changes are listed in the changelog.\nQuestions or access requests: [info@fluit.se](mailto:info@fluit.se).",
    "contact": {
      "name": "Fluit",
      "url": "https://fluit.se",
      "email": "info@fluit.se"
    },
    "version": "preview"
  },
  "servers": [
    {
      "url": "https://api.erp.fluit.cloud",
      "description": "Production"
    }
  ],
  "paths": {
    "/preview/configurations/calculate": {
      "post": {
        "tags": [
          "Configurations"
        ],
        "summary": "Price and validate a configuration",
        "description": "Runs the configuration through the same engine and the same price hierarchy a real order uses, without saving anything. Call it on every change while the customer configures.\n\n**This is a live price, not a locked quote.** The order re-prices when the configuration is converted, so the same choices give the same `unitPrice` only while the underlying prices hold: a campaign that starts or expires in between, or an agreement that changes, moves the price. The order also always uses the customer's own currency — a `currencyCode` passed here affects the calculation only. Persisting an agreed price is not supported yet; treat a quoted price as valid for the moment it was calculated.\n\n**An incomplete configuration is not an error.** Missing required values, numbers outside `minValue`/`maxValue` and options that do not belong to their feature all come back as `200` with `isValid: false` and every problem listed in `validationErrors` (`featureCode`, `code`, `message`), so the app can show them at the right field. The price fields are null in that case. Only structural problems — unknown `itemNumber`, `customerNumber`, `featureCode` or `optionCode` — return `400`.\n\n`resolvedValues` carries the derived numbers (area, fabric consumption, …) computed from `Calculated` features, so the app does not have to reimplement the formulas.\n\nPass `?includeBreakdown=true` to also get `components[]` (the exploded bill of materials) and `operations[]` (the production steps). It is off by default — that is costing data, and a consumer-facing configurator should not ship it to the browser.\n\n`unitPrice` excludes VAT, freight and order-level discounts. Note that a configured line is priced as a manual unit price, so automatic customer discounts (the discount engine) do not apply to it; price lists, agreements, campaigns and volume breaks do. A choice whose option carries a `linkedItemNumber` adds that item to the bill of materials but does **not** change `unitPrice` — see the note on `priceImpact` in the configuration schema.\n\nThis endpoint has no side effects and is the one POST under /preview that does **not** require an `Idempotency-Key` header.",
        "operationId": "Preview_CalculateConfiguration",
        "parameters": [
          {
            "name": "includeBreakdown",
            "in": "query",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateConfigurationRequest"
              },
              "examples": {
                "minimal": {
                  "summary": "Minimal — just the item and a quantity",
                  "value": {
                    "itemNumber": "CURTAIN-PLEAT",
                    "quantity": "1"
                  }
                },
                "full": {
                  "summary": "Full — a made-to-measure curtain for a specific customer",
                  "value": {
                    "itemNumber": "CURTAIN-PLEAT",
                    "quantity": "2",
                    "customerNumber": "CUST-001",
                    "currencyCode": "SEK",
                    "values": [
                      {
                        "featureCode": "WIDTH",
                        "number": "240"
                      },
                      {
                        "featureCode": "HEIGHT",
                        "number": "180"
                      },
                      {
                        "featureCode": "FABRIC",
                        "optionCode": "LINEN-NATURAL"
                      },
                      {
                        "featureCode": "LINING",
                        "boolean": true
                      },
                      {
                        "featureCode": "RAIL",
                        "itemNumber": "RAIL-3M"
                      },
                      {
                        "featureCode": "LABEL",
                        "text": "Living room, window 2"
                      }
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicConfigurationCalculationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/configurations": {
      "post": {
        "tags": [
          "Configurations"
        ],
        "summary": "Save a configuration",
        "description": "Persists a set of choices as a configuration and returns it with a `configurationNumber` — the business key for every follow-up call. Use this once the customer has settled on a configuration that POST /preview/configurations/calculate reports as valid; the calculate endpoint is for the live pricing while they are still choosing.\n\nThe configuration is validated on save: a missing required value, a number outside its bounds or an option that does not belong to its feature returns `400` with the error code in the `errors` array (`FeatureExplosion.RequiredFeatureMissing`, `FeatureExplosion.ValueOutOfRange`, `FeatureExplosion.InvalidOption`). Validate with calculate first to get all problems at once.\n\n`customerNumber` is optional here so an anonymous session can be saved and claimed later, but it must be set before POST /preview/configurations/{configurationNumber}/order will succeed. Add it afterwards by passing `customerNumber` to POST /preview/configurations/{configurationNumber}/reconfigure.\n\nThe response carries the priced configuration — `unitPrice` and `totalPrice` alongside the choices.\n\nRequires an `Idempotency-Key` header like every other POST — reuse the same key on a retry to get the original configuration back instead of creating a duplicate.",
        "operationId": "Preview_CreateConfiguration",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConfigurationRequest"
              },
              "examples": {
                "minimal": {
                  "summary": "Minimal — item and quantity only",
                  "value": {
                    "itemNumber": "CURTAIN-PLEAT",
                    "quantity": "1"
                  }
                },
                "full": {
                  "summary": "Full — a measured curtain for a named customer",
                  "value": {
                    "itemNumber": "CURTAIN-PLEAT",
                    "quantity": "2",
                    "customerNumber": "CUST-001",
                    "title": "Living room curtains",
                    "description": "Window 2, measured 2026-07-30",
                    "warehouseCode": "MAIN",
                    "values": [
                      {
                        "featureCode": "WIDTH",
                        "number": "240"
                      },
                      {
                        "featureCode": "HEIGHT",
                        "number": "180"
                      },
                      {
                        "featureCode": "FABRIC",
                        "optionCode": "LINEN-NATURAL"
                      },
                      {
                        "featureCode": "LINING",
                        "boolean": true
                      },
                      {
                        "featureCode": "RAIL",
                        "itemNumber": "RAIL-3M"
                      }
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "URL of the newly created resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicConfigurationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Configurations"
        ],
        "summary": "List saved configurations",
        "description": "Returns the configurations that have not yet become orders, oldest configuration number first.\n\nA configuration disappears from this list once POST /preview/configurations/{configurationNumber}/order has turned it into a sales order — from that point it is an order and is read through GET /preview/orders instead.\n\n**Removals are not visible here.** `?modifiedSince=` (ISO 8601 UTC) returns configurations created or changed since that instant, but one that has been ordered or deleted simply stops appearing — there is no tombstone, so a poller that only reads the delta keeps a stale copy forever. Record the `orderNumber` from the response to the /order call, and reconcile against GET /preview/orders or a full re-read when you need to retire local copies.\n\nOther filters: `?search=` matches configuration number, title and description (case-insensitive, partial); `?customerNumber=` and `?itemNumber=` are exact matches.\n\nThe price fields (`unitPrice`, `totalPrice`, …) are **null** in this list — pricing a whole page would mean one price engine run per row. Read a single configuration, or use POST /preview/configurations/calculate, when you need prices.\n\nPaginated response: `{ items, totalCount, page, pageSize, totalPages, hasPreviousPage, hasNextPage }`. `?page=` defaults to 1, `?pageSize=` to 50 and is capped at 200.",
        "operationId": "Preview_ListConfigurations",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerNumber",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemNumber",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "modifiedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicConfigurationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/configurations/{configurationNumber}/order": {
      "post": {
        "tags": [
          "Configurations"
        ],
        "summary": "Turn a configuration into a sales order",
        "description": "Creates a sales order with a single line for the configured product, priced at base price plus configuration surcharge through the same price hierarchy POST /preview/configurations/calculate uses. The response is the same representation as GET /preview/orders/{orderNumber}, with the canonical URL in the `Location` header.\n\nThe line is priced **now**, not from a stored quote: the price engine runs again at conversion, in the customer's own currency. Unchanged choices give the calculated price as long as the underlying prices still hold — a campaign starting or expiring in between will move it.\n\nThe order is created in Draft. Add freight, extra lines or a delivery address through the order endpoints, then place it with POST /preview/orders/{orderNumber}/place. Behind the line, the configuration becomes a production work order carrying the exploded bill of materials and routing.\n\nThe configuration itself is consumed: it stops appearing in GET /preview/configurations and its own GET returns `404` afterwards. Store the `orderNumber` from this response — it is the only link back to the configuration you just converted.\n\nKnown error codes: `409 WorkOrder.NotEstimate` — already ordered. `409 WorkOrder.NoCustomer` — the configuration has no customer; attach one by passing `customerNumber` to reconfigure first. `409 WorkOrder.NoOutputItem` — the configuration has no item. `400 Warehouse.NoDefault` and `400 OrderType.NoDefault` — the tenant has no default warehouse or order type configured; that is a setup problem in Fluit, not something the request can fix.\n\nNote that the line is priced as a manual unit price, so automatic customer discounts do not apply to it. Price lists, agreements, campaigns and volume breaks are already reflected in the base price.",
        "operationId": "Preview_CreateOrderFromConfiguration",
        "parameters": [
          {
            "name": "configurationNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderFromConfigurationRequest"
              },
              "examples": {
                "minimal": {
                  "summary": "No body — order with an open delivery date",
                  "value": { }
                },
                "full": {
                  "summary": "With a requested delivery date",
                  "value": {
                    "requestedDeliveryDate": "2026-09-15"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "URL of the newly created resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOrderDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/configurations/{configurationNumber}": {
      "delete": {
        "tags": [
          "Configurations"
        ],
        "summary": "Discard a configuration",
        "description": "Deletes a configuration that was never ordered. A configurator produces a lot of abandoned configurations, and this is how the app cleans them up instead of leaving them in the tenant's list.\n\nReturns `409` (`Configuration.NotConfigurable`) once the configuration has become an order — what sits behind the order line is production data and is not deletable through this API. Cancel the order with POST /preview/orders/{orderNumber}/cancel instead.",
        "operationId": "Preview_DeleteConfiguration",
        "parameters": [
          {
            "name": "configurationNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Configurations"
        ],
        "summary": "Get a saved configuration",
        "description": "Returns one configuration with its chosen values, resolved to feature and option codes, and priced for its customer — `basePricePerUnit`, `configurationSurchargePerUnit`, `unitPrice` and `totalPrice`. Use it to resume a saved configuration without replaying the values through POST /preview/configurations/calculate.\n\nReturns `404` once the configuration has become an order — a configuration only exists until it is ordered. Read the resulting order through GET /preview/orders/{orderNumber} instead, using the order number from the response to POST /preview/configurations/{configurationNumber}/order.\n\nThe price is calculated on read, so it reflects today's price lists and campaigns rather than what was quoted when the configuration was saved. The price fields are omitted if the saved configuration can no longer be priced (e.g. the item's features have changed since).",
        "operationId": "Preview_GetConfiguration",
        "parameters": [
          {
            "name": "configurationNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicConfigurationResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/items/{itemNumber}/configuration": {
      "get": {
        "tags": [
          "Configurations"
        ],
        "summary": "Get an item's configuration schema",
        "description": "Returns everything needed to render a configurator form for one item: its configurable features, their input types, bounds, defaults and price impact, plus the allowed options for each selection. This is the first call in the configurator flow.\n\nEach feature's `featureType` decides which field to send back in `values[]`: `Text` → `text`, `Number` → `number` (bounded by `minValue`/`maxValue`), `Selection` → `optionCode`, `Boolean` → `boolean`, `ItemSelection` → `itemNumber`. `Calculated` features take no input — they are derived from the others and their results come back in `resolvedValues` from POST /preview/configurations/calculate.\n\n`features` is not paginated: a configurator cannot render a half-loaded form, so the whole schema always ships in one response. An item with no configurable features returns `isConfigurable: false` and an empty list — filter GET /preview/items with `?isConfigurable=true` to find the configurable ones. Prices here are the tenant base-currency list prices; use POST /preview/configurations/calculate for the real, customer-specific price of a given set of choices.",
        "operationId": "Preview_GetItemConfiguration",
        "parameters": [
          {
            "name": "itemNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicItemConfigurationResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/configurations/{configurationNumber}/reconfigure": {
      "post": {
        "tags": [
          "Configurations"
        ],
        "summary": "Change a saved configuration",
        "description": "Changes a saved configuration and re-runs the engine.\n\nEvery field is optional and omitting one leaves that part alone:\n- `values` **omitted** keeps the current choices — that is how you change only the quantity. When present it is a **full replacement**, not a patch: anything not in the list is cleared, and an empty array clears every choice.\n- `quantity` omitted keeps the current quantity.\n- `customerNumber` omitted keeps the current customer. Set it to claim a configuration that was saved anonymously — a configuration must have a customer before it can be ordered.\n\nReturns `200` with the updated configuration, including the recalculated `unitPrice`, rather than `204`. That is a deliberate departure from the usual action-endpoint convention — the whole point of reconfiguring is the new result, and forcing a follow-up GET for it would be wasteful.\n\nReturns `409` (`Configuration.NotConfigurable`) once the configuration has become an order: an ordered configuration is frozen, since changing it would silently change what the customer bought. The status is checked before the body, so an ordered configuration returns the conflict regardless of what the payload contains. Change the order line instead, or create a new configuration.\n\nInvalid values return `400` with the offending `FeatureExplosion.*` code. Use POST /preview/configurations/calculate first to see all problems at once.",
        "operationId": "Preview_ReconfigureConfiguration",
        "parameters": [
          {
            "name": "configurationNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReconfigureConfigurationRequest"
              },
              "examples": {
                "minimal": {
                  "summary": "Change the quantity only — the choices are kept",
                  "value": {
                    "quantity": "3"
                  }
                },
                "claim": {
                  "summary": "Attach a customer to an anonymously saved configuration",
                  "value": {
                    "customerNumber": "CUST-001"
                  }
                },
                "full": {
                  "summary": "New measurements and a different fabric",
                  "value": {
                    "quantity": "2",
                    "values": [
                      {
                        "featureCode": "WIDTH",
                        "number": "260"
                      },
                      {
                        "featureCode": "HEIGHT",
                        "number": "180"
                      },
                      {
                        "featureCode": "FABRIC",
                        "optionCode": "VELVET-DEEPBLUE"
                      },
                      {
                        "featureCode": "LINING",
                        "boolean": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicConfigurationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/customers": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer",
        "description": "Creates a new customer for the authenticated tenant. Customer number is auto-generated if not provided. defaultBackorderBehavior controls what happens to unfulfillable quantities on this customer's orders; omit it to use CreateBackorder. Allowed values: CreateBackorder, CancelRemaining, HoldOrder. The response body is the same representation as GET /preview/customers/{customerNumber}; the canonical URL is returned in the Location header and in links.self.",
        "operationId": "Preview_CreateCustomer",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomerRequest"
              },
              "examples": {
                "default": {
                  "summary": "Create customer",
                  "value": {
                    "name": "Acme AB",
                    "customerNumber": "CUST-001",
                    "organizationNumber": "5560001234",
                    "invoiceEmail": "invoice@acme.se",
                    "phone": "+46701234567",
                    "street1": "Storgatan 1",
                    "postalCode": "11122",
                    "city": "Stockholm",
                    "countryCode": "SE"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "URL of the newly created resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCustomerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customers",
        "description": "Returns a paginated list of customers for the authenticated tenant. Filter by ?search=, ?isActive=true|false, ?modifiedSince=. Sorted by customer number. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListCustomers",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "modifiedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicCustomerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/customers/{customerNumber}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get a customer by customer number",
        "description": "Returns the details of a customer belonging to the authenticated tenant.",
        "operationId": "Preview_GetCustomer",
        "parameters": [
          {
            "name": "customerNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCustomerResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Customers"
        ],
        "summary": "Update a customer",
        "description": "Partially updates a customer. Only provided fields are updated (JSON Merge Patch semantics). Omitted fields are left unchanged. Pass null to clear a nullable field. Unknown fields are silently ignored.",
        "operationId": "Preview_PatchCustomer",
        "parameters": [
          {
            "name": "customerNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchCustomerRequest"
              }
            },
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchCustomerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/customers/{customerNumber}/addresses": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer delivery addresses",
        "description": "Returns a paginated list of the delivery addresses registered on the customer, default address first. Use the fields to populate deliveryAddress when creating orders. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListCustomerAddresses",
        "parameters": [
          {
            "name": "customerNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicCustomerAddressResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/customers/{customerNumber}/contacts": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer contacts",
        "description": "Returns a paginated list of the contact persons registered on the customer, default contact first. Use a contact's id as customerContactId when creating orders. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListCustomerContacts",
        "parameters": [
          {
            "name": "customerNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicCustomerContactResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/items": {
      "post": {
        "tags": [
          "Items"
        ],
        "summary": "Create an item",
        "description": "Creates a new item for the authenticated tenant. Item number is auto-generated if not provided. The response body is the same representation as GET /preview/items/{itemNumber}; the canonical URL is returned in the Location header and in links.self.",
        "operationId": "Preview_CreateItem",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateItemRequest"
              },
              "examples": {
                "minimal": {
                  "summary": "Minimal — name only",
                  "value": {
                    "name": "Widget Pro 3000"
                  }
                },
                "full": {
                  "summary": "Full item with pricing and customs",
                  "value": {
                    "name": "Widget Pro 3000",
                    "itemNumber": "WIDGET-PRO",
                    "description": "High-quality widget for professional use.",
                    "barcode": "7350100500001",
                    "salesPrice": "299.00",
                    "costPrice": "120.00",
                    "hsCode": "84795000",
                    "countryOfOrigin": "SE"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "URL of the newly created resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicItemDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "List items",
        "description": "Returns a paginated list of items for the authenticated tenant. Filter by ?search=, ?status= (Draft, PendingApproval, Active, PhasingOut, Discontinued, Archived; matched case-insensitively, an unknown value returns 400), ?modifiedSince=, ?isConfigurable=, ?categoryCode=. Sorted by item number. ?modifiedSince= returns both created and modified items. ?isConfigurable=true returns only made-to-order items that have a configuration schema (GET /preview/items/{itemNumber}/configuration); false returns only the plain catalogue items. ?categoryCode= is an exact match on the stable category code and only counts active, non-deleted assignments. Use it to build the picker for an ItemSelection feature: pass the feature's selectableItemCategoryCode from the configuration schema. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListItems",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "Draft",
                "PendingApproval",
                "Active",
                "PhasingOut",
                "Discontinued",
                "Archived"
              ],
              "type": "string"
            }
          },
          {
            "name": "modifiedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "isConfigurable",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "categoryCode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/items/{itemNumber}/assets/{assetId}/download": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Download an item asset",
        "description": "Streams the asset file (image or document). Externally hosted assets return a 302 redirect to the external URL. Only assets marked as public can be downloaded.",
        "operationId": "Preview_DownloadItemAsset",
        "parameters": [
          {
            "name": "itemNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "302": {
            "description": "Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/items/{itemNumber}/availability": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Get item stock availability",
        "description": "Returns the item's stock availability summed across all active warehouses and broken down per warehouse. availableQuantity is the quantity that can be promised to new orders (on hand minus reservations). Items never stocked in a warehouse return an empty warehouses list with zero totals. The warehouse breakdown is bounded by the tenant's warehouse count and is not paginated.",
        "operationId": "Preview_GetItemAvailability",
        "parameters": [
          {
            "name": "itemNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicItemAvailabilityResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/items/{itemNumber}": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Get an item by item number",
        "description": "Returns the full details of an item by its unique item number: all orderable units with barcodes and conversion factors (base unit first), specification attributes, category assignments, cross-references (MPN/OEM/extra barcodes) and, for variants, the parent item and variant attribute values. The list endpoint returns a leaner representation without these collections.",
        "operationId": "Preview_GetItem",
        "parameters": [
          {
            "name": "itemNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicItemDetailResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Items"
        ],
        "summary": "Update an item",
        "description": "Partially updates an item. Only provided fields are updated (JSON Merge Patch semantics). Omitted fields are left unchanged. Pass null to clear a nullable field. Unknown fields are silently ignored. itemNumber cannot be changed here — it is the resource's public key and the address external systems reference.",
        "operationId": "Preview_PatchItem",
        "parameters": [
          {
            "name": "itemNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchItemRequest"
              }
            },
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/items/{itemNumber}/price": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Calculate item price",
        "description": "Calculates the price for an item via the price engine — the same price an order line would get. Pass ?customerNumber= for customer-specific pricing (price lists, agreements, campaigns); omit it for the default price. ?quantity= (default 1) activates volume pricing, ?currencyCode= overrides the currency (defaults to the customer's or the tenant base currency). quantityBreaks lists the volume price tiers of the applied price list.",
        "operationId": "Preview_GetItemPrice",
        "parameters": [
          {
            "name": "itemNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerNumber",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currencyCode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quantity",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double",
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicItemPriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/items/{itemNumber}/assets": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "List item assets",
        "description": "Returns a paginated list of the item's public images and documents, primary image first and then by sort order. Only assets marked as public are included. url points either to an external location or to GET /preview/items/{itemNumber}/assets/{assetId}/download (same API key required). Use languageCode to pick language-specific assets where present. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListItemAssets",
        "parameters": [
          {
            "name": "itemNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicItemAssetResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/purchase-orders/{orderNumber}/lines": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Add a line to a purchase order",
        "description": "Adds a line to an existing purchase order. If unitPrice is omitted the price is resolved from the supplier price list for the item. If unit is omitted the item's base unit is used (400 if the item has no base unit). The Location header points at the new line's address, purchase-orders/{orderNumber}/lines/{lineNumber}. Returns 409 Conflict if the order is cancelled or closed, or otherwise in a state that does not permit new lines.",
        "operationId": "Preview_AddPurchaseOrderLine",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPurchaseOrderLineRequest"
              },
              "examples": {
                "default": {
                  "summary": "Add purchase order line",
                  "value": {
                    "itemNumber": "WIDGET-B",
                    "quantity": "25",
                    "unit": "st",
                    "unitPrice": "17.90"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "URL of the newly created resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPurchaseOrderLineResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "List purchase order lines",
        "description": "Returns the lines on a purchase order, sorted by line number ascending. The same lines are also embedded in GET /preview/purchase-orders/{orderNumber}; this endpoint exists so that orders with many lines can be paged through. Returns 404 PurchaseOrder.NotFound if no order has that number. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListPurchaseOrderLines",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicPurchaseOrderLineResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/preview/purchase-orders/{orderNumber}/cancel": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Cancel a purchase order",
        "description": "Cancels a purchase order. Only orders where nothing has been received can be cancelled — use close instead when goods have already arrived but no more are expected. Returns 409 Conflict if the order is already received, closed or cancelled.",
        "operationId": "Preview_CancelPurchaseOrder",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/purchase-orders/{orderNumber}/close": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Close a purchase order",
        "description": "Closes a purchase order so that no further receipts are expected, even if quantities remain outstanding. Use this to settle short deliveries the supplier will not complete. Returns 409 Conflict if the order is already closed or cancelled.",
        "operationId": "Preview_ClosePurchaseOrder",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/purchase-orders/{orderNumber}/confirm": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Confirm a purchase order",
        "description": "Records that the supplier has confirmed the order, moving it to Confirmed. Pass supplierReference to store the supplier's own order number from their confirmation. The request body is optional. This is a header-level status transition only: it does not populate the per-line confirmation fields (confirmedQuantity, confirmedUnitPrice, confirmedDeliveryDate), which stay null and are reserved for the structured confirmation flow that is not yet part of the public API. If the supplier confirmed different quantities or dates, patch the affected lines (PATCH /preview/purchase-orders/{orderNumber}/lines/{lineNumber}) — note that this changes what is ordered, so the deviation is applied rather than recorded alongside the original values. Returns 409 Conflict unless the order is Sent or PartiallyConfirmed.",
        "operationId": "Preview_ConfirmPurchaseOrder",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmPurchaseOrderRequest"
              },
              "examples": {
                "default": {
                  "summary": "Confirm with the supplier's order number",
                  "value": {
                    "supplierReference": "SO-99887"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/purchase-orders": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Create a purchase order",
        "description": "Creates a new purchase order for the authenticated tenant. Only supplierNumber is required; all other fields default from the supplier or tenant settings. The order is created in Draft status and is NOT sent to the supplier — call POST /preview/purchase-orders/{orderNumber}/send when it is ready to go out. orderNumber: if omitted a number is auto-generated from the tenant number sequence; if provided and already in use, 409 Conflict is returned. Lines are created atomically with the order — if any line is rejected, no order is created. On a line, omit unitPrice to use the supplier price list, and omit unit to use the item's base unit (400 if the item has no base unit). The response body is the same representation as GET /preview/purchase-orders/{orderNumber}; the canonical URL is returned in the Location header and in links.self.",
        "operationId": "Preview_CreatePurchaseOrder",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePurchaseOrderRequest"
              },
              "examples": {
                "minimal": {
                  "summary": "Minimal — supplier and one line",
                  "value": {
                    "supplierNumber": "SUP-001",
                    "lines": [
                      {
                        "itemNumber": "WIDGET-A",
                        "quantity": "100"
                      }
                    ]
                  }
                },
                "full": {
                  "summary": "Full purchase order",
                  "value": {
                    "supplierNumber": "SUP-001",
                    "orderDate": "2026-08-01",
                    "expectedDeliveryDate": "2026-08-15",
                    "warehouseCode": "MAIN",
                    "currencyCode": "SEK",
                    "paymentTermCode": "NET30",
                    "deliveryTermCode": "DAP",
                    "supplierReference": "OUR-REF-4711",
                    "lines": [
                      {
                        "itemNumber": "WIDGET-A",
                        "quantity": "100",
                        "unit": "st",
                        "unitPrice": "42.50"
                      },
                      {
                        "itemNumber": "WIDGET-B",
                        "quantity": "25",
                        "expectedDate": "2026-08-22"
                      }
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "URL of the newly created resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPurchaseOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "List purchase orders",
        "description": "Returns a paginated list of purchase orders for the authenticated tenant. Filter by ?status= (Draft, Sent, PartiallyConfirmed, Confirmed, PartiallyReceived, Received, Closed, Cancelled; matched case-insensitively, an unknown value returns 400), ?supplierNumber=, ?search=, ?orderDateFrom=, ?orderDateTo=, ?modifiedSince= (ISO 8601 UTC datetime). ?search= performs a case-insensitive partial match against both orderNumber and supplierReference. ?modifiedSince= returns both created and modified orders, so it can be used for delta sync. Unlike sales orders, Draft purchase orders ARE included — an order created via POST /preview/purchase-orders starts in Draft and the caller has to be able to find it again. Use ?status=Draft or ?status=Sent to narrow. Sorted by order date descending, then order number. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListPurchaseOrders",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "Draft",
                "Sent",
                "PartiallyConfirmed",
                "Confirmed",
                "PartiallyReceived",
                "Received",
                "Closed",
                "Cancelled"
              ],
              "type": "string"
            }
          },
          {
            "name": "supplierNumber",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderDateFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "orderDateTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "modifiedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicPurchaseOrderListItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/purchase-orders/{orderNumber}/lines/{lineNumber}": {
      "delete": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Delete a purchase order line",
        "description": "Removes a line from a purchase order and recalculates the order totals. Returns 404 if the order or line number does not exist, and 409 Conflict if the line has already been received wholly or in part, or if the order is in a state that does not permit changes to its lines.",
        "operationId": "Preview_DeletePurchaseOrderLine",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Update a purchase order line",
        "description": "Partially updates a purchase order line identified by its line number. Only provided fields are updated (JSON Merge Patch semantics); omitted fields are left unchanged. quantity, unitPrice and unit cannot be null; pass null for expectedDate, promisedDeliveryDate or notes to clear them. Line and order totals are recalculated automatically. The item on a line cannot be changed — delete the line and add a new one instead. Returns 409 Conflict if the order is cancelled or closed, or if the quantity is reduced below what has already been received.",
        "operationId": "Preview_PatchPurchaseOrderLine",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchPurchaseOrderLineRequest"
              }
            },
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchPurchaseOrderLineRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/purchase-orders/{orderNumber}": {
      "get": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Get a purchase order",
        "description": "Returns a single purchase order identified by its order number (exact match, case-sensitive), including all lines. Returns 404 PurchaseOrder.NotFound if no order has that number. Line numbers in the response are the business keys used by the line endpoints, e.g. PATCH /preview/purchase-orders/{orderNumber}/lines/{lineNumber}. confirmedQuantity, confirmedUnitPrice and confirmedDeliveryDate are null until the supplier has confirmed the line.",
        "operationId": "Preview_GetPurchaseOrder",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPurchaseOrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Update a purchase order",
        "description": "Partially updates a purchase order header. Only provided fields are updated (JSON Merge Patch semantics). Omitted fields are left unchanged. Pass null to clear a nullable field. Unknown fields are silently ignored. orderNumber and supplierNumber cannot be changed — the order number is the resource's address, and changing supplier would invalidate the prices on every line. orderDate, warehouseCode and currencyCode cannot be set to null. Reference codes that do not exist return 400 with the offending field named. Returns 409 Conflict if the order is cancelled or closed. To change lines, use the line endpoints.",
        "operationId": "Preview_PatchPurchaseOrder",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchPurchaseOrderRequest"
              }
            },
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchPurchaseOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/purchase-orders/{orderNumber}/lines/{lineNumber}/receive": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Receive goods on a purchase order line",
        "description": "Books received goods into stock against a purchase order line. This increases the on-hand quantity, creates an inventory transaction and advances the line and order status (PartiallyReceived, then Received once the full quantity has arrived). locationCode must be a location in the order's receiving warehouse; omit it to use that warehouse's default receiving location. unitCost records what the goods actually cost if it differs from the ordered price — it feeds the inventory valuation and must not be negative. serialNumber and batchNumber are stored on the receipt as supplied; they are not currently validated against the item's tracking type, so send the right one for the item. Receiving is not reversible through this API; a retry with the same Idempotency-Key replays the original response instead of booking the goods twice. Returns 409 Conflict if the order is in Draft or Cancelled, or if the quantity exceeds what is still outstanding on the line. The response contains the created receipt id and the line as it stands after the receipt.",
        "operationId": "Preview_ReceivePurchaseOrderLine",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceivePurchaseOrderLineRequest"
              },
              "examples": {
                "minimal": {
                  "summary": "Receive the full outstanding quantity",
                  "value": {
                    "quantity": "100"
                  }
                },
                "full": {
                  "summary": "Partial receipt into a specific location with a batch number",
                  "value": {
                    "quantity": "40",
                    "locationCode": "A-01-02",
                    "unitCost": "42.75",
                    "batchNumber": "B-2026-08-14",
                    "notes": "Short delivery, remainder promised week 34"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceivePurchaseOrderLineResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/purchase-orders/{orderNumber}/send": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Send a purchase order",
        "description": "Moves a purchase order from Draft to Sent. By default this only records that the order has gone out — nothing is emailed. That is the right behaviour when the order reaches the supplier over EDI or another channel you control. Set sendEmail=true to have Fluit email the purchase order PDF to the supplier; the address defaults to the supplier's purchaseOrderEmail and 400 is returned if neither that nor toEmail is set. Sending an email is not reversible, so retries with the same Idempotency-Key replay the original response instead of sending again. The request body is optional; POSTing with no body sends without email. Returns 409 Conflict if the order is cancelled, closed or has no lines.",
        "operationId": "Preview_SendPurchaseOrder",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendPurchaseOrderRequest"
              },
              "examples": {
                "mark-as-sent": {
                  "summary": "Mark as sent without emailing (default)",
                  "value": { }
                },
                "email": {
                  "summary": "Email the purchase order to the supplier",
                  "value": {
                    "sendEmail": true,
                    "subject": "Purchase order PO-2026-00042"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/reference/tenant-info": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "Get tenant info",
        "description": "Returns company details and base configuration (currency, language, timezone) for the authenticated tenant. Address fields use the same names as elsewhere in the API (street1, countryCode) and codes are ISO: countryCode is ISO 3166-1 alpha-2, baseCurrencyCode is ISO 4217 and defaultLanguageCode is ISO 639-1.",
        "operationId": "Preview_GetTenantInfo",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTenantInfoResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/reference/currencies": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "List currencies",
        "description": "Returns all configured currencies. Use the code field as currencyCode in order creation. Reference lists are bounded configuration data and are returned unpaginated.",
        "operationId": "Preview_ListCurrencies",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicCurrencyResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/reference/delivery-terms": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "List delivery terms",
        "description": "Returns all delivery terms available for use as deliveryTermCode in order creation. Reference lists are bounded configuration data and are returned unpaginated.",
        "operationId": "Preview_ListDeliveryTerms",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicDeliveryTermResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/reference/order-types": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "List order types",
        "description": "Returns all order types available for use as orderTypeCode in order creation. Reference lists are bounded configuration data and are returned unpaginated.",
        "operationId": "Preview_ListOrderTypes",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicOrderTypeResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/reference/payment-terms": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "List payment terms",
        "description": "Returns all payment terms available for use as paymentTermCode in order creation. Reference lists are bounded configuration data and are returned unpaginated.",
        "operationId": "Preview_ListPaymentTerms",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicPaymentTermResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/reference/shipping-methods": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "List shipping methods",
        "description": "Returns shipping methods that have a code and can be referenced via shippingMethodCode in order creation. Reference lists are bounded configuration data and are returned unpaginated.",
        "operationId": "Preview_ListShippingMethods",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicShippingMethodResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/reference/warehouses": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "List warehouses",
        "description": "Returns all active warehouses available for use as warehouseCode in order creation. Reference lists are bounded configuration data and are returned unpaginated.",
        "operationId": "Preview_ListWarehouses",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicWarehouseResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/orders/{orderNumber}/lines": {
      "post": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Add a line to a sales order",
        "description": "Adds an order line to an existing sales order. If unitPrice is omitted the price is calculated automatically via the price engine. discountPercent must be between 0 and 100; it overrides the auto-calculated discount, omit it to apply the discount engine rules. The Location header points at the new line's address, orders/{orderNumber}/lines/{lineNumber}. Returns 409 Conflict if the order is in a state that does not permit new lines.",
        "operationId": "Preview_AddOrderLine",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddOrderLineRequest"
              },
              "examples": {
                "default": {
                  "summary": "Add order line",
                  "value": {
                    "itemNumber": "WIDGET-B",
                    "quantity": "5",
                    "unit": "st",
                    "unitPrice": "299.00"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "URL of the newly created resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOrderLineResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/preview/orders/{orderNumber}/cancel": {
      "post": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Cancel a sales order",
        "description": "Cancels a sales order. Only orders that have not been shipped can be cancelled. Returns 409 Conflict if the order is in a state that does not permit cancellation.",
        "operationId": "Preview_CancelOrder",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/orders": {
      "post": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Create a sales order",
        "description": "Creates a new sales order for the authenticated tenant. customerNumber and at least one line are required (or set createAsDraft=true to create an empty draft); all other fields default from the customer or tenant settings. backorderBehavior: omit or null to inherit the tenant/customer configured default. Allowed values: CreateBackorder, CancelRemaining, HoldOrder. orderNumber: if omitted a number is auto-generated from the tenant number sequence; if provided and already in use, 409 Conflict is returned. Use deliveryAddress to override the delivery address inline; if omitted the customer's default address is used. Optionally include lines to create order lines atomically with the order. Set createAsDraft=true to keep the order in Draft status (e.g. to add more lines via POST /orders/{orderNumber}/lines before placing). The response body is the same representation as GET /preview/orders/{orderNumber}; the canonical URL is returned in the Location header and in links.self.",
        "operationId": "Preview_CreateOrder",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderRequest"
              },
              "examples": {
                "minimal": {
                  "summary": "Minimal — customer number and one line",
                  "value": {
                    "customerNumber": "CUST-001",
                    "lines": [
                      {
                        "itemNumber": "WIDGET-A",
                        "quantity": "10"
                      }
                    ]
                  }
                },
                "with-lines": {
                  "summary": "Order with lines and delivery address",
                  "value": {
                    "customerNumber": "CUST-001",
                    "orderDate": "2026-05-25",
                    "currencyCode": "SEK",
                    "customerReference": "PO-2026-042",
                    "lines": [
                      {
                        "itemNumber": "WIDGET-A",
                        "quantity": "10",
                        "unit": "st"
                      },
                      {
                        "itemNumber": "WIDGET-B",
                        "quantity": "5",
                        "unitPrice": "299.00"
                      }
                    ],
                    "deliveryAddress": {
                      "name": "Acme AB",
                      "street1": "Storgatan 1",
                      "postalCode": "11122",
                      "city": "Stockholm",
                      "countryCode": "SE"
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "URL of the newly created resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOrderDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "List sales orders",
        "description": "Returns a paginated list of sales orders for the authenticated tenant. Draft orders are excluded. Filter by ?status= (Placed, Released, Picking, Packed, Shipped, Completed, Cancelled; matched case-insensitively, an unknown value returns 400), ?customerNumber=, ?search=, ?orderDateFrom=, ?orderDateTo=, ?modifiedSince= (ISO 8601 UTC datetime). Sorted by order date descending. ?search= performs a case-insensitive partial match against both orderNumber and customerReference. Example: ?search=ORD-2024 matches orders whose order number or customer reference contains 'ORD-2024'. ?modifiedSince= returns both created and modified orders. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListOrders",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "Placed",
                "Released",
                "Picking",
                "Packed",
                "Shipped",
                "Completed",
                "Cancelled"
              ],
              "type": "string"
            }
          },
          {
            "name": "customerNumber",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderDateFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "orderDateTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "modifiedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicOrderListItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/orders/{orderNumber}/lines/{lineNumber}": {
      "delete": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Delete an order line",
        "description": "Removes a line from a sales order and releases any stock reservations for it. Order totals are recalculated automatically. Returns 409 Conflict if the order is completed/cancelled or the line has been split into sub-lines.",
        "operationId": "Preview_DeleteOrderLine",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Update an order line",
        "description": "Partially updates an order line identified by its line number. Only provided fields are updated (JSON Merge Patch semantics); omitted fields are left unchanged. quantity and unitPrice cannot be null; pass null for discountPercent, requestedDeliveryDate or notes to clear them. Line totals and order totals are recalculated automatically. Returns 409 Conflict if the order is completed/cancelled, if delivery has started on the line, or if the line has been split into sub-lines.",
        "operationId": "Preview_PatchOrderLine",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchOrderLineRequest"
              }
            },
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchOrderLineRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/orders/{orderNumber}": {
      "get": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Get a sales order by order number",
        "description": "Returns the details of a sales order by its unique order number.",
        "operationId": "Preview_GetOrder",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOrderDetailResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/orders/{orderNumber}/shipments": {
      "get": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "List shipments for a sales order",
        "description": "Returns a paginated list of the shipments fulfilling the order, including carrier tracking numbers once booked. An order can have multiple shipments (partial deliveries) and a shipment can cover multiple orders (consolidated delivery) — only lines belonging to this order are included. Returns an empty items list if fulfilment has not started. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_GetOrderShipments",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicShipmentResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/orders/{orderNumber}/place": {
      "post": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Place a sales order",
        "description": "Transitions a sales order from Draft to Placed, confirming it for processing. Returns 409 Conflict if the order is not in Draft status. Returns 400 Bad Request for business-rule violations; the Problem Details response includes an `errors` extension array with one entry per violation, each containing a `code` and `description`. Known error codes: `SalesOrder.NoLinesInOrder` (order must have at least one line before it can be placed).",
        "operationId": "Preview_PlaceOrder",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/suppliers": {
      "post": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Create a supplier",
        "description": "Creates a new supplier for the authenticated tenant. Only name is required. supplierNumber: if omitted a number is auto-generated from the tenant number sequence; if provided and already in use, 409 Conflict is returned. currencyCode defaults to the tenant base currency and determines the currency of purchase orders and supplier prices. paymentTermCode and deliveryTermCode must match existing reference data (400 if unknown) and become the defaults on purchase orders to this supplier. The response body is the same representation as GET /preview/suppliers/{supplierNumber}; the canonical URL is returned in the Location header and in links.self.",
        "operationId": "Preview_CreateSupplier",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID recommended, max 255 chars) identifying this logical request. Reuse the same key when retrying after a network failure to get the original response replayed instead of creating a duplicate. Reusing a key with a different body returns 422. Responses are cached for 24 hours.",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSupplierRequest"
              },
              "examples": {
                "minimal": {
                  "summary": "Minimal — name only",
                  "value": {
                    "name": "Nordic Components AB"
                  }
                },
                "full": {
                  "summary": "Full supplier",
                  "value": {
                    "name": "Nordic Components AB",
                    "supplierNumber": "SUP-001",
                    "organizationNumber": "5560001234",
                    "currencyCode": "SEK",
                    "purchaseOrderEmail": "order@nordic-components.se",
                    "phone": "+46812345678",
                    "street1": "Industrigatan 5",
                    "postalCode": "41250",
                    "city": "Göteborg",
                    "countryCode": "SE",
                    "paymentTermCode": "NET30",
                    "deliveryTermCode": "DAP",
                    "leadTimeDays": 14
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "URL of the newly created resource.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSupplierResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Suppliers"
        ],
        "summary": "List suppliers",
        "description": "Returns a paginated list of suppliers for the authenticated tenant. Filter by ?search=, ?isActive= and ?modifiedSince= (ISO 8601 UTC datetime). ?search= performs a case-insensitive partial match against supplierNumber, name, organizationNumber and city. Example: ?search=acme matches suppliers whose name contains 'acme'. ?modifiedSince= returns both created and modified suppliers, so it can be used for delta sync. Sorted by supplierNumber ascending. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListSuppliers",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "modifiedSince",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicSupplierResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/suppliers/{supplierNumber}": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Get a supplier",
        "description": "Returns a single supplier identified by its supplier number (exact match, case-sensitive). Returns 404 Supplier.NotFound if no supplier has that number. paymentTermCode and deliveryTermCode can be passed straight back when creating a purchase order.",
        "operationId": "Preview_GetSupplier",
        "parameters": [
          {
            "name": "supplierNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSupplierResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Update a supplier",
        "description": "Partially updates a supplier. Only provided fields are updated (JSON Merge Patch semantics). Omitted fields are left unchanged. Pass null to clear a nullable field. Unknown fields are silently ignored. supplierNumber cannot be changed — it is the resource's address. name and currencyCode cannot be set to null.",
        "operationId": "Preview_PatchSupplier",
        "parameters": [
          {
            "name": "supplierNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSupplierRequest"
              }
            },
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSupplierRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/preview/suppliers/{supplierNumber}/contacts": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "summary": "List supplier contacts",
        "description": "Returns the contact persons registered on a supplier, default contact first, then by name. Returns 404 Supplier.NotFound if no supplier has that number. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListSupplierContacts",
        "parameters": [
          {
            "name": "supplierNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicSupplierContactResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/preview/suppliers/{supplierNumber}/items": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "summary": "List supplier prices",
        "description": "Returns the supplier-specific purchase price, minimum order quantity, order multiple and lead time for each item this supplier can deliver. Prices are expressed in the supplier's currency (see currencyCode on the supplier). Filter by ?itemNumber= (exact match) to look up a single item, and ?isActive= to exclude retired price rows. validFrom/validTo bound the price period; a row with both null is always valid. Returns 404 Supplier.NotFound if no supplier has that number. Sorted by itemNumber ascending. Response shape: { items: T[], totalCount: int, page: int, pageSize: int, totalPages: int, hasPreviousPage: bool, hasNextPage: bool }. Page is 1-based. Default pageSize is 50, maximum is 200.",
        "operationId": "Preview_ListSupplierItems",
        "parameters": [
          {
            "name": "supplierNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemNumber",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResult_PublicSupplierItemResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Maximum number of requests allowed in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Number of requests remaining in the current rate-limit window.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix timestamp (seconds since epoch) at which the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AddOrderLineRequest": {
        "required": [
          "itemNumber"
        ],
        "type": "object",
        "properties": {
          "itemNumber": {
            "minLength": 1,
            "type": "string",
            "description": "Item number of an existing item."
          },
          "quantity": {
            "maximum": 79228162514264337593543950335,
            "minimum": 0,
            "exclusiveMinimum": true,
            "type": "number",
            "description": "Ordered quantity. Must be greater than zero.",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "description": "Overrides the item's default sales price. Omit to use the item's default.",
            "format": "double",
            "nullable": true
          },
          "discountPercent": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Line discount in percent (0–100).",
            "format": "double",
            "nullable": true
          },
          "unit": {
            "maxLength": 20,
            "type": "string",
            "description": "Unit of measure code, e.g. `st`, `kg`. Defaults to the item's base unit.",
            "nullable": true
          },
          "requestedDeliveryDate": {
            "type": "string",
            "description": "Requested delivery date for this line.",
            "format": "date",
            "nullable": true
          },
          "notes": {
            "maxLength": 500,
            "type": "string",
            "description": "Free-text line notes.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AddPurchaseOrderLineRequest": {
        "required": [
          "itemNumber"
        ],
        "type": "object",
        "properties": {
          "itemNumber": {
            "minLength": 1,
            "type": "string",
            "description": "Item number of an existing item."
          },
          "quantity": {
            "maximum": 79228162514264337593543950335,
            "minimum": 0,
            "exclusiveMinimum": true,
            "type": "number",
            "description": "Ordered quantity. Must be greater than zero.",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "description": "Overrides the supplier's price for the item. Omit to use the supplier price list.",
            "format": "double",
            "nullable": true
          },
          "unit": {
            "maxLength": 20,
            "type": "string",
            "description": "Unit of measure code, e.g. `st`, `kg`. Defaults to the item's base unit.",
            "nullable": true
          },
          "expectedDate": {
            "type": "string",
            "description": "Expected delivery date for this line.",
            "format": "date",
            "nullable": true
          },
          "notes": {
            "maxLength": 500,
            "type": "string",
            "description": "Free-text line notes.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AssetCategory": {
        "enum": [
          "MainImage",
          "GalleryImage",
          "LifestyleImage",
          "TechnicalImage",
          "VariantImage",
          "Datasheet",
          "Manual",
          "Certificate",
          "SafetySheet",
          "Warranty",
          "Brochure",
          "Installation",
          "Other"
        ],
        "type": "string"
      },
      "AssetType": {
        "enum": [
          "Image",
          "Document"
        ],
        "type": "string"
      },
      "AttributeDataType": {
        "enum": [
          "Text",
          "WholeNumber",
          "DecimalNumber",
          "Boolean",
          "Date",
          "Url",
          "Html",
          "Color"
        ],
        "type": "string"
      },
      "BackorderBehavior": {
        "enum": [
          "CreateBackorder",
          "CancelRemaining",
          "HoldOrder"
        ],
        "type": "string"
      },
      "CalculateConfigurationRequest": {
        "required": [
          "itemNumber"
        ],
        "type": "object",
        "properties": {
          "itemNumber": {
            "maxLength": 50,
            "minLength": 1,
            "type": "string",
            "description": "Item number of the configurable product."
          },
          "quantity": {
            "type": "number",
            "description": "How many units to price. Must be greater than zero.",
            "format": "double"
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationValueInput"
            },
            "description": "The chosen values. Omit or leave empty to price the item with no choices made.",
            "nullable": true
          },
          "customerNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Customer to price for. Applies their price lists, agreements and currency. Omit for the default price.",
            "nullable": true
          },
          "currencyCode": {
            "pattern": "^[A-Z]{3}$",
            "type": "string",
            "description": "ISO 4217 currency to price in. Defaults to the customer's currency, then the tenant base currency.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConfirmPurchaseOrderRequest": {
        "type": "object",
        "properties": {
          "supplierReference": {
            "maxLength": 100,
            "type": "string",
            "description": "The supplier's own order or confirmation number, if they quoted one.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateConfigurationRequest": {
        "required": [
          "itemNumber"
        ],
        "type": "object",
        "properties": {
          "itemNumber": {
            "maxLength": 50,
            "minLength": 1,
            "type": "string",
            "description": "Item number of the configurable product."
          },
          "quantity": {
            "type": "number",
            "description": "How many units of the configured product. Must be greater than zero.",
            "format": "double"
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationValueInput"
            },
            "description": "The chosen values.",
            "nullable": true
          },
          "customerNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Customer the configuration is for. Required before it can be turned into an order, but may be filled in later with a reconfigure.",
            "nullable": true
          },
          "title": {
            "maxLength": 200,
            "type": "string",
            "description": "Free-text title. Defaults to the item name.",
            "nullable": true
          },
          "description": {
            "maxLength": 2000,
            "type": "string",
            "description": "Free-text description, e.g. which room or window the product is for.",
            "nullable": true
          },
          "warehouseCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Warehouse to plan the configuration against. Optional and left unset when omitted — the warehouse is then resolved (customer's, then the tenant default) when the configuration becomes an order.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateCustomerRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string",
            "description": "Full company or person name."
          },
          "customerNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Unique customer number. Auto-generated from the tenant number sequence if omitted.",
            "nullable": true
          },
          "organizationNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Company registration number / org.nr, e.g. `5560001234`.",
            "nullable": true
          },
          "vatNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "VAT registration number, e.g. `SE556000123401`.",
            "nullable": true
          },
          "invoiceEmail": {
            "maxLength": 200,
            "type": "string",
            "description": "Email address for invoices and order confirmations.",
            "format": "email",
            "nullable": true
          },
          "phone": {
            "maxLength": 50,
            "type": "string",
            "description": "Primary phone number.",
            "nullable": true
          },
          "street1": {
            "maxLength": 200,
            "type": "string",
            "description": "Street address line 1.",
            "nullable": true
          },
          "street2": {
            "maxLength": 200,
            "type": "string",
            "description": "Street address line 2 — suite, c/o, etc.",
            "nullable": true
          },
          "postalCode": {
            "maxLength": 20,
            "type": "string",
            "description": "Postal / ZIP code.",
            "nullable": true
          },
          "city": {
            "maxLength": 100,
            "type": "string",
            "description": "City name.",
            "nullable": true
          },
          "countryCode": {
            "maxLength": 2,
            "pattern": "^[A-Z]{2}$",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`, `DE`, `NO`.",
            "nullable": true
          },
          "defaultCurrencyCode": {
            "maxLength": 3,
            "pattern": "^[A-Z]{3}$",
            "type": "string",
            "description": "ISO 4217 currency code, e.g. `SEK`, `EUR`. If omitted, the tenant default is used.",
            "nullable": true
          },
          "notes": {
            "maxLength": 2000,
            "type": "string",
            "description": "Free-text internal notes (not visible to the customer).",
            "nullable": true
          },
          "defaultBackorderBehavior": {
            "$ref": "#/components/schemas/BackorderBehavior"
          }
        },
        "additionalProperties": false
      },
      "CreateItemRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string",
            "description": "Display name / product name."
          },
          "itemNumber": {
            "maxLength": 50,
            "pattern": "^[A-Z0-9\\-_]+$",
            "type": "string",
            "description": "Unique item number. Only uppercase letters, digits, hyphens and underscores are allowed. Auto-generated if omitted.",
            "nullable": true
          },
          "description": {
            "maxLength": 2000,
            "type": "string",
            "description": "Long-form description, e.g. for a webshop product page.",
            "nullable": true
          },
          "barcode": {
            "maxLength": 50,
            "type": "string",
            "description": "EAN / GTIN barcode or other scanning code.",
            "nullable": true
          },
          "costPrice": {
            "type": "number",
            "description": "Purchase / cost price in the tenant default currency.",
            "format": "double",
            "nullable": true
          },
          "salesPrice": {
            "type": "number",
            "description": "Default sales price in the tenant default currency.",
            "format": "double",
            "nullable": true
          },
          "netWeight": {
            "type": "number",
            "description": "Net weight in kilograms.",
            "format": "double",
            "nullable": true
          },
          "hsCode": {
            "maxLength": 20,
            "type": "string",
            "description": "Harmonized System (HS / KN) customs tariff code.",
            "nullable": true
          },
          "countryOfOrigin": {
            "pattern": "^[A-Z]{2}$",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country of manufacture, e.g. `SE`, `CN`.",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "description": "Free-text internal notes.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateOrderDeliveryAddressInput": {
        "required": [
          "city",
          "countryCode",
          "name",
          "postalCode",
          "street1"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Recipient name or company name."
          },
          "street1": {
            "minLength": 1,
            "type": "string",
            "description": "Street address line 1."
          },
          "postalCode": {
            "minLength": 1,
            "type": "string",
            "description": "Postal code."
          },
          "city": {
            "minLength": 1,
            "type": "string",
            "description": "City."
          },
          "countryCode": {
            "minLength": 1,
            "pattern": "^[A-Z]{2}$",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`."
          },
          "street2": {
            "type": "string",
            "description": "Street address line 2 — c/o, suite, etc.",
            "nullable": true
          },
          "contactPerson": {
            "type": "string",
            "description": "Contact person at the delivery address.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Phone number at the delivery address.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Email address at the delivery address.",
            "format": "email",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateOrderFromConfigurationRequest": {
        "type": "object",
        "properties": {
          "requestedDeliveryDate": {
            "type": "string",
            "description": "Delivery date to request on the order. Omit to leave it open.",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateOrderLineInput": {
        "required": [
          "itemNumber"
        ],
        "type": "object",
        "properties": {
          "itemNumber": {
            "minLength": 1,
            "type": "string",
            "description": "Item number of an existing item."
          },
          "quantity": {
            "maximum": 79228162514264337593543950335,
            "minimum": 0,
            "exclusiveMinimum": true,
            "type": "number",
            "description": "Ordered quantity. Must be greater than zero.",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "description": "Overrides the item's default sales price.",
            "format": "double",
            "nullable": true
          },
          "discountPercent": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Line discount in percent (0–100).",
            "format": "double",
            "nullable": true
          },
          "unit": {
            "maxLength": 20,
            "type": "string",
            "description": "Unit of measure code, e.g. `st`, `kg`. Defaults to the item's base unit.",
            "nullable": true
          },
          "requestedDeliveryDate": {
            "type": "string",
            "description": "Line-level requested delivery date (overrides the order-level date).",
            "format": "date",
            "nullable": true
          },
          "notes": {
            "maxLength": 500,
            "type": "string",
            "description": "Free-text line notes.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateOrderRequest": {
        "required": [
          "customerNumber"
        ],
        "type": "object",
        "properties": {
          "customerNumber": {
            "minLength": 1,
            "type": "string",
            "description": "Number of an existing customer (exact match)."
          },
          "orderDate": {
            "type": "string",
            "description": "Order date. Defaults to today if omitted.",
            "format": "date",
            "nullable": true
          },
          "requestedDeliveryDate": {
            "type": "string",
            "description": "Requested delivery date from the customer.",
            "format": "date",
            "nullable": true
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 currency code, e.g. `SEK`, `EUR`. Defaults to the customer's currency.",
            "nullable": true
          },
          "warehouseCode": {
            "type": "string",
            "description": "Code of the warehouse to fulfil from. Defaults to the tenant's default warehouse.",
            "nullable": true
          },
          "orderTypeCode": {
            "type": "string",
            "description": "Order type code. Defaults to the tenant default.",
            "nullable": true
          },
          "paymentTermCode": {
            "type": "string",
            "description": "Payment term code — overrides the customer default.",
            "nullable": true
          },
          "deliveryTermCode": {
            "type": "string",
            "description": "Delivery term / Incoterm code — overrides the customer default.",
            "nullable": true
          },
          "shippingMethodCode": {
            "type": "string",
            "description": "Shipping method / carrier code — overrides the customer default.",
            "nullable": true
          },
          "deliveryAddress": {
            "$ref": "#/components/schemas/CreateOrderDeliveryAddressInput"
          },
          "customerContactId": {
            "type": "string",
            "description": "ID of the customer contact person.",
            "format": "uuid",
            "nullable": true
          },
          "backorderBehavior": {
            "$ref": "#/components/schemas/BackorderBehavior"
          },
          "customerReference": {
            "maxLength": 100,
            "type": "string",
            "description": "Customer's own reference / purchase order number.",
            "nullable": true
          },
          "externalNotes": {
            "maxLength": 2000,
            "type": "string",
            "description": "Free-text notes printed on order documents.",
            "nullable": true
          },
          "orderNumber": {
            "type": "string",
            "description": "Custom order number. Auto-generated if omitted. Returns 409 if already in use.",
            "nullable": true
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateOrderLineInput"
            },
            "description": "Optional order lines to create atomically with the order.",
            "nullable": true
          },
          "createAsDraft": {
            "type": "boolean",
            "description": "Set to `true` to keep the order in Draft status — useful when adding more lines via POST /orders/{orderNumber}/lines before placing."
          }
        },
        "additionalProperties": false
      },
      "CreatePurchaseOrderLineInput": {
        "required": [
          "itemNumber"
        ],
        "type": "object",
        "properties": {
          "itemNumber": {
            "minLength": 1,
            "type": "string",
            "description": "Item number of an existing item."
          },
          "quantity": {
            "maximum": 79228162514264337593543950335,
            "minimum": 0,
            "exclusiveMinimum": true,
            "type": "number",
            "description": "Ordered quantity. Must be greater than zero.",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "description": "Overrides the supplier's price for the item. Omit to use the supplier price list.",
            "format": "double",
            "nullable": true
          },
          "unit": {
            "maxLength": 20,
            "type": "string",
            "description": "Unit of measure code, e.g. `st`, `kg`. Defaults to the item's base unit.",
            "nullable": true
          },
          "expectedDate": {
            "type": "string",
            "description": "Expected delivery date for this line (overrides the order-level date).",
            "format": "date",
            "nullable": true
          },
          "notes": {
            "maxLength": 500,
            "type": "string",
            "description": "Free-text line notes.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreatePurchaseOrderRequest": {
        "required": [
          "supplierNumber"
        ],
        "type": "object",
        "properties": {
          "supplierNumber": {
            "minLength": 1,
            "type": "string",
            "description": "Number of an existing supplier (exact match)."
          },
          "orderDate": {
            "type": "string",
            "description": "Order date. Defaults to today if omitted.",
            "format": "date",
            "nullable": true
          },
          "expectedDeliveryDate": {
            "type": "string",
            "description": "Date the goods are expected to arrive. Calculated from the supplier lead time if omitted.",
            "format": "date",
            "nullable": true
          },
          "warehouseCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Code of the warehouse to receive into. Defaults to the tenant's default warehouse.",
            "nullable": true
          },
          "currencyCode": {
            "maxLength": 3,
            "pattern": "^[A-Z]{3}$",
            "type": "string",
            "description": "ISO 4217 currency code, e.g. `SEK`, `EUR`. Defaults to the supplier's currency.",
            "nullable": true
          },
          "paymentTermCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Payment term code — overrides the supplier default.",
            "nullable": true
          },
          "deliveryTermCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Delivery term / Incoterm code — overrides the supplier default.",
            "nullable": true
          },
          "shippingMethodCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Shipping method / carrier code — overrides the supplier default.",
            "nullable": true
          },
          "supplierReference": {
            "maxLength": 100,
            "type": "string",
            "description": "Our reference at the supplier, or the supplier's own order number.",
            "nullable": true
          },
          "externalNotes": {
            "maxLength": 2000,
            "type": "string",
            "description": "Free-text notes printed on the purchase order document.",
            "nullable": true
          },
          "orderNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Custom order number. Auto-generated if omitted. Returns 409 if already in use.",
            "nullable": true
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreatePurchaseOrderLineInput"
            },
            "description": "Purchase order lines to create atomically with the order.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateSupplierRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string",
            "description": "Full company name."
          },
          "supplierNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Custom supplier number. Auto-generated from the tenant number sequence if omitted.",
            "nullable": true
          },
          "currencyCode": {
            "maxLength": 3,
            "pattern": "^[A-Z]{3}$",
            "type": "string",
            "description": "ISO 4217 currency code purchase orders are placed in, e.g. `SEK`, `EUR`. Defaults to the tenant base currency.",
            "nullable": true
          },
          "organizationNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Company registration number / org.nr.",
            "nullable": true
          },
          "contactPerson": {
            "maxLength": 200,
            "type": "string",
            "description": "Primary contact person at the supplier.",
            "nullable": true
          },
          "purchaseOrderEmail": {
            "maxLength": 200,
            "type": "string",
            "description": "Email address purchase orders are sent to.",
            "format": "email",
            "nullable": true
          },
          "phone": {
            "maxLength": 50,
            "type": "string",
            "description": "Primary phone number.",
            "nullable": true
          },
          "street1": {
            "maxLength": 200,
            "type": "string",
            "description": "Street address line 1.",
            "nullable": true
          },
          "street2": {
            "maxLength": 200,
            "type": "string",
            "description": "Street address line 2 — c/o, suite, etc.",
            "nullable": true
          },
          "postalCode": {
            "maxLength": 20,
            "type": "string",
            "description": "Postal / ZIP code.",
            "nullable": true
          },
          "city": {
            "maxLength": 100,
            "type": "string",
            "description": "City name.",
            "nullable": true
          },
          "countryCode": {
            "maxLength": 2,
            "pattern": "^[A-Z]{2}$",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`, `DE`.",
            "nullable": true
          },
          "paymentTermCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Payment term code — see GET /preview/reference/payment-terms.",
            "nullable": true
          },
          "deliveryTermCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Delivery term / Incoterm code — see GET /preview/reference/delivery-terms.",
            "nullable": true
          },
          "leadTimeDays": {
            "maximum": 3650,
            "minimum": 0,
            "type": "integer",
            "description": "Default lead time in calendar days from order to delivery.",
            "format": "int32",
            "nullable": true
          },
          "notes": {
            "maxLength": 2000,
            "type": "string",
            "description": "Free-text internal notes (not visible to the supplier).",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CrossReferenceType": {
        "enum": [
          "Manufacturer",
          "Oem",
          "IndustryStandard",
          "Superseded",
          "Competitor",
          "Barcode",
          "Custom"
        ],
        "type": "string"
      },
      "ItemStatus": {
        "enum": [
          "Draft",
          "PendingApproval",
          "Active",
          "PhasingOut",
          "Discontinued",
          "Archived"
        ],
        "type": "string"
      },
      "ItemType": {
        "enum": [
          "StockItem",
          "NonStockItem",
          "Service",
          "Kit",
          "Phantom",
          "Charge",
          "VariantMaster"
        ],
        "type": "string"
      },
      "PagedResult_PublicConfigurationResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicCustomerAddressResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicCustomerAddressResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicCustomerContactResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicCustomerContactResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicCustomerResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicCustomerResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicItemAssetResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicItemAssetResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicItemResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicItemResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicOrderListItem": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicOrderListItem"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicPurchaseOrderLineResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicPurchaseOrderLineResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicPurchaseOrderListItem": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicPurchaseOrderListItem"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicShipmentResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicShipmentResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicSupplierContactResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSupplierContactResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicSupplierItemResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSupplierItemResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PagedResult_PublicSupplierResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSupplierResponse"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hasPreviousPage": {
            "type": "boolean",
            "readOnly": true
          },
          "hasNextPage": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "PatchCustomerRequest": {
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "type": "string",
            "description": "Full company or person name.",
            "nullable": true
          },
          "organizationNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Company registration number / org.nr. Pass `null` to clear.",
            "nullable": true
          },
          "vatNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "VAT registration number. Pass `null` to clear.",
            "nullable": true
          },
          "invoiceEmail": {
            "maxLength": 200,
            "type": "string",
            "description": "Email address for invoices and order confirmations. Pass `null` to clear.",
            "format": "email",
            "nullable": true
          },
          "phone": {
            "maxLength": 50,
            "type": "string",
            "description": "Primary phone number. Pass `null` to clear.",
            "nullable": true
          },
          "street1": {
            "maxLength": 200,
            "type": "string",
            "description": "Street address line 1. Pass `null` to clear.",
            "nullable": true
          },
          "street2": {
            "maxLength": 200,
            "type": "string",
            "description": "Street address line 2 — suite, c/o, etc. Pass `null` to clear.",
            "nullable": true
          },
          "postalCode": {
            "maxLength": 20,
            "type": "string",
            "description": "Postal / ZIP code. Pass `null` to clear.",
            "nullable": true
          },
          "city": {
            "maxLength": 100,
            "type": "string",
            "description": "City name. Pass `null` to clear.",
            "nullable": true
          },
          "countryCode": {
            "maxLength": 2,
            "pattern": "^[A-Z]{2}$",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`, `DE`. Pass `null` to clear.",
            "nullable": true
          },
          "defaultCurrencyCode": {
            "maxLength": 3,
            "pattern": "^[A-Z]{3}$",
            "type": "string",
            "description": "ISO 4217 currency code, e.g. `SEK`, `EUR`. Pass `null` to clear.",
            "nullable": true
          },
          "notes": {
            "maxLength": 2000,
            "type": "string",
            "description": "Free-text internal notes. Pass `null` to clear.",
            "nullable": true
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the customer is active. Inactive customers cannot be placed on new orders.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PatchItemRequest": {
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "type": "string",
            "description": "Display name / product name.",
            "nullable": true
          },
          "description": {
            "maxLength": 2000,
            "type": "string",
            "description": "Long-form description, e.g. for a webshop product page. Pass `null` to clear.",
            "nullable": true
          },
          "barcode": {
            "maxLength": 50,
            "type": "string",
            "description": "EAN / GTIN barcode or other scanning code. Pass `null` to clear.",
            "nullable": true
          },
          "costPrice": {
            "type": "number",
            "description": "Purchase / cost price in the tenant default currency. Pass `null` to clear.",
            "format": "double",
            "nullable": true
          },
          "salesPrice": {
            "type": "number",
            "description": "Default sales price in the tenant default currency. Pass `null` to clear.",
            "format": "double",
            "nullable": true
          },
          "netWeight": {
            "type": "number",
            "description": "Net weight in kilograms. Pass `null` to clear.",
            "format": "double",
            "nullable": true
          },
          "width": {
            "type": "number",
            "description": "Width in centimetres. Pass `null` to clear.",
            "format": "double",
            "nullable": true
          },
          "height": {
            "type": "number",
            "description": "Height in centimetres. Pass `null` to clear.",
            "format": "double",
            "nullable": true
          },
          "depth": {
            "type": "number",
            "description": "Depth in centimetres. Pass `null` to clear.",
            "format": "double",
            "nullable": true
          },
          "hsCode": {
            "maxLength": 20,
            "type": "string",
            "description": "Harmonized System (HS / KN) customs tariff code. Pass `null` to clear.",
            "nullable": true
          },
          "countryOfOrigin": {
            "pattern": "^[A-Z]{2}$",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country of manufacture, e.g. `SE`, `CN`. Pass `null` to clear.",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/ItemStatus"
          },
          "itemType": {
            "$ref": "#/components/schemas/ItemType"
          },
          "publishOnWeb": {
            "type": "boolean",
            "description": "Whether the item is published on the webshop.",
            "nullable": true
          },
          "salesStartDate": {
            "type": "string",
            "description": "Date from which the item can be sold. Pass `null` to clear.",
            "format": "date",
            "nullable": true
          },
          "salesEndDate": {
            "type": "string",
            "description": "Date until which the item can be sold. Pass `null` to clear.",
            "format": "date",
            "nullable": true
          },
          "allowPreOrder": {
            "type": "boolean",
            "description": "Whether customers can pre-order the item before it is in stock.",
            "nullable": true
          },
          "allowBackorder": {
            "type": "boolean",
            "description": "Whether customers can back-order the item when it is out of stock.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PatchOrderLineRequest": {
        "type": "object",
        "properties": {
          "quantity": {
            "type": "number",
            "description": "Ordered quantity. Must be greater than zero. Cannot be null.",
            "format": "double",
            "nullable": true
          },
          "unitPrice": {
            "type": "number",
            "description": "Net unit price in the order currency. Cannot be null.",
            "format": "double",
            "nullable": true
          },
          "discountPercent": {
            "type": "number",
            "description": "Line discount in percent (0–100). Pass `null` to clear.",
            "format": "double",
            "nullable": true
          },
          "unit": {
            "type": "string",
            "description": "Unit of measure code, e.g. `st`, `kg`.",
            "nullable": true
          },
          "requestedDeliveryDate": {
            "type": "string",
            "description": "Requested delivery date for this line. Pass `null` to clear.",
            "format": "date",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "description": "Free-text line notes. Pass `null` to clear.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PatchPurchaseOrderLineRequest": {
        "type": "object",
        "properties": {
          "quantity": {
            "type": "number",
            "description": "Ordered quantity. Must be greater than zero. Cannot be null.",
            "format": "double",
            "nullable": true
          },
          "unitPrice": {
            "type": "number",
            "description": "Purchase price per unit in the order currency. Cannot be null.",
            "format": "double",
            "nullable": true
          },
          "unit": {
            "type": "string",
            "description": "Unit of measure code, e.g. `st`, `kg`. Cannot be null.",
            "nullable": true
          },
          "expectedDate": {
            "type": "string",
            "description": "Expected delivery date for this line. Pass `null` to clear.",
            "format": "date",
            "nullable": true
          },
          "promisedDeliveryDate": {
            "type": "string",
            "description": "Delivery date promised by the supplier. Pass `null` to clear.",
            "format": "date",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "description": "Free-text line notes. Pass `null` to clear.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PatchPurchaseOrderRequest": {
        "type": "object",
        "properties": {
          "orderDate": {
            "type": "string",
            "description": "Order date. Cannot be null.",
            "format": "date",
            "nullable": true
          },
          "expectedDeliveryDate": {
            "type": "string",
            "description": "Date the goods are expected to arrive. Pass `null` to clear.",
            "format": "date",
            "nullable": true
          },
          "promisedDeliveryDate": {
            "type": "string",
            "description": "Delivery date promised by the supplier. Pass `null` to clear.",
            "format": "date",
            "nullable": true
          },
          "warehouseCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Code of the warehouse to receive into. Cannot be null.",
            "nullable": true
          },
          "currencyCode": {
            "maxLength": 3,
            "pattern": "^[A-Z]{3}$",
            "type": "string",
            "description": "ISO 4217 currency code, e.g. `SEK`, `EUR`. Cannot be null.",
            "nullable": true
          },
          "paymentTermCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Payment term code. Pass `null` to clear.",
            "nullable": true
          },
          "deliveryTermCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Delivery term / Incoterm code. Pass `null` to clear.",
            "nullable": true
          },
          "shippingMethodCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Shipping method / carrier code. Pass `null` to clear.",
            "nullable": true
          },
          "supplierReference": {
            "maxLength": 100,
            "type": "string",
            "description": "Our reference at the supplier, or the supplier's order number. Pass `null` to clear.",
            "nullable": true
          },
          "externalNotes": {
            "maxLength": 2000,
            "type": "string",
            "description": "Free-text notes printed on the purchase order document. Pass `null` to clear.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PatchSupplierRequest": {
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "type": "string",
            "description": "Full company name.",
            "nullable": true
          },
          "organizationNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Company registration number / org.nr. Pass `null` to clear.",
            "nullable": true
          },
          "contactPerson": {
            "maxLength": 200,
            "type": "string",
            "description": "Primary contact person at the supplier. Pass `null` to clear.",
            "nullable": true
          },
          "purchaseOrderEmail": {
            "maxLength": 200,
            "type": "string",
            "description": "Email address purchase orders are sent to. Pass `null` to clear.",
            "format": "email",
            "nullable": true
          },
          "phone": {
            "maxLength": 50,
            "type": "string",
            "description": "Primary phone number. Pass `null` to clear.",
            "nullable": true
          },
          "street1": {
            "maxLength": 200,
            "type": "string",
            "description": "Street address line 1. Pass `null` to clear.",
            "nullable": true
          },
          "street2": {
            "maxLength": 200,
            "type": "string",
            "description": "Street address line 2 — c/o, suite, etc. Pass `null` to clear.",
            "nullable": true
          },
          "postalCode": {
            "maxLength": 20,
            "type": "string",
            "description": "Postal / ZIP code. Pass `null` to clear.",
            "nullable": true
          },
          "city": {
            "maxLength": 100,
            "type": "string",
            "description": "City name. Pass `null` to clear.",
            "nullable": true
          },
          "countryCode": {
            "maxLength": 2,
            "pattern": "^[A-Z]{2}$",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`, `DE`. Pass `null` to clear.",
            "nullable": true
          },
          "currencyCode": {
            "maxLength": 3,
            "pattern": "^[A-Z]{3}$",
            "type": "string",
            "description": "ISO 4217 currency code, e.g. `SEK`, `EUR`. Cannot be null.",
            "nullable": true
          },
          "leadTimeDays": {
            "maximum": 3650,
            "minimum": 0,
            "type": "integer",
            "description": "Default lead time in calendar days. Pass `null` to clear.",
            "format": "int32",
            "nullable": true
          },
          "ourCustomerNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Our customer number at the supplier. Pass `null` to clear.",
            "nullable": true
          },
          "website": {
            "maxLength": 500,
            "type": "string",
            "description": "Supplier website URL. Pass `null` to clear.",
            "nullable": true
          },
          "languageCode": {
            "maxLength": 10,
            "type": "string",
            "description": "ISO 639-1 language code for purchase order documents. Pass `null` to clear.",
            "nullable": true
          },
          "notes": {
            "maxLength": 2000,
            "type": "string",
            "description": "Free-text internal notes. Pass `null` to clear.",
            "nullable": true
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the supplier is active. Inactive suppliers cannot be used on new purchase orders.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "PublicConfigurationCalculationResponse": {
        "type": "object",
        "properties": {
          "itemNumber": {
            "type": "string",
            "description": "Item number of the configured product.",
            "nullable": true
          },
          "itemName": {
            "type": "string",
            "description": "Display name of the configured product.",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "The quantity the price was calculated for.",
            "format": "double"
          },
          "isValid": {
            "type": "boolean",
            "description": "Whether the configuration is complete and within bounds. When false, the price fields are null."
          },
          "validationErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationValidationError"
            },
            "description": "Every problem found, one entry per offending feature. Empty when `isValid` is true.",
            "nullable": true
          },
          "resolvedValues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationResolvedValue"
            },
            "description": "The resolved numeric values, including those derived by formula (area, fabric consumption, …). Show these back to the customer. Empty when the configuration is invalid.",
            "nullable": true
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 code the amounts below are expressed in. Null when the configuration is invalid.",
            "nullable": true
          },
          "basePricePerUnit": {
            "type": "number",
            "description": "The item's own price per unit from the price engine — the same number GET /preview/items/{itemNumber}/price returns. Null when the configuration is invalid.",
            "format": "double",
            "nullable": true
          },
          "configurationSurchargePerUnit": {
            "type": "number",
            "description": "What the chosen options add per unit. Null when the configuration is invalid.",
            "format": "double",
            "nullable": true
          },
          "unitPrice": {
            "type": "number",
            "description": "Base price plus surcharge — the unit price the order line will get. Null when the configuration is invalid.",
            "format": "double",
            "nullable": true
          },
          "totalPrice": {
            "type": "number",
            "description": "Unit price × quantity, excluding VAT, shipping and order-level discounts. Null when the configuration is invalid.",
            "format": "double",
            "nullable": true
          },
          "priceSource": {
            "type": "string",
            "description": "Where the base price came from in the price hierarchy, e.g. `CustomerPriceList`, `ItemSalesPrice`, `NotFound`. Null when the configuration is invalid.",
            "nullable": true
          },
          "priceListName": {
            "type": "string",
            "description": "Name of the price list that produced the base price. Null when no price list matched.",
            "nullable": true
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationComponent"
            },
            "description": "The exploded bill of materials. Only present when `?includeBreakdown=true`.",
            "nullable": true
          },
          "operations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationOperation"
            },
            "description": "The exploded production steps. Only present when `?includeBreakdown=true`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The result of pricing and validating a configuration, returned by\r\nPOST /preview/configurations/calculate. Nothing is saved.\r\n\r\nAn incomplete or out-of-range configuration is a normal state while the customer is still\r\nchoosing, so it comes back as `200` with `isValid: false` and every problem listed in\r\n`validationErrors` — not as an error response. The price fields are then null."
      },
      "PublicConfigurationComponent": {
        "type": "object",
        "properties": {
          "itemNumber": {
            "type": "string",
            "description": "Item number of the component.",
            "nullable": true
          },
          "itemName": {
            "type": "string",
            "description": "Display name of the component.",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "Quantity needed for the whole configured quantity.",
            "format": "double"
          },
          "unitCode": {
            "type": "string",
            "description": "Code of the component's base unit, e.g. `m`. Null if not set.",
            "nullable": true
          },
          "sourceFeatureCode": {
            "type": "string",
            "description": "Code of the feature that added this component, when it came from a choice rather than the static bill of materials. Null otherwise.",
            "nullable": true
          },
          "isQuantityFromFormula": {
            "type": "boolean",
            "description": "Whether the quantity was computed from a formula (e.g. fabric from width × height) rather than being fixed."
          }
        },
        "additionalProperties": false,
        "description": "A material line the configuration explodes into."
      },
      "PublicConfigurationFeature": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable code — the business key used in `values[].featureCode`, e.g. `WIDTH`. Unique per item.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name / field label, e.g. `Width (cm)`.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Help text for the field. Null if not set.",
            "nullable": true
          },
          "featureType": {
            "$ref": "#/components/schemas/PublicItemFeatureType"
          },
          "isRequired": {
            "type": "boolean",
            "description": "Whether a value is required. A configuration missing a required value is reported as invalid, not rejected."
          },
          "requiresMeasurement": {
            "type": "boolean",
            "description": "Whether the value is expected to come from an on-site measurement rather than being picked by the customer."
          },
          "sortOrder": {
            "type": "integer",
            "description": "Presentation order, ascending.",
            "format": "int32"
          },
          "defaultValue": {
            "type": "string",
            "description": "Default value as a string, to prefill the field. Interpret according to `featureType`. Null if not set.",
            "nullable": true
          },
          "minValue": {
            "type": "number",
            "description": "Lowest accepted value for `Number` features. Null for other types.",
            "format": "double",
            "nullable": true
          },
          "maxValue": {
            "type": "number",
            "description": "Highest accepted value for `Number` features. Null for other types.",
            "format": "double",
            "nullable": true
          },
          "affectsPrice": {
            "type": "boolean",
            "description": "Whether the field's value changes the price."
          },
          "priceImpactPerUnit": {
            "type": "number",
            "description": "Price change per unit of the value, in the tenant base currency. For `Number` it is multiplied by the value, for `Boolean` it applies once when true. Null when the field does not affect the price.",
            "format": "double",
            "nullable": true
          },
          "selectableItemCategoryCode": {
            "type": "string",
            "description": "For `ItemSelection`: the category the selectable items are restricted to. Pass it as `?categoryCode=` to GET /preview/items to build the picker. Items outside the category are rejected. Null when unrestricted.",
            "nullable": true
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationOption"
            },
            "description": "For `Selection`: the allowed choices, in presentation order. Empty for other types.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One configurable field on an item."
      },
      "PublicConfigurationOperation": {
        "type": "object",
        "properties": {
          "sequence": {
            "type": "integer",
            "description": "Position in the routing, ascending.",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "description": "Name of the step, e.g. `Cut`, `Sew`.",
            "nullable": true
          },
          "plannedDurationMinutes": {
            "type": "integer",
            "description": "Planned duration in minutes, including setup.",
            "format": "int32"
          },
          "setupTimeMinutes": {
            "type": "integer",
            "description": "Setup time in minutes, included in `plannedDurationMinutes`.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "A production step the configuration explodes into."
      },
      "PublicConfigurationOption": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable code — the business key used in `values[].optionCode`. Unique per feature.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name of the choice, e.g. `Natural linen`.",
            "nullable": true
          },
          "sortOrder": {
            "type": "integer",
            "description": "Presentation order, ascending.",
            "format": "int32"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is the preselected choice."
          },
          "priceImpact": {
            "type": "number",
            "description": "Price change when this choice is picked, in the tenant base currency. Null when the choice is free.\r\n\r\n<b>Ignored when `linkedItemNumber` is set.</b> A linked item is added to the bill of materials\r\nas a cost line, not as a sales line, so such a choice does not change the customer's\r\n`unitPrice` at all. Price a choice by giving it a `priceImpact`<i>without</i> a linked\r\nitem, or by driving the price from a `Calculated` feature.",
            "format": "double",
            "nullable": true
          },
          "linkedItemNumber": {
            "type": "string",
            "description": "The item this choice adds to the bill of materials, e.g. the actual fabric article. Affects what gets built and its cost, not the sales price — see PublicApi.Preview.Configurations.Queries.PublicConfigurationOption.PriceImpact. Null when the choice has no material of its own.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One allowed choice on a `Selection` feature."
      },
      "PublicConfigurationResolvedValue": {
        "type": "object",
        "properties": {
          "featureCode": {
            "type": "string",
            "description": "Code of the feature.",
            "nullable": true
          },
          "featureName": {
            "type": "string",
            "description": "Display name of the feature.",
            "nullable": true
          },
          "value": {
            "type": "number",
            "description": "The resolved value. Booleans resolve to 1 or 0.",
            "format": "double"
          },
          "isCalculated": {
            "type": "boolean",
            "description": "Whether the value was derived by formula rather than entered by the customer."
          }
        },
        "additionalProperties": false,
        "description": "A resolved numeric value — entered, or derived from other values by a formula."
      },
      "PublicConfigurationResponse": {
        "type": "object",
        "properties": {
          "configurationNumber": {
            "type": "string",
            "description": "Unique configuration number — business key, e.g. `WO-1042`. Use it in every follow-up call.",
            "nullable": true
          },
          "itemNumber": {
            "type": "string",
            "description": "Item number of the configured product.",
            "nullable": true
          },
          "itemName": {
            "type": "string",
            "description": "Display name of the configured product.",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "Free-text title. Defaults to the item name when not supplied.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Free-text description, e.g. which window the curtain is for. Null if not set.",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "How many units of the configured product. Expressed in the item's base unit.",
            "format": "double"
          },
          "customerNumber": {
            "type": "string",
            "description": "Customer number the configuration belongs to. Required before it can become an order. Null when the configuration is anonymous.",
            "nullable": true
          },
          "customerName": {
            "type": "string",
            "description": "Customer name. Null when the configuration is anonymous.",
            "nullable": true
          },
          "warehouseCode": {
            "type": "string",
            "description": "Warehouse code the configuration is planned against. Null when not set.",
            "nullable": true
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationValue"
            },
            "description": "The chosen values, one per feature that has a value.",
            "nullable": true
          },
          "configurationPriceImpact": {
            "type": "number",
            "description": "Total configuration surcharge for the whole quantity, in the tenant base currency, before the price engine runs. The priced fields below express the same thing in the customer's currency.",
            "format": "double"
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 code the priced fields below are expressed in. Null on the list endpoint — see the note on PublicApi.Preview.Configurations.Queries.PublicConfigurationResponse.UnitPrice.",
            "nullable": true
          },
          "basePricePerUnit": {
            "type": "number",
            "description": "The item's own price per unit from the price engine. Null on the list endpoint.",
            "format": "double",
            "nullable": true
          },
          "configurationSurchargePerUnit": {
            "type": "number",
            "description": "What the chosen options add per unit. Null on the list endpoint.",
            "format": "double",
            "nullable": true
          },
          "unitPrice": {
            "type": "number",
            "description": "Base price plus surcharge — the unit price the order line will get, priced as of now.\r\n\r\nOnly populated when a single configuration is returned (create, get by number, reconfigure).\r\nOn GET /preview/configurations it is `null`: pricing a whole page would mean one price\r\nengine run per row. Read one configuration, or use POST /preview/configurations/calculate,\r\nwhen you need the price for a list.",
            "format": "double",
            "nullable": true
          },
          "totalPrice": {
            "type": "number",
            "description": "Unit price × quantity, excluding VAT, freight and order-level discounts. Null on the list endpoint.",
            "format": "double",
            "nullable": true
          },
          "priceSource": {
            "type": "string",
            "description": "Where the base price came from in the price hierarchy, e.g. `CustomerPriceList`. Null on the list endpoint.",
            "nullable": true
          },
          "priceListName": {
            "type": "string",
            "description": "Name of the price list that produced the base price. Null when no price list matched or on the list endpoint.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "UTC timestamp when the configuration was created.",
            "format": "date-time"
          },
          "modifiedDate": {
            "type": "string",
            "description": "UTC timestamp of the last modification. Null if never modified after creation.",
            "format": "date-time",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/PublicLinks"
          }
        },
        "additionalProperties": false,
        "description": "A saved configuration — a specific set of choices for a configurable item, priced and ready to be\r\nturned into a sales order. Returned by POST /preview/configurations, GET /preview/configurations\r\nand POST /preview/configurations/{configurationNumber}/reconfigure."
      },
      "PublicConfigurationValidationError": {
        "type": "object",
        "properties": {
          "featureCode": {
            "type": "string",
            "description": "Code of the feature the problem belongs to.",
            "nullable": true
          },
          "code": {
            "type": "string",
            "description": "Stable error code, e.g. `FeatureExplosion.RequiredFeatureMissing`, `FeatureExplosion.ValueOutOfRange`, `FeatureExplosion.InvalidOption`.",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A problem with one chosen value, meant to be shown at the corresponding form field."
      },
      "PublicConfigurationValue": {
        "type": "object",
        "properties": {
          "featureCode": {
            "type": "string",
            "description": "Code of the feature this value belongs to.",
            "nullable": true
          },
          "featureName": {
            "type": "string",
            "description": "Display name of the feature.",
            "nullable": true
          },
          "featureType": {
            "$ref": "#/components/schemas/PublicItemFeatureType"
          },
          "number": {
            "type": "number",
            "description": "Numeric value, for `Number` and `Calculated` features. Null otherwise.",
            "format": "double",
            "nullable": true
          },
          "text": {
            "type": "string",
            "description": "Text value, for `Text` features. Null otherwise.",
            "nullable": true
          },
          "boolean": {
            "type": "boolean",
            "description": "Boolean value, for `Boolean` features. Null otherwise.",
            "nullable": true
          },
          "optionCode": {
            "type": "string",
            "description": "Code of the chosen option, for `Selection` features. Null otherwise.",
            "nullable": true
          },
          "optionName": {
            "type": "string",
            "description": "Display name of the chosen option. Null unless `optionCode` is set.",
            "nullable": true
          },
          "itemNumber": {
            "type": "string",
            "description": "Item number of the chosen item, for `ItemSelection` features. Null otherwise.",
            "nullable": true
          },
          "isMeasured": {
            "type": "boolean",
            "description": "Whether the value came from an on-site measurement."
          }
        },
        "additionalProperties": false,
        "description": "One chosen value on a saved configuration. Exactly one value field is set, matching `featureType`."
      },
      "PublicConfigurationValueInput": {
        "required": [
          "featureCode"
        ],
        "type": "object",
        "properties": {
          "featureCode": {
            "maxLength": 50,
            "minLength": 1,
            "type": "string",
            "description": "Code of the feature being set, e.g. `WIDTH`. Must exist on the item."
          },
          "number": {
            "type": "number",
            "description": "Value for a `Number` feature, e.g. `\"240\"`.",
            "format": "double",
            "nullable": true
          },
          "text": {
            "maxLength": 500,
            "type": "string",
            "description": "Value for a `Text` feature.",
            "nullable": true
          },
          "boolean": {
            "type": "boolean",
            "description": "Value for a `Boolean` feature.",
            "nullable": true
          },
          "optionCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Code of the chosen option for a `Selection` feature. Must belong to that feature.",
            "nullable": true
          },
          "itemNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Item number of the chosen item for an `ItemSelection` feature.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One chosen value in a configuration request. Shared by POST /preview/configurations/calculate,\r\nPOST /preview/configurations and POST /preview/configurations/{configurationNumber}/reconfigure\r\nso the same payload works throughout the flow.\r\n\r\nSend exactly the field that matches the feature's `featureType` from\r\nGET /preview/items/{itemNumber}/configuration; the others are ignored. `Calculated` features\r\ntake no input — their result comes back in `resolvedValues`."
      },
      "PublicCurrencyResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "ISO 4217 currency code, e.g. `SEK`, `EUR`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name of the currency, e.g. `Swedish Krona`.",
            "nullable": true
          },
          "symbol": {
            "type": "string",
            "description": "Currency symbol, e.g. `kr`, `€`. Null if not configured.",
            "nullable": true
          },
          "exchangeRate": {
            "type": "number",
            "description": "Exchange rate relative to the tenant base currency. Serialised as a decimal string.",
            "format": "double"
          },
          "decimalPlaces": {
            "type": "integer",
            "description": "Number of decimal places used when displaying amounts in this currency.",
            "format": "int32"
          },
          "isBase": {
            "type": "boolean",
            "description": "Whether this is the tenant's base / accounting currency."
          }
        },
        "additionalProperties": false,
        "description": "Currency available in the tenant."
      },
      "PublicCustomerAddressResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier of the address.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Recipient company or person name.",
            "nullable": true
          },
          "street1": {
            "type": "string",
            "description": "Street address line 1.",
            "nullable": true
          },
          "street2": {
            "type": "string",
            "description": "Street address line 2 (c/o, suite, etc.). Null if not set.",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "description": "Postal / ZIP code.",
            "nullable": true
          },
          "city": {
            "type": "string",
            "description": "City name.",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`.",
            "nullable": true
          },
          "contactPerson": {
            "type": "string",
            "description": "Contact person at the delivery address. Null if not set.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Phone number at the delivery address. Null if not set.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Email address at the delivery address. Null if not set.",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is the customer's default delivery address."
          }
        },
        "additionalProperties": false,
        "description": "Delivery address registered on a customer."
      },
      "PublicCustomerContactResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier — usable as `customerContactId` in order creation.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Full name of the contact person.",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "Job title, e.g. `Purchasing Manager`. Null if not set.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Email address. Null if not set.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Phone number. Null if not set.",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "description": "Mobile phone number. Null if not set.",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is the customer's default contact."
          }
        },
        "additionalProperties": false,
        "description": "Contact person registered on a customer."
      },
      "PublicCustomerResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier (UUID v7).",
            "format": "uuid"
          },
          "customerNumber": {
            "type": "string",
            "description": "Unique customer number — business key used in all URL references.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Full company or person name.",
            "nullable": true
          },
          "organizationNumber": {
            "type": "string",
            "description": "Company registration number / org.nr, e.g. `5560001234`. Null if not set.",
            "nullable": true
          },
          "vatNumber": {
            "type": "string",
            "description": "VAT registration number, e.g. `SE556000123401`. Null if not set.",
            "nullable": true
          },
          "invoiceEmail": {
            "type": "string",
            "description": "Primary email address for invoices and order confirmations. Null if not set.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Primary phone number. Null if not set.",
            "nullable": true
          },
          "street1": {
            "type": "string",
            "description": "Street address line 1. Null if not set.",
            "nullable": true
          },
          "street2": {
            "type": "string",
            "description": "Street address line 2 (suite, c/o, etc.). Null if not set.",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "description": "Postal / ZIP code. Null if not set.",
            "nullable": true
          },
          "city": {
            "type": "string",
            "description": "City name. Null if not set.",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`, `DE`, `NO`. Null if not set.",
            "nullable": true
          },
          "defaultCurrencyCode": {
            "type": "string",
            "description": "ISO 4217 currency code of the customer's default currency, e.g. `SEK`, `EUR`. Null if not set.",
            "nullable": true
          },
          "paymentTermCode": {
            "type": "string",
            "description": "Code of the customer's default payment term — usable as `paymentTermCode` in order creation. Null if not set.",
            "nullable": true
          },
          "paymentTermName": {
            "type": "string",
            "description": "Name of the customer's default payment term. Null if not set.",
            "nullable": true
          },
          "deliveryTermCode": {
            "type": "string",
            "description": "Code of the customer's default delivery term — usable as `deliveryTermCode` in order creation. Null if not set.",
            "nullable": true
          },
          "deliveryTermName": {
            "type": "string",
            "description": "Name of the customer's default delivery term. Null if not set.",
            "nullable": true
          },
          "customerGroupCode": {
            "type": "string",
            "description": "Code of the customer group this customer belongs to. Null if not set.",
            "nullable": true
          },
          "customerGroupName": {
            "type": "string",
            "description": "Name of the customer group this customer belongs to. Null if not set.",
            "nullable": true
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the customer is active. Inactive customers cannot be used on new orders."
          },
          "notes": {
            "type": "string",
            "description": "Free-text internal notes (not visible to the customer). Null if not set.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "UTC timestamp when the customer record was created.",
            "format": "date-time"
          },
          "modifiedDate": {
            "type": "string",
            "description": "UTC timestamp of the last modification. Null if never modified after creation.",
            "format": "date-time",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/PublicLinks"
          }
        },
        "additionalProperties": false,
        "description": "Customer details returned by GET /preview/customers/{customerNumber} and the list endpoint."
      },
      "PublicDeliveryAddressResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Recipient company or person name.",
            "nullable": true
          },
          "street1": {
            "type": "string",
            "description": "Street address line 1.",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "description": "Postal / ZIP code.",
            "nullable": true
          },
          "city": {
            "type": "string",
            "description": "City name.",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`.",
            "nullable": true
          },
          "street2": {
            "type": "string",
            "description": "Street address line 2 (c/o, suite, etc.). Null if not set.",
            "nullable": true
          },
          "contactPerson": {
            "type": "string",
            "description": "Contact person at the delivery address. Null if not set.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Phone number at the delivery address. Null if not set.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Email address at the delivery address. Null if not set.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Delivery address attached to a sales order."
      },
      "PublicDeliveryTermResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Unique code used as `deliveryTermCode` in order creation, e.g. `DAP`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name of the delivery term.",
            "nullable": true
          },
          "isDefaultSales": {
            "type": "boolean",
            "description": "Whether this is the default delivery term for new sales orders."
          }
        },
        "additionalProperties": false,
        "description": "Delivery term / Incoterm available on sales orders and customers."
      },
      "PublicItemAssetResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier of the asset.",
            "format": "uuid"
          },
          "assetType": {
            "$ref": "#/components/schemas/AssetType"
          },
          "category": {
            "$ref": "#/components/schemas/AssetCategory"
          },
          "url": {
            "type": "string",
            "description": "URL to download the full asset. Either an external URL or a /preview download endpoint (requires the same API key).",
            "nullable": true
          },
          "thumbnailUrl": {
            "type": "string",
            "description": "URL to a thumbnail rendition. Null if no thumbnail exists.",
            "nullable": true
          },
          "fileName": {
            "type": "string",
            "description": "Original file name, e.g. `widget-pro-front.jpg`.",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "description": "Display name for UI listings. Null if not set.",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "description": "Alt text for images (SEO/accessibility). Null if not set.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Free-text description. Null if not set.",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "description": "MIME content type, e.g. `image/jpeg`, `application/pdf`.",
            "nullable": true
          },
          "fileSize": {
            "type": "integer",
            "description": "File size in bytes.",
            "format": "int64"
          },
          "width": {
            "type": "integer",
            "description": "Image width in pixels. Null for non-images or if unknown.",
            "format": "int32",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "description": "Image height in pixels. Null for non-images or if unknown.",
            "format": "int32",
            "nullable": true
          },
          "isPrimary": {
            "type": "boolean",
            "description": "Whether this is the item's primary image (used as thumbnail in item responses)."
          },
          "languageCode": {
            "type": "string",
            "description": "ISO 639-1 language code if the asset is language-specific, e.g. `sv`. Null if language-neutral.",
            "nullable": true
          },
          "sortOrder": {
            "type": "integer",
            "description": "Sort order for galleries (ascending).",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "An image or document attached to an item."
      },
      "PublicItemAttribute": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable attribute code, e.g. `MATERIAL`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name of the attribute, e.g. `Material`.",
            "nullable": true
          },
          "value": {
            "type": "string",
            "description": "The attribute value formatted as a string (numbers use invariant format, dates ISO 8601, booleans `true`/`false`).",
            "nullable": true
          },
          "dataType": {
            "$ref": "#/components/schemas/AttributeDataType"
          },
          "unit": {
            "type": "string",
            "description": "Unit of the value, e.g. `mm`, `W`. Null if not applicable.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A specification attribute value on an item."
      },
      "PublicItemAvailabilityResponse": {
        "type": "object",
        "properties": {
          "itemNumber": {
            "type": "string",
            "description": "Item number of the item.",
            "nullable": true
          },
          "totalQuantityOnHand": {
            "type": "number",
            "description": "Total physical quantity on hand across all warehouses. Serialised as a decimal string.",
            "format": "double"
          },
          "totalAllocatedQuantity": {
            "type": "number",
            "description": "Total quantity reserved for orders across all warehouses. Serialised as a decimal string.",
            "format": "double"
          },
          "totalAvailableQuantity": {
            "type": "number",
            "description": "Total quantity available for new orders (on hand − allocated). Serialised as a decimal string.",
            "format": "double"
          },
          "warehouses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicWarehouseAvailability"
            },
            "description": "Per-warehouse breakdown. Empty list if the item is not stocked in any warehouse.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Stock availability for an item, summed across warehouses and broken down per warehouse."
      },
      "PublicItemCategoryAssignment": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable category code, e.g. `TOOLS-HAND`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name of the category.",
            "nullable": true
          },
          "isPrimary": {
            "type": "boolean",
            "description": "Whether the category belongs to the primary category type (the main product hierarchy)."
          }
        },
        "additionalProperties": false,
        "description": "A category the item is assigned to."
      },
      "PublicItemConfigurationResponse": {
        "type": "object",
        "properties": {
          "itemNumber": {
            "type": "string",
            "description": "Unique item number — business key, e.g. `CURTAIN-PLEAT`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name / product name.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Long-form description. Null if not set.",
            "nullable": true
          },
          "isConfigurable": {
            "type": "boolean",
            "description": "Whether the item has any configurable features at all. False means `features` is empty and the item is ordered as-is."
          },
          "baseUnitCode": {
            "type": "string",
            "description": "Code of the item's base unit of measure, e.g. `st`. The quantity on a configuration is expressed in this unit. Null if not set.",
            "nullable": true
          },
          "decimalPlaces": {
            "type": "integer",
            "description": "Number of decimals allowed on the quantity (0–6).",
            "format": "int32"
          },
          "salesPrice": {
            "type": "number",
            "description": "Default sales price per unit in the tenant base currency, before any configuration surcharge. Use POST /preview/configurations/calculate for the real, customer-specific price. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationFeature"
            },
            "description": "The configurable features, in the order they should be presented. Empty when the item is not configurable.",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/PublicLinks"
          }
        },
        "additionalProperties": false,
        "description": "The configuration schema for an item, returned by GET /preview/items/{itemNumber}/configuration.\r\nEverything a configurator needs to render its form in one call: the fields, their types and\r\nbounds, the selectable options and what each choice does to the price.\r\n\r\nDeliberately not paginated. This is a resource, not a collection — a configurator cannot render a\r\nhalf-loaded form, so the whole schema always ships together (same treatment as `attributes`\r\non GET /preview/items/{itemNumber})."
      },
      "PublicItemCrossReference": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/CrossReferenceType"
          },
          "referenceNumber": {
            "type": "string",
            "description": "The reference number/value.",
            "nullable": true
          },
          "source": {
            "type": "string",
            "description": "Source of the reference, e.g. a manufacturer or system name. Null if not set.",
            "nullable": true
          },
          "isPrimary": {
            "type": "boolean",
            "description": "Whether this is the preferred reference of its type."
          }
        },
        "additionalProperties": false,
        "description": "An alternative identifier for the item."
      },
      "PublicItemDetailResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier (UUID v7).",
            "format": "uuid"
          },
          "itemNumber": {
            "type": "string",
            "description": "Unique item number — business key, e.g. `WIDGET-PRO`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name / product name.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Long-form description, e.g. for a product page. Null if not set.",
            "nullable": true
          },
          "itemType": {
            "$ref": "#/components/schemas/ItemType"
          },
          "status": {
            "$ref": "#/components/schemas/ItemStatus"
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the item is active. Inactive items cannot be placed on new orders."
          },
          "isSellable": {
            "type": "boolean",
            "description": "Whether the item can be sold. False for component-only items."
          },
          "isConfigurable": {
            "type": "boolean",
            "description": "Whether the item is made to order from configurable features (measurements, fabrics, add-ons). True means GET /preview/items/{itemNumber}/configuration returns a configuration schema and the item is ordered through /preview/configurations rather than as a plain order line."
          },
          "decimalPlaces": {
            "type": "integer",
            "description": "Number of decimals allowed on quantities for this item (0–6). Quantities with more decimals are rejected.",
            "format": "int32"
          },
          "salesStartDate": {
            "type": "string",
            "description": "Date from which the item can be sold (ISO 8601 date). Null if unrestricted.",
            "format": "date",
            "nullable": true
          },
          "salesEndDate": {
            "type": "string",
            "description": "Date until which the item can be sold (ISO 8601 date). Null if unrestricted.",
            "format": "date",
            "nullable": true
          },
          "allowPreOrder": {
            "type": "boolean",
            "description": "Whether customers can pre-order the item before it is in stock."
          },
          "allowBackorder": {
            "type": "boolean",
            "description": "Whether customers can back-order the item when it is out of stock."
          },
          "baseUnitCode": {
            "type": "string",
            "description": "Code of the item's base unit of measure, e.g. `st`, `kg`. Null if not set.",
            "nullable": true
          },
          "barcode": {
            "type": "string",
            "description": "EAN / GTIN barcode of the base unit. Null if not set.",
            "nullable": true
          },
          "units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicItemUnit"
            },
            "description": "All orderable units: the base unit first (factor 1), then alternative units (box, pallet, …) with their conversion factors and barcodes.",
            "nullable": true
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicItemAttribute"
            },
            "description": "Specification attributes (Material, Energy class, …) as name/value pairs. Empty if none.",
            "nullable": true
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicItemCategoryAssignment"
            },
            "description": "Category assignments for this item, each with its code, name and whether it belongs to the primary hierarchy. Empty if uncategorised.",
            "nullable": true
          },
          "crossReferences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicItemCrossReference"
            },
            "description": "Alternative identifiers (manufacturer part numbers, OEM numbers, extra barcodes, …). Empty if none.",
            "nullable": true
          },
          "parentItemNumber": {
            "type": "string",
            "description": "Item number of the variant master this item belongs to. Null unless the item is a variant.",
            "nullable": true
          },
          "variantAttributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicItemVariantAttribute"
            },
            "description": "The variant's attribute values (e.g. Colour=Red, Size=M). Empty unless the item is a variant.",
            "nullable": true
          },
          "netWeight": {
            "type": "number",
            "description": "Net weight in kilograms. Serialised as a decimal string. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "width": {
            "type": "number",
            "description": "Width in centimetres. Serialised as a decimal string. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "height": {
            "type": "number",
            "description": "Height in centimetres. Serialised as a decimal string. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "depth": {
            "type": "number",
            "description": "Depth in centimetres. Serialised as a decimal string. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "hsCode": {
            "type": "string",
            "description": "Harmonized System (HS / KN) customs tariff code. Null if not set.",
            "nullable": true
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country of manufacture, e.g. `SE`, `CN`. Null if not set.",
            "nullable": true
          },
          "salesPrice": {
            "type": "number",
            "description": "Default sales price in the tenant default currency. Serialised as a decimal string. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "brandName": {
            "type": "string",
            "description": "Brand name. Null if not set.",
            "nullable": true
          },
          "thumbnailUrl": {
            "type": "string",
            "description": "URL to the item's thumbnail image. Null if no image is set.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "UTC timestamp when the item was created.",
            "format": "date-time"
          },
          "modifiedDate": {
            "type": "string",
            "description": "UTC timestamp of the last modification. Null if never modified after creation.",
            "format": "date-time",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/PublicLinks"
          }
        },
        "additionalProperties": false,
        "description": "Full item details returned by GET /preview/items/{itemNumber}.\r\nContains everything needed to render a product page and create a valid order line:\r\nunits with barcodes, attributes, categories, cross-references and variant information.\r\nThe list endpoint (GET /preview/items) returns the leaner PublicApi.Preview.Items.Queries.PublicItemResponse."
      },
      "PublicItemFeatureType": {
        "enum": [
          "Text",
          "Number",
          "Selection",
          "Boolean",
          "ItemSelection",
          "Calculated"
        ],
        "type": "string",
        "description": "The kind of input a configurable feature takes, exposed via the Public API.\r\n\r\nMirrors `Domain.Items.ItemFeatureType` name-for-name and value-for-value so the query\r\nprojections can cast directly — a cast is translatable to SQL where a switch over a helper method\r\nis not. `PublicConfigurationEnumParityTests` fails the build if the two ever drift apart,\r\nwhich is what stops a new domain value from silently serialising as a bare number.\r\nThe value determines which field to send on a configuration value: `text` for\r\nPublicApi.Preview.Configurations.Queries.PublicItemFeatureType.Text, `number` for PublicApi.Preview.Configurations.Queries.PublicItemFeatureType.Number, `optionCode` for\r\nPublicApi.Preview.Configurations.Queries.PublicItemFeatureType.Selection, `boolean` for PublicApi.Preview.Configurations.Queries.PublicItemFeatureType.Boolean and `itemNumber` for\r\nPublicApi.Preview.Configurations.Queries.PublicItemFeatureType.ItemSelection. PublicApi.Preview.Configurations.Queries.PublicItemFeatureType.Calculated takes no input at all."
      },
      "PublicItemPriceResponse": {
        "type": "object",
        "properties": {
          "itemNumber": {
            "type": "string",
            "description": "Item number of the priced item.",
            "nullable": true
          },
          "itemName": {
            "type": "string",
            "description": "Display name of the item.",
            "nullable": true
          },
          "customerNumber": {
            "type": "string",
            "description": "Customer number the price was calculated for. Null for the default price.",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "Quantity the price was calculated for. Serialised as a decimal string.",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "description": "Calculated net unit price. Serialised as a decimal string.",
            "format": "double"
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 currency code of the price.",
            "nullable": true
          },
          "unit": {
            "type": "string",
            "description": "Unit of measure code the price applies to, e.g. `st`.",
            "nullable": true
          },
          "priceSource": {
            "type": "string",
            "description": "Where the price came from, e.g. `Customer`, `Campaign`, `Standard`.",
            "nullable": true
          },
          "priceListName": {
            "type": "string",
            "description": "Name of the price list used. Null if no price list applied.",
            "nullable": true
          },
          "found": {
            "type": "boolean",
            "description": "Whether a price was found. If false, unitPrice is 0 and the item has no configured price."
          },
          "quantityBreaks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicQuantityBreak"
            },
            "description": "Volume price breaks from the applied price list. Empty if none.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Calculated price for an item, optionally customer-specific."
      },
      "PublicItemResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier (UUID v7).",
            "format": "uuid"
          },
          "itemNumber": {
            "type": "string",
            "description": "Unique item number — business key, e.g. `WIDGET-PRO`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name / product name.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Long-form description, e.g. for a product page. Null if not set.",
            "nullable": true
          },
          "itemType": {
            "$ref": "#/components/schemas/ItemType"
          },
          "status": {
            "$ref": "#/components/schemas/ItemStatus"
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the item is active. Inactive items cannot be placed on new orders."
          },
          "isConfigurable": {
            "type": "boolean",
            "description": "Whether the item is made to order from configurable features (measurements, fabrics, add-ons). True means GET /preview/items/{itemNumber}/configuration returns a configuration schema and the item is ordered through /preview/configurations rather than as a plain order line."
          },
          "categoryName": {
            "type": "string",
            "description": "Name of the item category. Null if not categorised.",
            "nullable": true
          },
          "categoryCode": {
            "type": "string",
            "description": "Stable code of the item category — the value to pass to `?categoryCode=` and the one a feature's `selectableItemCategoryCode` refers to. Null if not categorised.",
            "nullable": true
          },
          "baseUnitCode": {
            "type": "string",
            "description": "Code of the item's base unit of measure, e.g. `st`, `kg`. Null if not set.",
            "nullable": true
          },
          "barcode": {
            "type": "string",
            "description": "EAN / GTIN barcode or other scanning code. Null if not set.",
            "nullable": true
          },
          "netWeight": {
            "type": "number",
            "description": "Net weight in kilograms. Serialised as a decimal string to avoid IEEE 754 precision loss. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "width": {
            "type": "number",
            "description": "Width in centimetres. Serialised as a decimal string. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "height": {
            "type": "number",
            "description": "Height in centimetres. Serialised as a decimal string. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "depth": {
            "type": "number",
            "description": "Depth in centimetres. Serialised as a decimal string. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "hsCode": {
            "type": "string",
            "description": "Harmonized System (HS / KN) customs tariff code. Null if not set.",
            "nullable": true
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country of manufacture, e.g. `SE`, `CN`. Null if not set.",
            "nullable": true
          },
          "salesPrice": {
            "type": "number",
            "description": "Default sales price in the tenant default currency. Serialised as a decimal string. Null if not set.",
            "format": "double",
            "nullable": true
          },
          "brandName": {
            "type": "string",
            "description": "Brand name. Null if not set.",
            "nullable": true
          },
          "thumbnailUrl": {
            "type": "string",
            "description": "URL to the item's thumbnail image. Null if no image is set.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "UTC timestamp when the item was created.",
            "format": "date-time"
          },
          "modifiedDate": {
            "type": "string",
            "description": "UTC timestamp of the last modification. Null if never modified after creation.",
            "format": "date-time",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/PublicLinks"
          }
        },
        "additionalProperties": false,
        "description": "Item details returned by GET /preview/items/{id} and the list endpoint."
      },
      "PublicItemUnit": {
        "type": "object",
        "properties": {
          "unitCode": {
            "type": "string",
            "description": "Unit code — usable as `unit` on order lines, e.g. `st`, `KART`.",
            "nullable": true
          },
          "conversionFactor": {
            "type": "number",
            "description": "How many base units this unit represents (1 KART = 12 st ⇒ 12). Serialised as a decimal string.",
            "format": "double"
          },
          "isSalesUnit": {
            "type": "boolean",
            "description": "Whether the unit may be used on sales order lines."
          },
          "isPurchaseUnit": {
            "type": "boolean",
            "description": "Whether the unit may be used on purchase order lines."
          },
          "barcode": {
            "type": "string",
            "description": "EAN / GTIN barcode for this specific unit/pack. Null if not set.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An orderable unit of measure for an item."
      },
      "PublicItemVariantAttribute": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Attribute name, e.g. `Colour`, `Size`.",
            "nullable": true
          },
          "value": {
            "type": "string",
            "description": "The variant's value, e.g. `Red`, `M`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A variant attribute value, e.g. Colour=Red."
      },
      "PublicLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "description": "Canonical URL of the resource, relative to the API base address.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Hypermedia links for a public API resource. Exposed as a computed `links` property on the\r\npublic response DTOs so that create and read responses carry the same self-reference — the\r\ncanonical URL is derived from the business key already present on the DTO and can never drift\r\nfrom the route it points at."
      },
      "PublicOrderDetailResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier (UUID v7).",
            "format": "uuid"
          },
          "orderNumber": {
            "type": "string",
            "description": "Unique order number, e.g. `ORD-2024-00042`.",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/PublicSalesOrderStatus"
          },
          "customerNumber": {
            "type": "string",
            "description": "Customer number of the buyer. Null if the order has no customer.",
            "nullable": true
          },
          "customerName": {
            "type": "string",
            "description": "Display name of the customer at the time of ordering. Null if not set.",
            "nullable": true
          },
          "customerReference": {
            "type": "string",
            "description": "Customer's own reference / purchase order number. Null if not provided.",
            "nullable": true
          },
          "orderDate": {
            "type": "string",
            "description": "Date the order was placed (ISO 8601 date).",
            "format": "date"
          },
          "requestedDeliveryDate": {
            "type": "string",
            "description": "Requested delivery date from the customer. Null if not provided.",
            "format": "date",
            "nullable": true
          },
          "plannedDeliveryDate": {
            "type": "string",
            "description": "Planned delivery date set by fulfilment. Null if not yet planned.",
            "format": "date",
            "nullable": true
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 currency code for all monetary values on this order.",
            "nullable": true
          },
          "paymentTermCode": {
            "type": "string",
            "description": "Payment term code, e.g. `NET30`. Null if not set.",
            "nullable": true
          },
          "paymentTermName": {
            "type": "string",
            "description": "Display name of the payment term. Null if not set.",
            "nullable": true
          },
          "deliveryTermCode": {
            "type": "string",
            "description": "Delivery / Incoterm code, e.g. `DAP`. Null if not set.",
            "nullable": true
          },
          "deliveryTermName": {
            "type": "string",
            "description": "Display name of the delivery term. Null if not set.",
            "nullable": true
          },
          "shippingMethodName": {
            "type": "string",
            "description": "Name of the shipping method / carrier. Null if not set.",
            "nullable": true
          },
          "deliveryAddress": {
            "$ref": "#/components/schemas/PublicDeliveryAddressResponse"
          },
          "externalNotes": {
            "type": "string",
            "description": "Free-text notes printed on order documents. Null if not set.",
            "nullable": true
          },
          "totalAmount": {
            "type": "number",
            "description": "Total order amount excluding tax, in the order currency. Serialised as a decimal string.",
            "format": "double"
          },
          "totalVat": {
            "type": "number",
            "description": "Total VAT / tax amount, in the order currency. Serialised as a decimal string.",
            "format": "double"
          },
          "totalAmountIncludingTax": {
            "type": "number",
            "description": "Total order amount including tax, in the order currency. Serialised as a decimal string.",
            "format": "double"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicOrderLineResponse"
            },
            "description": "Order lines. Empty list if the order has no lines.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "UTC timestamp when the order was created.",
            "format": "date-time"
          },
          "modifiedDate": {
            "type": "string",
            "description": "UTC timestamp of the last modification. Null if never modified after creation.",
            "format": "date-time",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/PublicLinks"
          }
        },
        "additionalProperties": false,
        "description": "Full sales order details returned by GET /preview/orders/{id}.\r\nUses business-key codes (not Guids) for reference data like PaymentTerm and DeliveryTerm."
      },
      "PublicOrderLineResponse": {
        "type": "object",
        "properties": {
          "lineNumber": {
            "type": "integer",
            "description": "1-based sequential line number within the order.",
            "format": "int32"
          },
          "itemNumber": {
            "type": "string",
            "description": "Item number of the ordered item.",
            "nullable": true
          },
          "itemName": {
            "type": "string",
            "description": "Display name of the ordered item at the time of ordering.",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/PublicOrderLineStatus"
          },
          "quantity": {
            "type": "number",
            "description": "Ordered quantity. Serialised as a decimal string.",
            "format": "double"
          },
          "deliveredQuantity": {
            "type": "number",
            "description": "Quantity already delivered / shipped. Serialised as a decimal string.",
            "format": "double"
          },
          "outstandingQuantity": {
            "type": "number",
            "description": "Remaining quantity not yet delivered (Quantity − DeliveredQuantity). Serialised as a decimal string.",
            "format": "double"
          },
          "unit": {
            "type": "string",
            "description": "Unit of measure code, e.g. `st`, `kg`.",
            "nullable": true
          },
          "unitPrice": {
            "type": "number",
            "description": "Net unit price in the order currency. Serialised as a decimal string.",
            "format": "double"
          },
          "discountPercent": {
            "type": "number",
            "description": "Line discount in percent (0–100). Serialised as a decimal string.",
            "format": "double"
          },
          "lineTotal": {
            "type": "number",
            "description": "Line total excluding tax (UnitPrice × Quantity × (1 − DiscountPercent / 100)). Serialised as a decimal string.",
            "format": "double"
          },
          "taxPercent": {
            "type": "number",
            "description": "Applicable tax / VAT rate in percent. Serialised as a decimal string.",
            "format": "double"
          },
          "lineTotalIncludingTax": {
            "type": "number",
            "description": "Line total including tax. Serialised as a decimal string.",
            "format": "double"
          },
          "notes": {
            "type": "string",
            "description": "Free-text line notes. Null if not set.",
            "nullable": true
          },
          "plannedDeliveryDate": {
            "type": "string",
            "description": "Planned delivery date for this specific line. Null if not yet set.",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A single order line returned as part of a sales order detail response."
      },
      "PublicOrderLineStatus": {
        "enum": [
          "Open",
          "Delivered",
          "Cancelled"
        ],
        "type": "string",
        "description": "Sales order line status values exposed via the Public API.\r\nDraft is intentionally omitted."
      },
      "PublicOrderListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier (UUID v7).",
            "format": "uuid"
          },
          "orderNumber": {
            "type": "string",
            "description": "Unique order number, e.g. `ORD-2024-00042`.",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/PublicSalesOrderStatus"
          },
          "customerNumber": {
            "type": "string",
            "description": "Customer number of the buyer. Null if the order has no customer.",
            "nullable": true
          },
          "customerName": {
            "type": "string",
            "description": "Display name of the customer. Null if not set.",
            "nullable": true
          },
          "customerReference": {
            "type": "string",
            "description": "Customer's own reference / purchase order number. Null if not provided.",
            "nullable": true
          },
          "orderDate": {
            "type": "string",
            "description": "Date the order was placed (ISO 8601 date).",
            "format": "date"
          },
          "requestedDeliveryDate": {
            "type": "string",
            "description": "Requested delivery date from the customer. Null if not provided.",
            "format": "date",
            "nullable": true
          },
          "plannedDeliveryDate": {
            "type": "string",
            "description": "Planned delivery date set by fulfilment. Null if not yet planned.",
            "format": "date",
            "nullable": true
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 currency code for all monetary values on this order.",
            "nullable": true
          },
          "totalAmount": {
            "type": "number",
            "description": "Total order amount excluding tax, in the order currency. Serialised as a decimal string.",
            "format": "double"
          },
          "totalAmountIncludingTax": {
            "type": "number",
            "description": "Total order amount including tax, in the order currency. Serialised as a decimal string.",
            "format": "double"
          },
          "lineCount": {
            "type": "integer",
            "description": "Number of order lines.",
            "format": "int32"
          },
          "createdDate": {
            "type": "string",
            "description": "UTC timestamp when the order was created.",
            "format": "date-time"
          },
          "modifiedDate": {
            "type": "string",
            "description": "UTC timestamp of the last modification. Null if never modified after creation.",
            "format": "date-time",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/PublicLinks"
          }
        },
        "additionalProperties": false,
        "description": "Lightweight order summary returned by GET /preview/orders (list endpoint)."
      },
      "PublicOrderTypeResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Unique code used as `orderTypeCode` in order creation.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name of the order type.",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is the tenant's default order type."
          }
        },
        "additionalProperties": false,
        "description": "Order type available for sales order classification."
      },
      "PublicPaymentTermResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Unique code used as `paymentTermCode` in order creation.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name of the payment term.",
            "nullable": true
          },
          "days": {
            "type": "integer",
            "description": "Number of net payment days. Null if not applicable.",
            "format": "int32",
            "nullable": true
          },
          "isDefaultSales": {
            "type": "boolean",
            "description": "Whether this is the default payment term for new sales orders."
          }
        },
        "additionalProperties": false,
        "description": "Payment term available on sales orders and customers."
      },
      "PublicPurchaseDeliveryAddressResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Recipient company or person name.",
            "nullable": true
          },
          "street1": {
            "type": "string",
            "description": "Street address line 1.",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "description": "Postal / ZIP code.",
            "nullable": true
          },
          "city": {
            "type": "string",
            "description": "City name.",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`.",
            "nullable": true
          },
          "street2": {
            "type": "string",
            "description": "Street address line 2 (c/o, suite, etc.). Null if not set.",
            "nullable": true
          },
          "contactPerson": {
            "type": "string",
            "description": "Contact person at the delivery address. Null if not set.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Phone number at the delivery address. Null if not set.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Email address at the delivery address. Null if not set.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Delivery address attached to a purchase order."
      },
      "PublicPurchaseOrderLineResponse": {
        "type": "object",
        "properties": {
          "lineNumber": {
            "type": "integer",
            "description": "1-based sequential line number within the order — the business key used in line URLs.",
            "format": "int32"
          },
          "itemNumber": {
            "type": "string",
            "description": "Item number of the ordered item.",
            "nullable": true
          },
          "itemName": {
            "type": "string",
            "description": "Display name of the ordered item.",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/PublicPurchaseOrderLineStatus"
          },
          "quantity": {
            "type": "number",
            "description": "Ordered quantity. Serialised as a decimal string.",
            "format": "double"
          },
          "receivedQuantity": {
            "type": "number",
            "description": "Quantity already received into stock. Serialised as a decimal string.",
            "format": "double"
          },
          "outstandingQuantity": {
            "type": "number",
            "description": "Remaining quantity not yet received (Quantity − ReceivedQuantity). Serialised as a decimal string.",
            "format": "double"
          },
          "unit": {
            "type": "string",
            "description": "Unit of measure code, e.g. `st`, `kg`.",
            "nullable": true
          },
          "unitPrice": {
            "type": "number",
            "description": "Purchase price per unit in the order currency. Serialised as a decimal string.",
            "format": "double"
          },
          "lineTotal": {
            "type": "number",
            "description": "Line total excluding tax (UnitPrice × Quantity). Serialised as a decimal string.",
            "format": "double"
          },
          "expectedDate": {
            "type": "string",
            "description": "Expected delivery date for this line (ISO 8601 date). Null if not set.",
            "format": "date",
            "nullable": true
          },
          "promisedDeliveryDate": {
            "type": "string",
            "description": "Delivery date promised by the supplier for this line. Null until confirmed.",
            "format": "date",
            "nullable": true
          },
          "confirmedQuantity": {
            "type": "number",
            "description": "Quantity confirmed by the supplier. Null until confirmed. Serialised as a decimal string.",
            "format": "double",
            "nullable": true
          },
          "confirmedUnitPrice": {
            "type": "number",
            "description": "Unit price confirmed by the supplier. Null until confirmed. Serialised as a decimal string.",
            "format": "double",
            "nullable": true
          },
          "confirmedDeliveryDate": {
            "type": "string",
            "description": "Delivery date confirmed by the supplier. Null until confirmed.",
            "format": "date",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "description": "Free-text line notes. Null if not set.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A single purchase order line."
      },
      "PublicPurchaseOrderLineStatus": {
        "enum": [
          "Ordered",
          "Confirmed",
          "ConfirmedWithDeviations",
          "PartiallyReceived",
          "Received",
          "Cancelled"
        ],
        "type": "string",
        "description": "Purchase order line status values exposed via the Public API.\r\nMirrors `Domain.Common.Enums.PurchaseOrderLineStatus` — see PublicApi.Preview.Purchasing.Queries.PublicPurchaseOrderStatus."
      },
      "PublicPurchaseOrderListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier (UUID v7).",
            "format": "uuid"
          },
          "orderNumber": {
            "type": "string",
            "description": "Unique purchase order number, e.g. `PO-2026-00042`.",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/PublicPurchaseOrderStatus"
          },
          "supplierNumber": {
            "type": "string",
            "description": "Supplier number of the seller.",
            "nullable": true
          },
          "supplierName": {
            "type": "string",
            "description": "Display name of the supplier.",
            "nullable": true
          },
          "supplierReference": {
            "type": "string",
            "description": "The supplier's own order reference. Null if not provided.",
            "nullable": true
          },
          "orderDate": {
            "type": "string",
            "description": "Date the order was placed (ISO 8601 date).",
            "format": "date"
          },
          "expectedDeliveryDate": {
            "type": "string",
            "description": "Date we expect the goods to arrive. Null if not set.",
            "format": "date",
            "nullable": true
          },
          "promisedDeliveryDate": {
            "type": "string",
            "description": "Delivery date promised by the supplier. Null until confirmed.",
            "format": "date",
            "nullable": true
          },
          "warehouseCode": {
            "type": "string",
            "description": "Code of the warehouse the goods are received into.",
            "nullable": true
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 currency code for all monetary values on this order.",
            "nullable": true
          },
          "totalAmount": {
            "type": "number",
            "description": "Total order amount excluding tax, in the order currency. Serialised as a decimal string.",
            "format": "double"
          },
          "lineCount": {
            "type": "integer",
            "description": "Number of purchase order lines.",
            "format": "int32"
          },
          "createdDate": {
            "type": "string",
            "description": "UTC timestamp when the order was created.",
            "format": "date-time"
          },
          "modifiedDate": {
            "type": "string",
            "description": "UTC timestamp of the last modification. Null if never modified after creation.",
            "format": "date-time",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/PublicLinks"
          }
        },
        "additionalProperties": false,
        "description": "Lightweight purchase order summary returned by GET /preview/purchase-orders (list endpoint)."
      },
      "PublicPurchaseOrderResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier (UUID v7).",
            "format": "uuid"
          },
          "orderNumber": {
            "type": "string",
            "description": "Unique purchase order number, e.g. `PO-2026-00042`.",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/PublicPurchaseOrderStatus"
          },
          "supplierNumber": {
            "type": "string",
            "description": "Supplier number of the seller.",
            "nullable": true
          },
          "supplierName": {
            "type": "string",
            "description": "Display name of the supplier.",
            "nullable": true
          },
          "supplierReference": {
            "type": "string",
            "description": "The supplier's own order reference / confirmation number. Null if not provided.",
            "nullable": true
          },
          "orderDate": {
            "type": "string",
            "description": "Date the order was placed (ISO 8601 date).",
            "format": "date"
          },
          "expectedDeliveryDate": {
            "type": "string",
            "description": "Date we expect the goods to arrive. Null if not set.",
            "format": "date",
            "nullable": true
          },
          "promisedDeliveryDate": {
            "type": "string",
            "description": "Delivery date promised by the supplier. Null until confirmed.",
            "format": "date",
            "nullable": true
          },
          "warehouseCode": {
            "type": "string",
            "description": "Code of the warehouse the goods are received into.",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "description": "Display name of the receiving warehouse.",
            "nullable": true
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 currency code for all monetary values on this order.",
            "nullable": true
          },
          "paymentTermCode": {
            "type": "string",
            "description": "Payment term code, e.g. `NET30`. Null if not set.",
            "nullable": true
          },
          "paymentTermName": {
            "type": "string",
            "description": "Display name of the payment term. Null if not set.",
            "nullable": true
          },
          "deliveryTermCode": {
            "type": "string",
            "description": "Delivery / Incoterm code, e.g. `DAP`. Null if not set.",
            "nullable": true
          },
          "deliveryTermName": {
            "type": "string",
            "description": "Display name of the delivery term. Null if not set.",
            "nullable": true
          },
          "shippingMethodCode": {
            "type": "string",
            "description": "Shipping method / carrier code. Null if not set.",
            "nullable": true
          },
          "shippingMethodName": {
            "type": "string",
            "description": "Display name of the shipping method. Null if not set.",
            "nullable": true
          },
          "deliveryAddress": {
            "$ref": "#/components/schemas/PublicPurchaseDeliveryAddressResponse"
          },
          "isDropShipment": {
            "type": "boolean",
            "description": "Whether the goods ship directly from the supplier to an end customer."
          },
          "externalNotes": {
            "type": "string",
            "description": "Free-text notes printed on the purchase order document. Null if not set.",
            "nullable": true
          },
          "totalAmount": {
            "type": "number",
            "description": "Total order amount excluding tax, in the order currency. Serialised as a decimal string.",
            "format": "double"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicPurchaseOrderLineResponse"
            },
            "description": "Purchase order lines. Empty list if the order has no lines.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "UTC timestamp when the order was created.",
            "format": "date-time"
          },
          "modifiedDate": {
            "type": "string",
            "description": "UTC timestamp of the last modification. Null if never modified after creation.",
            "format": "date-time",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/PublicLinks"
          }
        },
        "additionalProperties": false,
        "description": "Full purchase order details returned by GET /preview/purchase-orders/{orderNumber}.\r\nUses business-key codes (not Guids) for reference data like Supplier, Warehouse and PaymentTerm."
      },
      "PublicPurchaseOrderStatus": {
        "enum": [
          "Draft",
          "Sent",
          "PartiallyConfirmed",
          "Confirmed",
          "PartiallyReceived",
          "Received",
          "Closed",
          "Cancelled"
        ],
        "type": "string",
        "description": "Purchase order status values exposed via the Public API.\r\n\r\nMirrors `Domain.Common.Enums.PurchaseOrderStatus` name-for-name and value-for-value so the\r\nquery projections can cast directly — a cast is translatable to SQL where a switch over a helper\r\nmethod is not. `PublicPurchaseEnumParityTests` fails the build if the two ever drift apart,\r\nwhich is what stops a new domain value from silently serialising as a bare number.\r\nUnlike sales orders, `Draft`<b>is</b> part of the public contract: a purchase order created\r\nthrough POST /preview/purchase-orders starts in Draft, and the caller has to be able to read back\r\nthe order it just created before sending it."
      },
      "PublicQuantityBreak": {
        "type": "object",
        "properties": {
          "minQuantity": {
            "type": "number",
            "description": "Minimum quantity for this price. Serialised as a decimal string.",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "description": "Unit price at this quantity. Serialised as a decimal string.",
            "format": "double"
          },
          "discountPercent": {
            "type": "number",
            "description": "Discount in percent compared to the base price. Serialised as a decimal string. Null if not applicable.",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Volume price break — the unit price that applies from a minimum quantity."
      },
      "PublicSalesOrderStatus": {
        "enum": [
          "Placed",
          "Released",
          "Picking",
          "Packed",
          "Shipped",
          "Completed",
          "Cancelled"
        ],
        "type": "string",
        "description": "Sales order status values exposed via the Public API.\r\nDraft orders are never visible through the public API."
      },
      "PublicShipmentLineResponse": {
        "type": "object",
        "properties": {
          "orderLineNumber": {
            "type": "integer",
            "description": "Line number of the sales order line this shipment line fulfils.",
            "format": "int32"
          },
          "itemNumber": {
            "type": "string",
            "description": "Item number of the shipped item.",
            "nullable": true
          },
          "itemName": {
            "type": "string",
            "description": "Display name of the shipped item.",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "Quantity on this shipment. Serialised as a decimal string.",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "A single shipment line, referencing the order line it fulfils."
      },
      "PublicShipmentResponse": {
        "type": "object",
        "properties": {
          "shipmentNumber": {
            "type": "string",
            "description": "Unique shipment number, e.g. `SHIP-2026-00128`.",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/PublicShipmentStatus"
          },
          "trackingNumber": {
            "type": "string",
            "description": "Carrier tracking number. Null until the shipment is booked with a carrier.",
            "nullable": true
          },
          "shippingMethodName": {
            "type": "string",
            "description": "Name of the shipping method / carrier. Null if not set.",
            "nullable": true
          },
          "plannedShipDate": {
            "type": "string",
            "description": "Planned ship date (ISO 8601 date). Null if not yet planned.",
            "format": "date",
            "nullable": true
          },
          "shippedDate": {
            "type": "string",
            "description": "UTC timestamp when the shipment was handed over to the carrier. Null if not yet shipped.",
            "format": "date-time",
            "nullable": true
          },
          "deliveredDate": {
            "type": "string",
            "description": "UTC timestamp when the shipment was delivered. Null if not yet delivered.",
            "format": "date-time",
            "nullable": true
          },
          "totalWeightKg": {
            "type": "number",
            "description": "Total weight in kilograms. Serialised as a decimal string. Null if not weighed.",
            "format": "double",
            "nullable": true
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicShipmentLineResponse"
            },
            "description": "Shipment lines that belong to this order. Lines for other orders on a consolidated shipment are excluded.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "UTC timestamp when the shipment was created.",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "A shipment fulfilling (part of) a sales order."
      },
      "PublicShipmentStatus": {
        "enum": [
          "Hold",
          "Released",
          "Picking",
          "Picked",
          "ReadyForPickup",
          "Packing",
          "Packed",
          "Booked",
          "PickedUp",
          "InTransit",
          "Delivered",
          "Failed",
          "Cancelled"
        ],
        "type": "string",
        "description": "Shipment status values exposed via the Public API.\r\nMirrors the internal shipment lifecycle from warehouse release to delivery."
      },
      "PublicShippingMethodResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Unique code used as `shippingMethodCode` in order creation.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name of the shipping method.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Shipping method / carrier available on sales orders."
      },
      "PublicSupplierContactResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier (UUID v7).",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Contact person's full name.",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "Job title. Null if not set.",
            "nullable": true
          },
          "department": {
            "type": "string",
            "description": "Department. Null if not set.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Email address. Null if not set.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Phone number. Null if not set.",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "description": "Mobile phone number. Null if not set.",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is the supplier's default contact."
          },
          "languageCode": {
            "type": "string",
            "description": "ISO 639-1 language code for communication with this contact. Null if not set.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A contact person at a supplier, returned by GET /preview/suppliers/{supplierNumber}/contacts."
      },
      "PublicSupplierItemResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier (UUID v7).",
            "format": "uuid"
          },
          "itemNumber": {
            "type": "string",
            "description": "Item number in Fluit — the business key used in item and order endpoints.",
            "nullable": true
          },
          "itemName": {
            "type": "string",
            "description": "Display name of the item in Fluit.",
            "nullable": true
          },
          "supplierItemNumber": {
            "type": "string",
            "description": "The supplier's own article number for this item. Null if not set.",
            "nullable": true
          },
          "supplierDescription": {
            "type": "string",
            "description": "The supplier's own description of the item. Null if not set.",
            "nullable": true
          },
          "unitPrice": {
            "type": "number",
            "description": "Purchase price per unit, in the supplier's currency. Serialised as a decimal string.",
            "format": "double"
          },
          "minOrderQuantity": {
            "type": "number",
            "description": "Minimum order quantity. Null if the supplier has no minimum. Serialised as a decimal string.",
            "format": "double",
            "nullable": true
          },
          "orderMultiple": {
            "type": "number",
            "description": "Order quantities must be a multiple of this value. Null if unrestricted. Serialised as a decimal string.",
            "format": "double",
            "nullable": true
          },
          "supplierUnit": {
            "type": "string",
            "description": "The supplier's unit of measure, if it differs from ours. Null if the same.",
            "nullable": true
          },
          "conversionFactor": {
            "type": "number",
            "description": "Factor converting the supplier's unit to ours. Serialised as a decimal string.",
            "format": "double"
          },
          "leadTimeDays": {
            "type": "integer",
            "description": "Lead time in calendar days for this specific item. Null to fall back to the supplier default.",
            "format": "int32",
            "nullable": true
          },
          "validFrom": {
            "type": "string",
            "description": "First date this price is valid. Null if valid from the beginning.",
            "format": "date",
            "nullable": true
          },
          "validTo": {
            "type": "string",
            "description": "Last date this price is valid. Null if it does not expire.",
            "format": "date",
            "nullable": true
          },
          "isPrimary": {
            "type": "boolean",
            "description": "Whether this supplier is the primary source for the item."
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the price row is active."
          }
        },
        "additionalProperties": false,
        "description": "A supplier-specific price and purchasing terms for one item, returned by\r\nGET /preview/suppliers/{supplierNumber}/items."
      },
      "PublicSupplierResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal unique identifier (UUID v7).",
            "format": "uuid"
          },
          "supplierNumber": {
            "type": "string",
            "description": "Unique supplier number — business key used in all URL references.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Full company name.",
            "nullable": true
          },
          "organizationNumber": {
            "type": "string",
            "description": "Company registration number / org.nr. Null if not set.",
            "nullable": true
          },
          "contactPerson": {
            "type": "string",
            "description": "Primary contact person at the supplier. Null if not set.",
            "nullable": true
          },
          "purchaseOrderEmail": {
            "type": "string",
            "description": "Email address purchase orders are sent to. Null if not set.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Primary phone number. Null if not set.",
            "nullable": true
          },
          "street1": {
            "type": "string",
            "description": "Street address line 1. Null if not set.",
            "nullable": true
          },
          "street2": {
            "type": "string",
            "description": "Street address line 2 (suite, c/o, etc.). Null if not set.",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "description": "Postal / ZIP code. Null if not set.",
            "nullable": true
          },
          "city": {
            "type": "string",
            "description": "City name. Null if not set.",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`, `DE`. Null if not set.",
            "nullable": true
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 currency code purchase orders to this supplier are placed in.",
            "nullable": true
          },
          "paymentTermCode": {
            "type": "string",
            "description": "Code of the supplier's default payment term — usable as `paymentTermCode`. Null if not set.",
            "nullable": true
          },
          "paymentTermName": {
            "type": "string",
            "description": "Display name of the payment term. Null if not set.",
            "nullable": true
          },
          "deliveryTermCode": {
            "type": "string",
            "description": "Code of the supplier's default delivery term / Incoterm. Null if not set.",
            "nullable": true
          },
          "deliveryTermName": {
            "type": "string",
            "description": "Display name of the delivery term. Null if not set.",
            "nullable": true
          },
          "leadTimeDays": {
            "type": "integer",
            "description": "Default lead time in calendar days from order to delivery. Null if not set.",
            "format": "int32",
            "nullable": true
          },
          "ourCustomerNumber": {
            "type": "string",
            "description": "Our customer number at the supplier — quoted on purchase orders. Null if not set.",
            "nullable": true
          },
          "website": {
            "type": "string",
            "description": "Supplier website URL. Null if not set.",
            "nullable": true
          },
          "languageCode": {
            "type": "string",
            "description": "ISO 639-1 language code used for purchase order documents, e.g. `sv`, `en`. Null if not set.",
            "nullable": true
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the supplier is active. Inactive suppliers cannot be used on new purchase orders."
          },
          "notes": {
            "type": "string",
            "description": "Free-text internal notes (not visible to the supplier). Null if not set.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "UTC timestamp when the supplier record was created.",
            "format": "date-time"
          },
          "modifiedDate": {
            "type": "string",
            "description": "UTC timestamp of the last modification. Null if never modified after creation.",
            "format": "date-time",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/PublicLinks"
          }
        },
        "additionalProperties": false,
        "description": "Supplier details returned by GET /preview/suppliers/{supplierNumber} and the list endpoint."
      },
      "PublicTenantInfoResponse": {
        "type": "object",
        "properties": {
          "companyName": {
            "type": "string",
            "description": "Registered company name.",
            "nullable": true
          },
          "organizationNumber": {
            "type": "string",
            "description": "Organisation / company registration number, or `null` if not configured.",
            "nullable": true
          },
          "vatNumber": {
            "type": "string",
            "description": "VAT registration number, or `null` if not configured.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Company contact e-mail, or `null` if not configured.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Company phone number, or `null` if not configured.",
            "nullable": true
          },
          "website": {
            "type": "string",
            "description": "Company website URL, or `null` if not configured.",
            "nullable": true
          },
          "street1": {
            "type": "string",
            "description": "Street address line 1, or `null` if not configured.",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "description": "Postal / ZIP code, or `null` if not configured.",
            "nullable": true
          },
          "city": {
            "type": "string",
            "description": "City, or `null` if not configured.",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code, e.g. `SE`. Null if not configured.",
            "nullable": true
          },
          "baseCurrencyCode": {
            "type": "string",
            "description": "ISO 4217 base currency code, e.g. `SEK`.",
            "nullable": true
          },
          "defaultLanguageCode": {
            "type": "string",
            "description": "ISO 639-1 default language code, e.g. `sv`.",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone identifier, e.g. `Europe/Stockholm`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Company and configuration details for the authenticated tenant."
      },
      "PublicWarehouseAvailability": {
        "type": "object",
        "properties": {
          "warehouseCode": {
            "type": "string",
            "description": "Warehouse code — usable as `warehouseCode` in order creation.",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "description": "Display name of the warehouse.",
            "nullable": true
          },
          "quantityOnHand": {
            "type": "number",
            "description": "Physical quantity on hand in this warehouse. Serialised as a decimal string.",
            "format": "double"
          },
          "allocatedQuantity": {
            "type": "number",
            "description": "Quantity reserved for orders in this warehouse. Serialised as a decimal string.",
            "format": "double"
          },
          "availableQuantity": {
            "type": "number",
            "description": "Quantity available for new orders (on hand − allocated). Serialised as a decimal string.",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "Stock availability for an item in a single warehouse."
      },
      "PublicWarehouseResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Unique warehouse code used as `warehouseCode` in order creation.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name of the warehouse.",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is the tenant's default warehouse."
          }
        },
        "additionalProperties": false,
        "description": "Warehouse available for order fulfilment."
      },
      "ReceivePurchaseOrderLineRequest": {
        "type": "object",
        "properties": {
          "quantity": {
            "maximum": 79228162514264337593543950335,
            "minimum": 0,
            "exclusiveMinimum": true,
            "type": "number",
            "description": "Quantity received. Must be greater than zero.",
            "format": "double"
          },
          "locationCode": {
            "maxLength": 50,
            "type": "string",
            "description": "Warehouse location to receive into. Defaults to the warehouse's default receiving location.",
            "nullable": true
          },
          "unitCost": {
            "maximum": 79228162514264337593543950335,
            "minimum": 0,
            "type": "number",
            "description": "Actual unit cost for this receipt. Must not be negative. Defaults to the line's unit price.",
            "format": "double",
            "nullable": true
          },
          "serialNumber": {
            "maxLength": 100,
            "type": "string",
            "description": "Serial number, for serial-tracked items.",
            "nullable": true
          },
          "batchNumber": {
            "maxLength": 100,
            "type": "string",
            "description": "Batch / lot number, for batch-tracked items.",
            "nullable": true
          },
          "notes": {
            "maxLength": 500,
            "type": "string",
            "description": "Free-text notes stored on the receipt.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ReceivePurchaseOrderLineResponse": {
        "type": "object",
        "properties": {
          "receiptId": {
            "type": "string",
            "description": "Internal unique identifier of the created receipt (UUID v7).",
            "format": "uuid"
          },
          "line": {
            "$ref": "#/components/schemas/PublicPurchaseOrderLineResponse"
          }
        },
        "additionalProperties": false,
        "description": "Receipt confirmation returned after goods have been booked into stock."
      },
      "ReconfigureConfigurationRequest": {
        "type": "object",
        "properties": {
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConfigurationValueInput"
            },
            "description": "The full set of chosen values, replacing the previous set — anything left out of the list is cleared.\r\nOmit the field entirely to keep the current choices, e.g. when only changing the quantity.\r\nSend an empty array to clear every choice.",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "New quantity. Omit to keep the current one.",
            "format": "double",
            "nullable": true
          },
          "customerNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "Customer to attach. Use it to claim a configuration that was saved anonymously. Omit to keep the current customer.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SendPurchaseOrderRequest": {
        "type": "object",
        "properties": {
          "sendEmail": {
            "type": "boolean",
            "description": "Set to `true` to email the purchase order PDF to the supplier. Defaults to `false`,\r\nwhich only moves the order to Sent — use it when the order has already been transmitted by\r\nEDI or another channel."
          },
          "toEmail": {
            "maxLength": 200,
            "type": "string",
            "description": "Recipient address. Defaults to the supplier's purchase order email. Only used when sendEmail is true.",
            "format": "email",
            "nullable": true
          },
          "subject": {
            "maxLength": 200,
            "type": "string",
            "description": "Custom email subject. Only used when sendEmail is true.",
            "nullable": true
          },
          "message": {
            "maxLength": 4000,
            "type": "string",
            "description": "Custom email body. Only used when sendEmail is true.",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "API key issued per tenant. Prefix: `fluit_live_sk_...`",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "ApiKey": [ ]
    }
  ],
  "tags": [
    {
      "name": "Customers",
      "description": "Customers with their contact persons and delivery addresses. Addressed by customerNumber."
    },
    {
      "name": "Items",
      "description": "Items/products including stock availability, price calculation, units, attributes and assets. Addressed by itemNumber."
    },
    {
      "name": "SalesOrders",
      "description": "Sales orders with lines, fulfilment status and shipments. Addressed by orderNumber. Draft orders are not visible."
    },
    {
      "name": "Configurations",
      "description": "Made-to-order products: read an item's configuration schema, price and validate a set of choices, save it as a configuration and turn it into a sales order. Addressed by configurationNumber. The schema endpoint lives at /preview/items/{itemNumber}/configuration because it belongs to the item, but it is grouped here so the whole configurator flow reads in one place."
    },
    {
      "name": "Suppliers",
      "description": "Suppliers with their contact persons and supplier-specific prices, minimum order quantities and lead times. Addressed by supplierNumber."
    },
    {
      "name": "PurchaseOrders",
      "description": "Purchase orders with lines, confirmation status and goods receipts. Addressed by orderNumber. Unlike sales orders, draft purchase orders are visible — an order created through this API starts in Draft."
    },
    {
      "name": "Reference",
      "description": "Read-only reference data: the valid codes for warehouses, currencies, payment/delivery terms, order types and shipping methods used in other requests."
    }
  ],
  "x-logo": {
    "url": "https://fluit.se/fluit-logo.svg",
    "altText": "Fluit ERP",
    "href": "https://fluit.se"
  },
  "x-tagGroups": [
    {
      "name": "Master data",
      "tags": [
        "Customers",
        "Items",
        "Suppliers"
      ]
    },
    {
      "name": "Sales",
      "tags": [
        "SalesOrders",
        "Configurations"
      ]
    },
    {
      "name": "Purchasing",
      "tags": [
        "PurchaseOrders"
      ]
    },
    {
      "name": "Reference data",
      "tags": [
        "Reference"
      ]
    }
  ]
}