{
  "openapi": "3.1.0",
  "info": {
    "title": "Formheim API",
    "version": "1.0.0",
    "description": "Public REST API for Formheim, a Norwegian shop for 3D-printed interior products and custom 3D printing. It exposes the same services as the MCP endpoint at `https://api.formheim.no/mcp`; use whichever fits your client.\n\n**What you can do**\n- Browse the product catalog and read product details.\n- Read the 3D-print service (materials, colours, prices, build volume).\n- Get a preliminary price estimate from a client-side analysis of a 3D model.\n- Submit a print request on behalf of a customer. The customer always confirms, enters contact details and delivery address, and sends the request on a Formheim web page. The API never sends a quote or takes an order by itself.\n\n**Customer upload link (preferred when you cannot upload files yourself).** `POST /v1/print/upload-links` creates a request and returns `upload_url`. Give it to the customer: they open it in their browser, choose the files, adjust the print settings and upload, so you need no file access and no network access to Formheim's storage. Then poll `GET /v1/print/requests/{request_id}` until `uploaded_files` equals `total_files` (above 0): the response then contains `analysis`, which you pass unchanged to `POST /v1/print/quotes` and to the confirmation call. If your own upload fails (HTTP 403 on the `PUT`, for example from a sandbox without network access), stop, do not retry the registration with the same `idempotency_key`, and call `POST /v1/print/upload-links` with the `request_id` and `request_key` you already hold. https://www.formheim.no/print/agent?mode=analysis only analyses files in the browser and has no order button; customers can also order at https://www.formheim.no/print.\n\n**Print request flow**\n1. `POST /v1/print/quotes` (optional): preliminary estimate.\n2. `POST /v1/print/requests`: register the files and receive signed upload URLs plus a secret `request_key`.\n3. Upload each file with a plain HTTP `PUT` of the raw bytes to `uploads[].url` (method from `uploads[].method`, `Content-Type: application/octet-stream`).\n4. `POST /v1/print/requests/{request_id}/confirmation`: returns `confirmation_url` and `quote_status_key`.\n5. Give `confirmation_url` to the customer to open in a browser. Its fragment (after `#`) is a secret. The link works once and its browser session lasts 15 minutes. If the customer used it up, let it expire or lost it, call the same confirmation endpoint again with the same `request_key` and analysis: you get a fresh `confirmation_url` and a new `quote_status_key`, and unopened older links stop working. Earlier `quote_status_key` values remain subject to the same sharing permission, expiry and revocation as the newest key; always use and keep the newest one. Do not create a new request for a lost confirmation link. Re-issuance requires an unsubmitted, unexpired request and the same analysis; at most 10 confirmation links may be issued per request.\n6. Optionally poll `GET /v1/print/requests/{request_id}` (technical status) and `GET /v1/print/quote-status` (customer-facing status: before confirmation it can report `Avventer bekreftelse`; after confirmation it requires the customer to have allowed status sharing). If status access is denied, stop polling: the key may be invalid or expired, or sharing may have been revoked. Do not call the confirmation endpoint to recover status access; ask the customer to use the Formheim page or contact Formheim.\n\n**Conventions**\n- Prices are in NOK and include VAT. Estimates are preliminary; the final quote comes from Formheim.\n- Product data and error messages are in Norwegian Bokmål. Error codes are stable; do not parse messages.\n- Errors: `{\"error\": {\"code\": \"...\", \"message\": \"...\"}}` with the HTTP status listed per operation.\n- No API key is needed. Keys returned by the API (`request_key`, `quote_status_key`) are secrets: send them only in the `Authorization: Bearer` header or the request body as documented, never in URLs, and do not log them.\n- Requests are rate limited per client. Send `Accept: application/json`. Request bodies are limited to 1 MiB, files to 50 MiB each (max 10 files).\n- Responses are not cacheable (`Cache-Control: no-store`) and not indexed.\n- Browser clients are only allowed from origins on an allowlist; use the API from a server or an agent runtime.\n- Anything the API cannot do (for example unsupported models or very large jobs) is handled on https://www.formheim.no/print.",
    "contact": {
      "name": "Formheim",
      "url": "https://www.formheim.no/kontakt"
    }
  },
  "servers": [
    {
      "url": "https://api.formheim.no",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "MCP endpoint (Streamable HTTP) for the same services",
    "url": "https://api.formheim.no/mcp"
  },
  "tags": [
    {
      "name": "Catalog",
      "description": "Products."
    },
    {
      "name": "Print service",
      "description": "Print service data and preliminary estimates."
    },
    {
      "name": "Print requests",
      "description": "Register files, hand over to customer confirmation, and follow status."
    }
  ],
  "paths": {
    "/v1/products": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "listProducts",
        "security": [],
        "summary": "List and search products",
        "description": "Unknown query parameters or repeated parameters are rejected with 400. Use `next_cursor` from the response as `cursor` for the next page.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Free-text search."
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "description": "Category slug from `categories`."
          },
          {
            "name": "collection",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "description": "Collection slug from `collections`."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "price-asc",
                "price-desc"
              ],
              "default": "name"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            "description": "Opaque pagination cursor."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of products.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/products/{idOrSlug}": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "getProduct",
        "security": [],
        "summary": "Get one product",
        "description": "Accepts the product UUID or its slug. `price_nok` is the base price; variants carry price deltas.",
        "parameters": [
          {
            "name": "idOrSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "description": "Product UUID or slug, for example `babbia-vase`."
          }
        ],
        "responses": {
          "200": {
            "description": "The product.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/print/service": {
      "get": {
        "tags": [
          "Print service"
        ],
        "operationId": "getPrintService",
        "security": [],
        "summary": "Read the 3D-print service",
        "description": "Materials with colours and price per gram, qualities, strengths, finishes, rush options, build volume, limits and public prices (setup fee, colour change, minimum order).",
        "responses": {
          "200": {
            "description": "The print service description.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintServiceResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/print/quotes": {
      "post": {
        "tags": [
          "Print service"
        ],
        "operationId": "estimatePrint",
        "security": [],
        "summary": "Preliminary price estimate",
        "description": "Estimate from a client-side analysis of the model (geometry and settings). The geometry is supplied by the client and is not verified against any file here; the final quote is made by Formheim.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              },
              "example": {
                "analysis": {
                  "version": "1",
                  "rush": "standard",
                  "files": [
                    {
                      "file_id": "f1",
                      "sha256": "6c24412e72a5dd107b37c40333e54821d103e8a3e8e939292850a64e042731b3",
                      "format": "stl",
                      "size_bytes": 355084,
                      "unit_scale": 1,
                      "quantity": 1,
                      "settings": {
                        "material": "pla",
                        "num_colors": 1,
                        "color": null,
                        "quality": "standard",
                        "strength": "normal",
                        "finish": "none"
                      },
                      "plates": [
                        {
                          "id": "plate-1",
                          "source_index": 0,
                          "selected": true,
                          "mesh": {
                            "triangle_count": 2208,
                            "volume_mm3": 33271.78,
                            "surface_area_mm2": 5008.63,
                            "horizontal_area_mm2": 1465.72,
                            "dimensions_mm": [
                              40,
                              40,
                              40
                            ],
                            "triangle_density": 0.0345,
                            "overhang_percentage": 32.61,
                            "thin_wall_percentage": 0
                          }
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preliminary estimate (NOK). `customer_total_nok` includes VAT and `shipping_estimate_nok`; the minimum price applies to that total, so do not add shipping on top.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteResponse"
                },
                "example": {
                  "estimate": {
                    "currency": "NOK",
                    "vat_included": true,
                    "shipping_estimate_nok": 89,
                    "customer_total_nok": 349,
                    "minimum_applied": true,
                    "preliminary": true,
                    "pricing_version": 2,
                    "warnings": []
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/print/upload-links": {
      "post": {
        "tags": [
          "Print requests"
        ],
        "operationId": "createUploadLink",
        "security": [],
        "summary": "Create a link where the customer uploads the files",
        "description": "Creates a file-less request and returns `upload_url` for the customer, plus `request_id` and `request_key` (a secret; returned only for a newly created request). The customer opens the link, analyses and uploads their files in the browser, and the analysis becomes available in the request status. Send `request_id` and `request_key` together to get a new link for a request you already prepared. A link is valid for one hour; at most five links per request. The fragment of `upload_url` (after `#`) is a secret: do not log it.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadLinkRequest"
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Link created. Store `request_key` as a secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadLinkResponse"
                },
                "example": {
                  "request_id": "11111111-1111-4111-8111-111111111111",
                  "request_key": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
                  "upload_url": "https://www.formheim.no/print/agent/upload#BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA",
                  "link_expires_at": "2099-01-01T01:00:00.000Z",
                  "request_expires_at": "2099-01-01T03:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/print/requests": {
      "post": {
        "tags": [
          "Print requests"
        ],
        "operationId": "preparePrintRequest",
        "security": [],
        "summary": "Register files and get upload URLs",
        "description": "Registers a file manifest (name, format, size, SHA-256) and returns one signed upload URL per file plus `request_key`, a secret that authorizes everything else for this request. Upload the raw bytes of each file with `PUT` to `uploads[].url` before confirming. Requests and unused uploads expire automatically after 24 hours.\n\n**Retries.** `request_key` is only ever returned once. Repeating the call with the same `idempotency_key` but without `request_id` and `request_key` returns 403 and never a second request or the earlier key; if you lost the response, start over with a new `idempotency_key` and let the abandoned request expire. To get fresh signed upload URLs for a request you already hold (for example when they expired), repeat the call with the same `idempotency_key` and files plus `request_id` and `request_key`. That returns the same request and key, and works only while the request is still `draft` (410 afterwards, 409 if the files differ).\n\nA client may have at most three unfinished requests with files at a time and a limited number per hour; beyond that the API returns 429.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrepareRequest"
              },
              "example": {
                "idempotency_key": "11111111-1111-4111-8111-111111111111",
                "files": [
                  {
                    "file_id": "f1",
                    "file_name": "kule.stl",
                    "format": "stl",
                    "size_bytes": 355084,
                    "sha256": "6c24412e72a5dd107b37c40333e54821d103e8a3e8e939292850a64e042731b3"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request created. Store `request_key` as a secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrepareResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/print/requests/{request_id}": {
      "get": {
        "tags": [
          "Print requests"
        ],
        "operationId": "getPrintRequestStatus",
        "summary": "Technical status of a request",
        "description": "How many files are uploaded and where the request is in its life cycle: `draft` until the confirmation URL has been issued, `ready_for_confirmation` while it waits for the customer, then `submitted` once the customer has sent it; `expired` if it timed out. Authorized by the `request_key` as a bearer token.",
        "security": [
          {
            "requestKey": []
          }
        ],
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Technical status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestStatusResponse"
                },
                "example": {
                  "status": "submitted",
                  "uploaded_files": 1,
                  "total_files": 1,
                  "requires_client_analysis": false
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/print/requests/{request_id}/confirmation": {
      "post": {
        "tags": [
          "Print requests"
        ],
        "operationId": "requestCustomerConfirmation",
        "security": [],
        "summary": "Hand the request over to customer confirmation",
        "description": "Call after every file is uploaded. Returns `confirmation_url`: a Formheim page where the customer reviews files and estimate, enters name, e-mail and delivery address (postal code, city, country), and sends the request. No offer request is submitted and no customer e-mail is sent until the customer confirms. Treat `confirmation_url` as a secret and show it only to the customer. The body must not contain `request_id`; it comes from the path. If the confirmation link was opened, expired or lost, repeat this operation on the same unsubmitted, unexpired request with its `request_key`, the same analysis and a valid `idempotency_key`. It issues a fresh `confirmation_url` and `quote_status_key`; unopened older confirmation links stop working. Earlier status keys remain subject to the same sharing permission, expiry and revocation as the newest key. Changed analysis returns 409 `CONFLICT`; at most 10 confirmation links may be issued per request, then 429 `RATE_LIMITED`. Do not start a new request merely to replace a confirmation link. Customer confirmation sends a request for an offer, not an order. Do not use this operation to recover denied status access.",
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The `request_key` goes in the body here, not in the Authorization header.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmationRequest"
              },
              "example": {
                "request_key": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFG",
                "idempotency_key": "22222222-2222-4222-8222-222222222222",
                "analysis": {
                  "version": "1",
                  "rush": "standard",
                  "files": [
                    {
                      "file_id": "f1",
                      "sha256": "6c24412e72a5dd107b37c40333e54821d103e8a3e8e939292850a64e042731b3",
                      "format": "stl",
                      "size_bytes": 355084,
                      "unit_scale": 1,
                      "quantity": 1,
                      "settings": {
                        "material": "pla",
                        "num_colors": 1,
                        "color": null,
                        "quality": "standard",
                        "strength": "normal",
                        "finish": "none"
                      },
                      "plates": [
                        {
                          "id": "plate-1",
                          "source_index": 0,
                          "selected": true,
                          "mesh": {
                            "triangle_count": 2208,
                            "volume_mm3": 33271.78,
                            "surface_area_mm2": 5008.63,
                            "horizontal_area_mm2": 1465.72,
                            "dimensions_mm": [
                              40,
                              40,
                              40
                            ],
                            "triangle_density": 0.0345,
                            "overhang_percentage": 32.61,
                            "thin_wall_percentage": 0
                          }
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation page URL and status key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfirmationResponse"
                },
                "example": {
                  "requires_confirmation": true,
                  "confirmation_url": "https://www.formheim.no/print/agent#0123456789abcdefghijklmnopqrstuvwxyzABCDEFG",
                  "quote_status_key": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFG",
                  "expires_at": "2026-11-05T10:19:07.204Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/print/quote-status": {
      "get": {
        "tags": [
          "Print requests"
        ],
        "operationId": "getQuoteStatus",
        "summary": "Customer-facing status of a submitted request",
        "description": "Authorized by the `quote_status_key` as a bearer token. Before confirmation it can report `Avventer bekreftelse`. After confirmation it requires status sharing to be allowed on the Formheim page; the customer can stop sharing at any time. On `ACCESS_DENIED`, stop polling and ask the customer to use the Formheim page or contact Formheim. Do not call the confirmation endpoint to recover status access. The status shows progress only, never prices or personal data. `status` is one of: `Avventer bekreftelse` (not confirmed yet), `Mottatt` (a request for an offer was received; this is NOT an order), `Under behandling`, `Avventer pris`, `Klar til godkjenning` (offer sent, waiting for customer approval), `Estimat godkjent`, `Til vurdering` (customer reviews models and final price), `Korrigering ønsket`, `Ny versjon på vei`, `Godkjent` (approved, order not created yet), `Avslått`, and `Bestilt` (the only status where an order exists; `order_number` is included). `meaning` and `next_step` explain the status in Norwegian. `order_placed` is true only for `Bestilt`. Payment, production and delivery are not shown.",
        "security": [
          {
            "quoteStatusKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteStatusResponse"
                },
                "example": {
                  "status": "Mottatt",
                  "meaning": "Kunden har sendt inn en forespørsel om tilbud, og Formheim har mottatt den. Dette er en tilbudsforespørsel og ikke en bestilling. Ingenting er bestilt eller betalt.",
                  "next_step": "Formheim kontrollerer filene og sender et endelig tilbud på e-post, normalt innen 24 timer. Kunden trenger ikke gjøre noe nå.",
                  "order_placed": false
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "requestKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "`request_key` from `POST /v1/print/requests` (43 characters, base64url)."
      },
      "quoteStatusKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "`quote_status_key` from the confirmation step (43 characters, base64url)."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "INVALID_ARGUMENT",
                  "NOT_FOUND",
                  "ACCESS_DENIED",
                  "CONFLICT",
                  "EXPIRED",
                  "RATE_LIMITED",
                  "TEMPORARY_UNAVAILABLE",
                  "UNSUPPORTED_ANALYSIS",
                  "MANUAL_REVIEW_REQUIRED",
                  "PRICE_CHANGED"
                ]
              },
              "message": {
                "type": "string"
              },
              "fallback_url": {
                "type": "string",
                "const": "https://www.formheim.no/print"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "ProductListResponse": {
        "type": "object",
        "properties": {
          "products": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "price_nok": {
                  "type": "number",
                  "minimum": 0
                },
                "price_is_from": {
                  "type": "boolean"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "image_url": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "slug",
                "name",
                "price_nok",
                "price_is_from",
                "url",
                "image_url"
              ],
              "additionalProperties": false
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "categories": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "slug",
                "name",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "collections": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "slug",
                "name",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "featured": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "price_nok": {
                  "type": "number",
                  "minimum": 0
                },
                "price_is_from": {
                  "type": "boolean"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "image_url": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "slug",
                "name",
                "price_nok",
                "price_is_from",
                "url",
                "image_url"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "products",
          "total",
          "next_cursor",
          "categories",
          "collections",
          "featured"
        ],
        "additionalProperties": false
      },
      "ProductResponse": {
        "type": "object",
        "properties": {
          "product": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "slug": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "price_nok": {
                "type": "number",
                "minimum": 0
              },
              "currency": {
                "type": "string",
                "const": "NOK"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "images": {
                "maxItems": 30,
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "availability": {
                "type": "string",
                "enum": [
                  "available",
                  "unavailable",
                  "sales_stopped",
                  "unknown"
                ]
              },
              "specifications": {
                "type": "object",
                "properties": {
                  "material": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "weight_g": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "dimensions_mm": {
                    "type": "object",
                    "properties": {
                      "depth": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "width": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "height": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      }
                    },
                    "required": [
                      "depth",
                      "width",
                      "height"
                    ],
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              "care_instructions": {
                "type": "string",
                "maxLength": 4000
              },
              "variants": {
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "available": {
                      "type": "boolean"
                    },
                    "price_delta_nok": {
                      "type": "number",
                      "description": "Indicative change for one selection against the single-unit starting price; totals with multiple selections are rounded together by checkout."
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "available",
                    "price_delta_nok"
                  ],
                  "additionalProperties": false
                }
              },
              "customizations": {
                "maxItems": 30,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "options": {
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255
                          },
                          "name": {
                            "type": "string"
                          },
                          "available": {
                            "type": "boolean"
                          },
                          "price_delta_nok": {
                            "type": "number",
                            "description": "Indicative change for one selection against the single-unit starting price; totals with multiple selections are rounded together by checkout."
                          }
                        },
                        "required": [
                          "value",
                          "name",
                          "available",
                          "price_delta_nok"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "required",
                    "options"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "id",
              "slug",
              "name",
              "description",
              "price_nok",
              "currency",
              "url",
              "images",
              "availability",
              "specifications",
              "variants",
              "customizations"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "product"
        ],
        "additionalProperties": false
      },
      "PrintServiceResponse": {
        "type": "object",
        "properties": {
          "analysis_version": {
            "type": "string",
            "const": "1"
          },
          "pricing_version": {
            "type": "number",
            "const": 2
          },
          "currency": {
            "type": "string",
            "const": "NOK"
          },
          "vat_included": {
            "type": "boolean",
            "const": true
          },
          "minimum_total_nok": {
            "type": "number",
            "minimum": 0
          },
          "public_prices": {
            "type": "object",
            "properties": {
              "setup_fee_nok": {
                "type": "number",
                "minimum": 0
              },
              "color_change_nok": {
                "type": "number",
                "minimum": 0
              },
              "minimum_total_nok": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "setup_fee_nok",
              "color_change_nok",
              "minimum_total_nok"
            ],
            "additionalProperties": false
          },
          "max_files": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "max_file_size_bytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "max_selected_plates": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "stl",
                "obj",
                "3mf"
              ]
            }
          },
          "materials": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "enum": [
                    "pla",
                    "petg",
                    "petg-cf",
                    "abs",
                    "tpu",
                    "asa"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "colors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "filament_type_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "hex": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      }
                    },
                    "required": [
                      "filament_type_id",
                      "name",
                      "hex"
                    ],
                    "additionalProperties": false
                  }
                },
                "rate_nok_per_g": {
                  "type": "number",
                  "minimum": 0
                }
              },
              "required": [
                "id",
                "label",
                "colors",
                "rate_nok_per_g"
              ],
              "additionalProperties": false
            }
          },
          "qualities": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "draft",
                "standard",
                "fine",
                "ultra"
              ]
            }
          },
          "strengths": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "light",
                "normal",
                "strong"
              ]
            }
          },
          "finishes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "none",
                "basic",
                "smooth"
              ]
            }
          },
          "rush_options": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "standard",
                "fast",
                "express"
              ]
            }
          },
          "build_volume_mm": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number",
                "minimum": 0
              },
              "y": {
                "type": "number",
                "minimum": 0
              },
              "z": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "x",
              "y",
              "z"
            ],
            "additionalProperties": false
          },
          "shipping_note": {
            "type": "string"
          },
          "delivery_note": {
            "type": "string"
          },
          "fallback_url": {
            "type": "string",
            "const": "https://www.formheim.no/print"
          },
          "analysis_url": {
            "type": "string",
            "const": "https://www.formheim.no/print/agent?mode=analysis"
          }
        },
        "required": [
          "analysis_version",
          "pricing_version",
          "currency",
          "vat_included",
          "minimum_total_nok",
          "public_prices",
          "max_files",
          "max_file_size_bytes",
          "max_selected_plates",
          "formats",
          "materials",
          "qualities",
          "strengths",
          "finishes",
          "rush_options",
          "build_volume_mm",
          "shipping_note",
          "delivery_note",
          "fallback_url",
          "analysis_url"
        ],
        "additionalProperties": false
      },
      "QuoteRequest": {
        "type": "object",
        "properties": {
          "analysis": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "1"
              },
              "files": {
                "minItems": 1,
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "file_id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,64}$"
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "stl",
                        "obj",
                        "3mf"
                      ]
                    },
                    "size_bytes": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 52428800
                    },
                    "unit_scale": {
                      "anyOf": [
                        {
                          "type": "number",
                          "const": 1
                        },
                        {
                          "type": "number",
                          "const": 10
                        },
                        {
                          "type": "number",
                          "const": 25.4
                        },
                        {
                          "type": "number",
                          "const": 1000
                        }
                      ]
                    },
                    "quantity": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "material": {
                          "type": "string",
                          "enum": [
                            "pla",
                            "petg",
                            "petg-cf",
                            "abs",
                            "tpu",
                            "asa"
                          ]
                        },
                        "num_colors": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 5
                        },
                        "color": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "filament_type_id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 255
                                },
                                "hex": {
                                  "type": "string",
                                  "pattern": "^#[0-9a-fA-F]{6}$"
                                }
                              },
                              "required": [
                                "filament_type_id",
                                "name",
                                "hex"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "quality": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "standard",
                            "fine",
                            "ultra"
                          ]
                        },
                        "strength": {
                          "type": "string",
                          "enum": [
                            "light",
                            "normal",
                            "strong"
                          ]
                        },
                        "finish": {
                          "type": "string",
                          "enum": [
                            "none",
                            "basic",
                            "smooth"
                          ]
                        }
                      },
                      "required": [
                        "material",
                        "num_colors",
                        "color",
                        "quality",
                        "strength",
                        "finish"
                      ],
                      "additionalProperties": false
                    },
                    "plates": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,64}$"
                          },
                          "source_index": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "selected": {
                            "type": "boolean"
                          },
                          "mesh": {
                            "type": "object",
                            "properties": {
                              "triangle_count": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 2000000
                              },
                              "volume_mm3": {
                                "type": "number",
                                "minimum": 0
                              },
                              "surface_area_mm2": {
                                "type": "number",
                                "minimum": 0
                              },
                              "horizontal_area_mm2": {
                                "type": "number",
                                "minimum": 0
                              },
                              "dimensions_mm": {
                                "type": "array",
                                "prefixItems": [
                                  {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  {
                                    "type": "number",
                                    "minimum": 0
                                  }
                                ],
                                "items": false,
                                "minItems": 3,
                                "maxItems": 3
                              },
                              "triangle_density": {
                                "type": "number",
                                "minimum": 0
                              },
                              "overhang_percentage": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 100
                              },
                              "thin_wall_percentage": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 100
                              }
                            },
                            "required": [
                              "triangle_count",
                              "volume_mm3",
                              "surface_area_mm2",
                              "dimensions_mm",
                              "triangle_density",
                              "overhang_percentage",
                              "thin_wall_percentage"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "source_index",
                          "selected",
                          "mesh"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "file_id",
                    "sha256",
                    "format",
                    "size_bytes",
                    "unit_scale",
                    "quantity",
                    "settings",
                    "plates"
                  ],
                  "additionalProperties": false
                }
              },
              "rush": {
                "type": "string",
                "enum": [
                  "standard",
                  "fast",
                  "express"
                ]
              }
            },
            "required": [
              "version",
              "files",
              "rush"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "analysis"
        ],
        "additionalProperties": false
      },
      "QuoteResponse": {
        "type": "object",
        "properties": {
          "estimate": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "const": "NOK"
              },
              "vat_included": {
                "type": "boolean",
                "const": true
              },
              "shipping_estimate_nok": {
                "type": "number",
                "minimum": 0,
                "description": "Estimated shipping, already included in customer_total_nok"
              },
              "customer_total_nok": {
                "type": "number",
                "minimum": 0,
                "description": "Total to pay in NOK including VAT and shipping_estimate_nok; the minimum price applies to this total"
              },
              "minimum_applied": {
                "type": "boolean"
              },
              "preliminary": {
                "type": "boolean",
                "const": true
              },
              "pricing_version": {
                "type": "number",
                "const": 2
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "currency",
              "vat_included",
              "shipping_estimate_nok",
              "customer_total_nok",
              "minimum_applied",
              "preliminary",
              "pricing_version",
              "warnings"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "estimate"
        ],
        "additionalProperties": false
      },
      "UploadLinkRequest": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "request_key": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          }
        },
        "additionalProperties": false
      },
      "UploadLinkResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "request_key": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "upload_url": {
            "type": "string",
            "format": "uri"
          },
          "link_expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "request_expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "request_id",
          "upload_url",
          "link_expires_at",
          "request_expires_at"
        ],
        "additionalProperties": false
      },
      "PrepareRequest": {
        "type": "object",
        "properties": {
          "idempotency_key": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "files": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "file_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "format": {
                  "type": "string",
                  "enum": [
                    "stl",
                    "obj",
                    "3mf"
                  ]
                },
                "size_bytes": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 52428800
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "file_name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                }
              },
              "required": [
                "file_id",
                "format",
                "size_bytes",
                "sha256",
                "file_name"
              ],
              "additionalProperties": false
            }
          },
          "request_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "request_key": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          }
        },
        "required": [
          "idempotency_key",
          "files"
        ],
        "additionalProperties": false
      },
      "PrepareResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "request_key": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "request_expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "uploads": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "file_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "method": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "expires_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                }
              },
              "required": [
                "file_id",
                "method",
                "url",
                "expires_at"
              ],
              "additionalProperties": false
            }
          },
          "upload_page_url": {
            "type": "string",
            "const": "https://www.formheim.no/print"
          }
        },
        "required": [
          "request_id",
          "request_key",
          "request_expires_at",
          "uploads",
          "upload_page_url"
        ],
        "additionalProperties": false
      },
      "ConfirmationRequest": {
        "type": "object",
        "properties": {
          "request_key": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "idempotency_key": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "analysis": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "1"
              },
              "files": {
                "minItems": 1,
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "file_id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,64}$"
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "stl",
                        "obj",
                        "3mf"
                      ]
                    },
                    "size_bytes": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 52428800
                    },
                    "unit_scale": {
                      "anyOf": [
                        {
                          "type": "number",
                          "const": 1
                        },
                        {
                          "type": "number",
                          "const": 10
                        },
                        {
                          "type": "number",
                          "const": 25.4
                        },
                        {
                          "type": "number",
                          "const": 1000
                        }
                      ]
                    },
                    "quantity": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "material": {
                          "type": "string",
                          "enum": [
                            "pla",
                            "petg",
                            "petg-cf",
                            "abs",
                            "tpu",
                            "asa"
                          ]
                        },
                        "num_colors": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 5
                        },
                        "color": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "filament_type_id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 255
                                },
                                "hex": {
                                  "type": "string",
                                  "pattern": "^#[0-9a-fA-F]{6}$"
                                }
                              },
                              "required": [
                                "filament_type_id",
                                "name",
                                "hex"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "quality": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "standard",
                            "fine",
                            "ultra"
                          ]
                        },
                        "strength": {
                          "type": "string",
                          "enum": [
                            "light",
                            "normal",
                            "strong"
                          ]
                        },
                        "finish": {
                          "type": "string",
                          "enum": [
                            "none",
                            "basic",
                            "smooth"
                          ]
                        }
                      },
                      "required": [
                        "material",
                        "num_colors",
                        "color",
                        "quality",
                        "strength",
                        "finish"
                      ],
                      "additionalProperties": false
                    },
                    "plates": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,64}$"
                          },
                          "source_index": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "selected": {
                            "type": "boolean"
                          },
                          "mesh": {
                            "type": "object",
                            "properties": {
                              "triangle_count": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 2000000
                              },
                              "volume_mm3": {
                                "type": "number",
                                "minimum": 0
                              },
                              "surface_area_mm2": {
                                "type": "number",
                                "minimum": 0
                              },
                              "horizontal_area_mm2": {
                                "type": "number",
                                "minimum": 0
                              },
                              "dimensions_mm": {
                                "type": "array",
                                "prefixItems": [
                                  {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  {
                                    "type": "number",
                                    "minimum": 0
                                  }
                                ],
                                "items": false,
                                "minItems": 3,
                                "maxItems": 3
                              },
                              "triangle_density": {
                                "type": "number",
                                "minimum": 0
                              },
                              "overhang_percentage": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 100
                              },
                              "thin_wall_percentage": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 100
                              }
                            },
                            "required": [
                              "triangle_count",
                              "volume_mm3",
                              "surface_area_mm2",
                              "dimensions_mm",
                              "triangle_density",
                              "overhang_percentage",
                              "thin_wall_percentage"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "source_index",
                          "selected",
                          "mesh"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "file_id",
                    "sha256",
                    "format",
                    "size_bytes",
                    "unit_scale",
                    "quantity",
                    "settings",
                    "plates"
                  ],
                  "additionalProperties": false
                }
              },
              "rush": {
                "type": "string",
                "enum": [
                  "standard",
                  "fast",
                  "express"
                ]
              }
            },
            "required": [
              "version",
              "files",
              "rush"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_key",
          "idempotency_key",
          "analysis"
        ],
        "additionalProperties": false
      },
      "ConfirmationResponse": {
        "type": "object",
        "properties": {
          "requires_confirmation": {
            "type": "boolean",
            "const": true
          },
          "confirmation_url": {
            "type": "string",
            "format": "uri"
          },
          "quote_status_key": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "requires_confirmation",
          "confirmation_url",
          "quote_status_key",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "RequestStatusResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "ready_for_confirmation",
              "submitting",
              "submitted",
              "expired",
              "needs_reconciliation"
            ]
          },
          "uploaded_files": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "total_files": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "requires_client_analysis": {
            "type": "boolean"
          },
          "analysis": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "1"
              },
              "files": {
                "minItems": 1,
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "file_id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,64}$"
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "stl",
                        "obj",
                        "3mf"
                      ]
                    },
                    "size_bytes": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 52428800
                    },
                    "unit_scale": {
                      "anyOf": [
                        {
                          "type": "number",
                          "const": 1
                        },
                        {
                          "type": "number",
                          "const": 10
                        },
                        {
                          "type": "number",
                          "const": 25.4
                        },
                        {
                          "type": "number",
                          "const": 1000
                        }
                      ]
                    },
                    "quantity": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "material": {
                          "type": "string",
                          "enum": [
                            "pla",
                            "petg",
                            "petg-cf",
                            "abs",
                            "tpu",
                            "asa"
                          ]
                        },
                        "num_colors": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 5
                        },
                        "color": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "filament_type_id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 255
                                },
                                "hex": {
                                  "type": "string",
                                  "pattern": "^#[0-9a-fA-F]{6}$"
                                }
                              },
                              "required": [
                                "filament_type_id",
                                "name",
                                "hex"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "quality": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "standard",
                            "fine",
                            "ultra"
                          ]
                        },
                        "strength": {
                          "type": "string",
                          "enum": [
                            "light",
                            "normal",
                            "strong"
                          ]
                        },
                        "finish": {
                          "type": "string",
                          "enum": [
                            "none",
                            "basic",
                            "smooth"
                          ]
                        }
                      },
                      "required": [
                        "material",
                        "num_colors",
                        "color",
                        "quality",
                        "strength",
                        "finish"
                      ],
                      "additionalProperties": false
                    },
                    "plates": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,64}$"
                          },
                          "source_index": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "selected": {
                            "type": "boolean"
                          },
                          "mesh": {
                            "type": "object",
                            "properties": {
                              "triangle_count": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 2000000
                              },
                              "volume_mm3": {
                                "type": "number",
                                "minimum": 0
                              },
                              "surface_area_mm2": {
                                "type": "number",
                                "minimum": 0
                              },
                              "horizontal_area_mm2": {
                                "type": "number",
                                "minimum": 0
                              },
                              "dimensions_mm": {
                                "type": "array",
                                "prefixItems": [
                                  {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  {
                                    "type": "number",
                                    "minimum": 0
                                  }
                                ],
                                "items": false,
                                "minItems": 3,
                                "maxItems": 3
                              },
                              "triangle_density": {
                                "type": "number",
                                "minimum": 0
                              },
                              "overhang_percentage": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 100
                              },
                              "thin_wall_percentage": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 100
                              }
                            },
                            "required": [
                              "triangle_count",
                              "volume_mm3",
                              "surface_area_mm2",
                              "dimensions_mm",
                              "triangle_density",
                              "overhang_percentage",
                              "thin_wall_percentage"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "source_index",
                          "selected",
                          "mesh"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "file_id",
                    "sha256",
                    "format",
                    "size_bytes",
                    "unit_scale",
                    "quantity",
                    "settings",
                    "plates"
                  ],
                  "additionalProperties": false
                }
              },
              "rush": {
                "type": "string",
                "enum": [
                  "standard",
                  "fast",
                  "express"
                ]
              }
            },
            "required": [
              "version",
              "files",
              "rush"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "status",
          "uploaded_files",
          "total_files",
          "requires_client_analysis"
        ],
        "additionalProperties": false
      },
      "QuoteStatusResponse": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "Avventer bekreftelse",
                  "Mottatt",
                  "Under behandling",
                  "Avventer pris",
                  "Klar til godkjenning",
                  "Estimat godkjent",
                  "Til vurdering",
                  "Korrigering ønsket",
                  "Ny versjon på vei",
                  "Godkjent",
                  "Avslått"
                ]
              },
              "meaning": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500,
                "description": "What the status means for the customer (Norwegian)"
              },
              "next_step": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500,
                "description": "What happens next and who acts (Norwegian)"
              },
              "order_placed": {
                "type": "boolean",
                "const": false
              }
            },
            "required": [
              "status",
              "meaning",
              "next_step",
              "order_placed"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "Bestilt"
              },
              "order_number": {
                "type": "string",
                "minLength": 1
              },
              "meaning": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500,
                "description": "What the status means for the customer (Norwegian)"
              },
              "next_step": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500,
                "description": "What happens next and who acts (Norwegian)"
              },
              "order_placed": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "status",
              "order_number",
              "meaning",
              "next_step",
              "order_placed"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "responses": {
      "Error400": {
        "description": "INVALID_ARGUMENT: unknown, missing or malformed input. Also returned for unknown query parameters.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "INVALID_ARGUMENT",
                "message": "Ugyldig forespørsel."
              }
            }
          }
        }
      },
      "Error403": {
        "description": "ACCESS_DENIED: missing, wrong or revoked key. The response never reveals whether the resource exists.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error404": {
        "description": "NOT_FOUND: no such resource.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error409": {
        "description": "CONFLICT or PRICE_CHANGED: the resource is not in a state that allows this call, or the price changed since the estimate.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error410": {
        "description": "EXPIRED: the request or its keys have expired. Start a new request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error413": {
        "description": "The request body exceeds 1 MiB (INVALID_ARGUMENT).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error415": {
        "description": "The request is not `application/json` (INVALID_ARGUMENT).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error422": {
        "description": "UNSUPPORTED_ANALYSIS or MANUAL_REVIEW_REQUIRED: the model cannot be priced automatically. `error.fallback_url` points to https://www.formheim.no/print.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error429": {
        "description": "RATE_LIMITED: too many requests. Retry later.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error503": {
        "description": "TEMPORARY_UNAVAILABLE: the service or this part of it is temporarily unavailable.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
