{
  "openapi": "3.0.0",
  "paths": {
    "/v1/print-farm/orders": {
      "get": {
        "description": "Returns a paginated list of orders allocated to your print farm, sorted by creation date (newest first). Results can be narrowed with the `status`, `email`, `phone`, `designerName`, and `courier` filters. Requires an API key with the `READ_ORDERS` (or `FULL`) permission scope.",
        "operationId": "listPrintFarmOrders",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "1-based page index.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Page size (max 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by order status. Accepts a comma-separated list to match any of several statuses.",
            "schema": {
              "example": "allocated,printing",
              "type": "string"
            }
          },
          {
            "name": "email",
            "required": false,
            "in": "query",
            "description": "Filter by customer email (case-insensitive partial match).",
            "schema": {
              "example": "jane@example.com",
              "type": "string"
            }
          },
          {
            "name": "phone",
            "required": false,
            "in": "query",
            "description": "Filter by customer phone number (case-insensitive partial match).",
            "schema": {
              "example": "555 123",
              "type": "string"
            }
          },
          {
            "name": "designerName",
            "required": false,
            "in": "query",
            "description": "Filter by designer name (case-insensitive partial match).",
            "schema": {
              "example": "John Smith",
              "type": "string"
            }
          },
          {
            "name": "courier",
            "required": false,
            "in": "query",
            "description": "Filter by shipping carrier (case-insensitive partial match).",
            "schema": {
              "example": "ups",
              "type": "string"
            }
          },
          {
            "name": "created_after",
            "required": false,
            "in": "query",
            "description": "Return only orders created on or after this ISO 8601 timestamp.",
            "schema": {
              "example": "2025-01-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "name": "created_before",
            "required": false,
            "in": "query",
            "description": "Return only orders created on or before this ISO 8601 timestamp.",
            "schema": {
              "example": "2025-12-31T23:59:59.999Z",
              "type": "string"
            }
          },
          {
            "name": "allocated_after",
            "required": false,
            "in": "query",
            "description": "Return only orders allocated on or after this ISO 8601 timestamp.",
            "schema": {
              "example": "2025-01-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "name": "allocated_before",
            "required": false,
            "in": "query",
            "description": "Return only orders allocated on or before this ISO 8601 timestamp.",
            "schema": {
              "example": "2025-12-31T23:59:59.999Z",
              "type": "string"
            }
          },
          {
            "name": "expand",
            "required": false,
            "in": "query",
            "description": "Comma-separated list of related resources to inline in the response. Allowed paths: `items.sku`, `items.sku.designs`, `items.sku.extras`, `items.sku.materials`. Requesting a child path automatically enables its parent.",
            "schema": {
              "example": "items.sku,items.sku.designs",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of orders allocated to the authenticated print farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPrintFarmOrdersResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`page` or `page_size` is outside the allowed range.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "List orders allocated to your print farm",
        "tags": [
          "Print Farm Orders"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "READ_ORDERS"
        ]
      }
    },
    "/v1/print-farm/orders/{orderId}": {
      "get": {
        "description": "Returns the order matching the given `orderId`, scoped to your print farm. Requires an API key with the `READ_ORDERS` (or `FULL`) permission scope.",
        "operationId": "getPrintFarmOrder",
        "parameters": [
          {
            "name": "orderId",
            "required": true,
            "in": "path",
            "description": "The unique order identifier.",
            "schema": {
              "example": "AP7K2M9X",
              "type": "string"
            }
          },
          {
            "name": "expand",
            "required": false,
            "in": "query",
            "description": "Comma-separated list of related resources to inline in the response. Allowed paths: `items.sku`, `items.sku.designs`, `items.sku.extras`, `items.sku.materials`. Requesting a child path automatically enables its parent.",
            "schema": {
              "example": "items.sku,items.sku.designs",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintFarmOrderResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No order with this `orderId` is allocated to your print farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Get one order allocated to your print farm",
        "tags": [
          "Print Farm Orders"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "READ_ORDERS"
        ]
      }
    },
    "/v1/print-farm/orders/{orderId}/status": {
      "patch": {
        "description": "Moves an order belonging to your print farm to a new status. The print-farm transition matrix is intentionally tighter than the admin surface - only specific transitions are accepted, and any other change returns `400`.\n\nCurrently supported:\n- `paid → in_production`\n- `in_production → shipping` - requires `tracking_number` and `courier`. Pass `courier` as a code from `GET /print-farm/courier-options` (e.g. `ups`). For carriers not in the catalog, use `courier: \"other\"` together with `courier_name`; the order will be flagged for manual ShipStation sync.\n- `shipping → returned` and `completed → returned` - no body fields beyond `status`. Triggers an internal admin notification; the customer is NOT emailed and no webhook is delivered.\n\nSame-status requests are a no-op. Side effects (designer webhook delivery, customer status email, ShipStation mark-shipped on `shipping`, admin manual-sync alert when applicable, returned-order admin notification) fire after the DB update and never fail the request - check your webhook + email logs to verify. Requires an API key with the `WRITE_ORDERS` (or `FULL`) permission scope.",
        "operationId": "updatePrintFarmOrderStatus",
        "parameters": [
          {
            "name": "orderId",
            "required": true,
            "in": "path",
            "description": "The unique order identifier.",
            "schema": {
              "example": "AP7K2M9X",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Status transition request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrintFarmOrderStatusBodyDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status updated (or unchanged if the request was a no-op).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePrintFarmOrderStatusResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Body validation failed, or the requested transition is not allowed from the order's current status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No order with this `orderId` is allocated to your print farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Transition an order to a new status",
        "tags": [
          "Print Farm Orders"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "WRITE_ORDERS"
        ]
      }
    },
    "/v1/print-farm/skus": {
      "get": {
        "description": "Returns a paginated list of SKUs visible to your print farm. A SKU is visible if it appears in an order allocated to your farm, or if its `stock_list` references a stock you hold inventory for. Requires an API key with the `SKU` (or `FULL`) permission scope.",
        "operationId": "listPrintFarmSkus",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "1-based page index.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Page size (max 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "id",
            "required": false,
            "in": "query",
            "description": "Filter by SKU id. Accepts a comma-separated list of UUIDs to match any.",
            "schema": {
              "example": "sku_aB3xKp9wFqZ7vM2nLpHt12cN8jR3sLkPm",
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by SKU status. Accepts a comma-separated list (active, inactive, deleted).",
            "schema": {
              "example": "active",
              "type": "string"
            }
          },
          {
            "name": "code",
            "required": false,
            "in": "query",
            "description": "Filter by SKU code (case-insensitive partial match).",
            "schema": {
              "example": "PLA-RED",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of SKUs visible to the authenticated print farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPrintFarmSkusResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`page` or `page_size` is outside the allowed range.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "List SKUs visible to your print farm",
        "tags": [
          "Print Farm SKUs"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "SKU"
        ]
      }
    },
    "/v1/print-farm/skus/{id}": {
      "get": {
        "description": "Returns the SKU matching the given `id`, only if it is visible to your print farm (via an allocated order or held stock). Requires an API key with the `SKU` (or `FULL`) permission scope.",
        "operationId": "getPrintFarmSku",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The public SKU identifier (`sku_…`) returned by the list endpoint.",
            "schema": {
              "example": "sku_aB3xKp9wFqZ7vM2nLpHt12cN8jR3sLkPm",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested SKU.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintFarmSkuResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No SKU with this `id` is visible to your print farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Get one SKU visible to your print farm",
        "tags": [
          "Print Farm SKUs"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "SKU"
        ]
      }
    },
    "/v1/print-farm/designs": {
      "get": {
        "description": "Returns a paginated list of approved designs reachable from your farm. A design is visible iff it is referenced by a SKU that appears in one of your allocated orders, or in a SKU whose stock is held at one of your farms. Each entry includes a short-lived presigned URL for downloading the design file. Requires an API key with the `SKU` (or `FULL`) permission scope.",
        "operationId": "listPrintFarmDesigns",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "1-based page index.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Page size (max 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "id",
            "required": false,
            "in": "query",
            "description": "Filter by design id. Accepts a comma-separated list of UUIDs.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "name",
            "required": false,
            "in": "query",
            "description": "Filter by design name (case-insensitive partial match).",
            "schema": {
              "example": "dragon",
              "type": "string"
            }
          },
          {
            "name": "ams_required",
            "required": false,
            "in": "query",
            "description": "Filter to designs that require (true) or do not require (false) an AMS.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "assembly",
            "required": false,
            "in": "query",
            "description": "Filter to designs that require (true) or do not require (false) assembly.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "required_filament",
            "required": false,
            "in": "query",
            "description": "Filter to designs that require (true) or do not require (false) a specific filament.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of approved designs visible to the authenticated farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPrintFarmDesignsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`page` or `page_size` is outside the allowed range.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "List approved designs visible to your farm",
        "tags": [
          "Print Farm Designs"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "SKU"
        ]
      }
    },
    "/v1/print-farm/designs/{id}": {
      "get": {
        "description": "Returns the approved design matching the given `id`, scoped to designs reachable from your farm via the SKU graph (orders ∪ stock_levels), with a short-lived presigned URL for downloading the design file. Requires an API key with the `SKU` (or `FULL`) permission scope.",
        "operationId": "getPrintFarmDesign",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The public design identifier (`dsg_…`) returned by the list endpoint.",
            "schema": {
              "example": "dsg_kP4xT8aBnLf2sH9eY3jZ5dM7cR1vQbWtJ",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested design.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintFarmDesignResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved design with this `id` is visible to your farm (it may exist in the catalog but isn't reachable via any of your orders or stock_levels).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Get one approved design visible to your farm",
        "tags": [
          "Print Farm Designs"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "SKU"
        ]
      }
    },
    "/v1/print-farm/extras": {
      "get": {
        "description": "Returns a paginated list of approved extras reachable from your farm. An extra is visible iff it is referenced in `extra_list` of a SKU that appears in one of your allocated orders, or in a SKU whose stock is held at one of your farms. Extras outside that chain are not returned. Requires an API key with the `SKU` (or `FULL`) permission scope.",
        "operationId": "listPrintFarmExtras",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "1-based page index.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Page size (max 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "id",
            "required": false,
            "in": "query",
            "description": "Filter by extra id. Accepts a comma-separated list of UUIDs.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "name",
            "required": false,
            "in": "query",
            "description": "Filter by extra name (case-insensitive partial match).",
            "schema": {
              "example": "spring",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of approved extras visible to the authenticated farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPrintFarmExtrasResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`page` or `page_size` is outside the allowed range.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "List approved extras visible to your farm",
        "tags": [
          "Print Farm Extras"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "SKU"
        ]
      }
    },
    "/v1/print-farm/extras/{id}": {
      "get": {
        "description": "Returns the approved extra matching the given `id`, scoped to extras reachable from your farm via the SKU graph (orders ∪ stock_levels). Requires an API key with the `SKU` (or `FULL`) permission scope.",
        "operationId": "getPrintFarmExtra",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The public extra identifier (`xtr_…`) returned by the list endpoint.",
            "schema": {
              "example": "xtr_mW2yH7cVjPq8rT5dN3kFx9eL4bA1uZcRh",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested extra.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintFarmExtraResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No approved extra with this `id` is visible to your farm (it may exist in the catalog but isn't reachable via any of your orders or stock_levels).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Get one approved extra visible to your farm",
        "tags": [
          "Print Farm Extras"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "SKU"
        ]
      }
    },
    "/v1/print-farm/materials": {
      "get": {
        "description": "Returns a paginated list of materials reachable from your farm, sorted by name. A material is visible iff it is referenced as a `default`-type entry in `skus.design_list[].materials[]` of a SKU that appears in one of your allocated orders, or in a SKU whose stock is held at one of your farms. Materials outside that chain are not returned. Requires an API key with the `SKU` (or `FULL`) permission scope.",
        "operationId": "listPrintFarmMaterials",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "1-based page index.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Page size (max 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "id",
            "required": false,
            "in": "query",
            "description": "Filter by material id. Accepts a comma-separated list of UUIDs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "required": false,
            "in": "query",
            "description": "Filter by material name (case-insensitive partial match).",
            "schema": {
              "example": "PLA",
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter by material type (case-insensitive partial match).",
            "schema": {
              "example": "PETG",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of materials visible to the authenticated farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPrintFarmMaterialsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`page` or `page_size` is outside the allowed range.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "List materials visible to your farm",
        "tags": [
          "Print Farm Materials"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "SKU"
        ]
      }
    },
    "/v1/print-farm/materials/{id}": {
      "get": {
        "description": "Returns the material matching the given `id`, scoped to materials reachable from your farm via the SKU graph (orders ∪ stock_levels). Requires an API key with the `SKU` (or `FULL`) permission scope.",
        "operationId": "getPrintFarmMaterial",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The public material identifier (`mat_…`) returned by the list endpoint.",
            "schema": {
              "example": "mat_jR6tN9pXq4sL8mB3dK7vH2cF5wYzA1ePsK",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested material.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintFarmMaterialResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No material with this `id` is visible to your farm (it may exist in the catalog but isn't referenced via any SKU reachable through your orders or stock_levels).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Get one material visible to your farm",
        "tags": [
          "Print Farm Materials"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "SKU"
        ]
      }
    },
    "/v1/print-farm/stock-levels": {
      "get": {
        "description": "Returns a paginated list of stock-level rows belonging to your print farm, sorted by creation date (newest first). Filter by `status`, `stock_id`, or `order_id`. Requires an API key with the `READ_STOCK` (or `FULL`) permission scope.",
        "operationId": "listPrintFarmStockLevels",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "1-based page index.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Page size (max 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by status. Accepts a comma-separated list (pending, in_production, completed, consumed).",
            "schema": {
              "example": "pending,in_production",
              "type": "string"
            }
          },
          {
            "name": "stock_id",
            "required": false,
            "in": "query",
            "description": "Filter by parent stock public id (`stk_…`). Unknown or wrong-type values return an empty result rather than an error.",
            "schema": {
              "example": "stk_aB3xKp9wFqZ7vM2nLpHt12cN8jR3sLk",
              "type": "string"
            }
          },
          {
            "name": "order_id",
            "required": false,
            "in": "query",
            "description": "Filter by order id (exact match).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of stock levels belonging to the authenticated print farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPrintFarmStockLevelsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`page` or `page_size` is outside the allowed range.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "List stock levels at your print farm",
        "tags": [
          "Print Farm Stock Levels"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "READ_STOCK"
        ]
      }
    },
    "/v1/print-farm/stock-levels/{id}": {
      "get": {
        "description": "Returns a single stock-level row by id, scoped to your print farm. Requires an API key with the `READ_STOCK` (or `FULL`) permission scope.",
        "operationId": "getPrintFarmStockLevel",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The public stock-level identifier (`slv_…`) returned by the list endpoint.",
            "schema": {
              "example": "slv_hG5dC2vKrPm8nT3sJ6yF1xL9bQ4wA7uZdF",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested stock level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintFarmStockLevelResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No stock level with this `id` is allocated to your print farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Get one stock level at your print farm",
        "tags": [
          "Print Farm Stock Levels"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "READ_STOCK"
        ]
      }
    },
    "/v1/print-farm/stock-levels/{id}/items-made": {
      "patch": {
        "description": "Increments `items_made` on a specific stock-level row by the given `quantity`. Transitions `pending → in_production` on the first non-zero increment, and `in_production → completed` when `items_made` reaches `stock_items_purchased` - completion also credits the farm wallet (one `payments` row, one `wallet.balance` bump) using `stock_level.manufacturer_price` as the payout amount.\n\nPass an `Idempotency-Key` header (any opaque string up to 255 chars) to make retries safe: a second request with the same key + body returns the cached response without re-executing. Same key with a different body returns `422`; an in-flight retry returns `409`.\n\nRequires an API key with the `WRITE_STOCK` (or `FULL`) permission scope.",
        "operationId": "addPrintFarmStockLevelItemsMade",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The public stock-level identifier (`slv_…`).",
            "schema": {
              "example": "slv_hG5dC2vKrPm8nT3sJ6yF1xL9bQ4wA7uZdF",
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Opaque caller-generated key (UUID recommended). When present, identical requests with the same key + body return the cached prior response without re-executing. Up to 255 characters.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Quantity to add to `items_made` for this stock level.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddStockLevelItemsMadeBodyDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated stock-level row.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintFarmStockLevelResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Body validation failed, or the requested `quantity` would push `items_made` past `stock_items_purchased`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No stock level with this `id` is allocated to your print farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The stock level is `consumed`, was modified concurrently, or another request with the same `Idempotency-Key` is already in flight.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "`Idempotency-Key` reuse with a different request body, or the key exceeded the maximum length (255 chars).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Add items printed to a stock level",
        "tags": [
          "Print Farm Stock Levels"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "WRITE_STOCK"
        ]
      }
    },
    "/v1/print-farm/stocks": {
      "get": {
        "description": "Returns a paginated list of stocks that have at least one `stock_level` row at one of your farms, sorted by creation date (newest first). Filter by `id`, `name`, or `approval_status`. Requires an API key with the `READ_STOCK` (or `FULL`) permission scope.",
        "operationId": "listPrintFarmStocks",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "1-based page index.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Page size (max 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "id",
            "required": false,
            "in": "query",
            "description": "Filter by stock id. Accepts a comma-separated list of UUIDs.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "name",
            "required": false,
            "in": "query",
            "description": "Filter by stock name (case-insensitive partial match).",
            "schema": {
              "example": "Dragon",
              "type": "string"
            }
          },
          {
            "name": "approval_status",
            "required": false,
            "in": "query",
            "description": "Filter by approval status. Accepts a comma-separated list (e.g. `approved,pending`).",
            "schema": {
              "example": "approved",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of stocks visible to the authenticated print farm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPrintFarmStocksResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`page` or `page_size` is outside the allowed range.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "List stocks visible to your print farm",
        "tags": [
          "Print Farm Stocks"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "READ_STOCK"
        ]
      }
    },
    "/v1/print-farm/stocks/{id}": {
      "get": {
        "description": "Returns a single stock by id, scoped to stocks that have a `stock_level` row at one of your farms. Requires an API key with the `READ_STOCK` (or `FULL`) permission scope.",
        "operationId": "getPrintFarmStock",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The public stock identifier (`stk_…`) returned by the list endpoint.",
            "schema": {
              "example": "stk_fL3sB8eYzKnQ7mX2dC9vR4tH6jW1uPbAcN",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested stock.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintFarmStockResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No stock with this `id` has any stock_level at your print farms.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Get one stock visible to your print farm",
        "tags": [
          "Print Farm Stocks"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": [
          "READ_STOCK"
        ]
      }
    },
    "/v1/print-farm/courier-options": {
      "get": {
        "description": "Returns every available courier option (code + name) for use when updating an order to `shipping`. The list is the same for every caller. Always includes an `other` entry as a fallback for couriers not in the catalog.",
        "operationId": "listPrintFarmCourierOptions",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The list of available courier options.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPrintFarmCourierOptionsResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "API key is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the required permission scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - wait until the window resets before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "List available courier options",
        "tags": [
          "Print Farm Courier Options"
        ],
        "x-audience": [
          "print_farm"
        ],
        "x-required-scopes": []
      }
    }
  },
  "info": {
    "title": "dapi.digital print farm API",
    "description": "The print farm API lets a production partner read the orders allocated to its farm, report their progress, and read the products, stocks and materials it produces.\n\n## Authentication\nSend an API key in the `x-api-key` header. Keys are created in the print farm dashboard. Each operation needs one of the permissions it lists; a key with `FULL` has them all.\n\nPermissions: `READ_ORDERS`, `WRITE_ORDERS`, `SKU`, `READ_STOCK`, `WRITE_STOCK`, `FULL`.\n\n## Rate limiting\nRequests are limited to 500 per 60-second window per API key. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`.\n\n## Errors\nErrors have the body `{ \"statusCode\", \"error\", \"message\" }`. `message` is a string, or a list of strings when the request failed validation.",
    "version": "1.0.0",
    "contact": {}
  },
  "tags": [
    {
      "name": "Print Farm Orders",
      "description": "Orders allocated to your farm, and moving them through their production statuses."
    },
    {
      "name": "Print Farm SKUs",
      "description": "Products in your allocated orders or in stocks you hold, with their designs, extras and stock."
    },
    {
      "name": "Print Farm Designs",
      "description": "Approved print files your SKUs use, with short-lived download links."
    },
    {
      "name": "Print Farm Extras",
      "description": "Approved bought-in parts that your SKUs ship with."
    },
    {
      "name": "Print Farm Materials",
      "description": "Materials your SKUs' designs are printed in."
    },
    {
      "name": "Print Farm Stock Levels",
      "description": "Stock batches ordered from your farm, and reporting the units you have printed."
    },
    {
      "name": "Print Farm Stocks",
      "description": "Ready-made stock products with at least one batch at your farm."
    },
    {
      "name": "Print Farm Courier Options",
      "description": "Couriers you can name when you mark an order as shipping."
    }
  ],
  "servers": [
    {
      "url": "https://public-api.dapi.digital",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key created in the print farm dashboard."
      }
    },
    "schemas": {
      "AddStockLevelItemsMadeBodyDto": {
        "type": "object",
        "properties": {
          "quantity": {
            "type": "number",
            "description": "Number of items to add to this stock level's `items_made` count. Must be ≥ 1 and must not push the total above `stock_items_purchased`.",
            "example": 1,
            "minimum": 1,
            "maximum": 100000
          }
        },
        "required": [
          "quantity"
        ]
      },
      "ApiErrorResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401,
            "description": "HTTP status code"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized",
            "description": "Short error label matching the HTTP status"
          },
          "message": {
            "type": "string",
            "example": "Invalid or inactive API key.",
            "description": "Human-readable description of what went wrong"
          }
        },
        "required": [
          "statusCode",
          "error",
          "message"
        ]
      },
      "ListPrintFarmCourierOptionsResponseDto": {
        "type": "object",
        "properties": {
          "courier_options": {
            "description": "All courier options available across configured ShipStation integrations.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmCourierOptionResponseDto"
            }
          }
        },
        "required": [
          "courier_options"
        ]
      },
      "ListPrintFarmDesignsResponseDto": {
        "type": "object",
        "properties": {
          "designs": {
            "description": "Approved designs on this page, sorted by creation date (newest first).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmDesignResponseDto"
            }
          },
          "page": {
            "type": "number",
            "description": "Page number returned, matching the `page` query parameter.",
            "example": 1,
            "minimum": 1
          },
          "page_size": {
            "type": "number",
            "description": "Number of items per page, matching the `page_size` query parameter.",
            "example": 20,
            "minimum": 1,
            "maximum": 100
          },
          "total": {
            "type": "number",
            "description": "Total number of approved designs across all pages.",
            "example": 42,
            "minimum": 0
          }
        },
        "required": [
          "designs",
          "page",
          "page_size",
          "total"
        ]
      },
      "ListPrintFarmExtrasResponseDto": {
        "type": "object",
        "properties": {
          "extras": {
            "description": "Approved extras on this page, sorted by creation date (newest first).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmExtraResponseDto"
            }
          },
          "page": {
            "type": "number",
            "description": "Page number returned, matching the `page` query parameter.",
            "example": 1,
            "minimum": 1
          },
          "page_size": {
            "type": "number",
            "description": "Number of items per page, matching the `page_size` query parameter.",
            "example": 20,
            "minimum": 1,
            "maximum": 100
          },
          "total": {
            "type": "number",
            "description": "Total number of approved extras across all pages.",
            "example": 42,
            "minimum": 0
          }
        },
        "required": [
          "extras",
          "page",
          "page_size",
          "total"
        ]
      },
      "ListPrintFarmMaterialsResponseDto": {
        "type": "object",
        "properties": {
          "materials": {
            "description": "Materials on this page, sorted by name (ascending).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmMaterialResponseDto"
            }
          },
          "page": {
            "type": "number",
            "description": "Page number returned, matching the `page` query parameter.",
            "example": 1,
            "minimum": 1
          },
          "page_size": {
            "type": "number",
            "description": "Number of items per page, matching the `page_size` query parameter.",
            "example": 20,
            "minimum": 1,
            "maximum": 100
          },
          "total": {
            "type": "number",
            "description": "Total number of materials across all pages (after filters are applied).",
            "example": 42,
            "minimum": 0
          }
        },
        "required": [
          "materials",
          "page",
          "page_size",
          "total"
        ]
      },
      "ListPrintFarmOrdersResponseDto": {
        "type": "object",
        "properties": {
          "orders": {
            "description": "Orders on this page, sorted by creation date (newest first).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmOrderResponseDto"
            }
          },
          "page": {
            "type": "number",
            "description": "Page number returned, matching the `page` query parameter.",
            "example": 1,
            "minimum": 1
          },
          "page_size": {
            "type": "number",
            "description": "Number of items per page, matching the `page_size` query parameter.",
            "example": 20,
            "minimum": 1,
            "maximum": 100
          },
          "total": {
            "type": "number",
            "description": "Total number of orders across all pages (after filters are applied).",
            "example": 42,
            "minimum": 0
          }
        },
        "required": [
          "orders",
          "page",
          "page_size",
          "total"
        ]
      },
      "ListPrintFarmSkusResponseDto": {
        "type": "object",
        "properties": {
          "skus": {
            "description": "SKUs on this page, sorted by creation date (newest first).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmSkuResponseDto"
            }
          },
          "page": {
            "type": "number",
            "description": "Page number returned, matching the `page` query parameter.",
            "example": 1,
            "minimum": 1
          },
          "page_size": {
            "type": "number",
            "description": "Number of items per page, matching the `page_size` query parameter.",
            "example": 20,
            "minimum": 1,
            "maximum": 100
          },
          "total": {
            "type": "number",
            "description": "Total number of SKUs across all pages (after filters are applied).",
            "example": 42,
            "minimum": 0
          }
        },
        "required": [
          "skus",
          "page",
          "page_size",
          "total"
        ]
      },
      "ListPrintFarmStockLevelsResponseDto": {
        "type": "object",
        "properties": {
          "stock_levels": {
            "description": "Stock levels on this page, sorted by creation date (newest first).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmStockLevelResponseDto"
            }
          },
          "page": {
            "type": "number",
            "description": "Page number returned, matching the `page` query parameter.",
            "example": 1,
            "minimum": 1
          },
          "page_size": {
            "type": "number",
            "description": "Number of items per page, matching the `page_size` query parameter.",
            "example": 20,
            "minimum": 1,
            "maximum": 100
          },
          "total": {
            "type": "number",
            "description": "Total number of stock levels across all pages (after filters are applied).",
            "example": 42,
            "minimum": 0
          }
        },
        "required": [
          "stock_levels",
          "page",
          "page_size",
          "total"
        ]
      },
      "ListPrintFarmStocksResponseDto": {
        "type": "object",
        "properties": {
          "stocks": {
            "description": "Stocks on this page, sorted by creation date (newest first).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmStockResponseDto"
            }
          },
          "page": {
            "type": "number",
            "description": "Page number returned, matching the `page` query parameter.",
            "example": 1,
            "minimum": 1
          },
          "page_size": {
            "type": "number",
            "description": "Number of items per page, matching the `page_size` query parameter.",
            "example": 20,
            "minimum": 1,
            "maximum": 100
          },
          "total": {
            "type": "number",
            "description": "Total number of stocks across all pages (after filters are applied).",
            "example": 42,
            "minimum": 0
          }
        },
        "required": [
          "stocks",
          "page",
          "page_size",
          "total"
        ]
      },
      "PrintFarmCourierOptionResponseDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Short courier code. Pass this value back when updating an order to `shipping`.",
            "example": "ups"
          },
          "name": {
            "type": "string",
            "description": "Human-readable courier name.",
            "example": "UPS"
          }
        },
        "required": [
          "code",
          "name"
        ]
      },
      "PrintFarmDesignFileDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "dfl_pL3xB9sK6mT2nH7yC1jZ4dR8vQ5wA9uXkF",
            "description": "Opaque public identifier for the file (`dfl_` prefix + 33 base62 chars). No endpoint currently consumes this id - it is provided for client-side tracking."
          },
          "file_name": {
            "type": "string",
            "example": "dragon.3mf",
            "description": "Original file name."
          },
          "file_type": {
            "type": "string",
            "example": "model/3mf",
            "description": "MIME type of the file."
          },
          "size": {
            "type": "object",
            "example": 524288,
            "description": "File size in bytes, if known.",
            "nullable": true
          },
          "download_url": {
            "type": "string",
            "example": "https://s3.amazonaws.com/...?X-Amz-Signature=...",
            "description": "Presigned GET URL for downloading the file."
          },
          "url_expires_at": {
            "type": "string",
            "example": "2025-05-20T15:30:00.000Z",
            "description": "ISO 8601 timestamp at which `download_url` expires. Re-fetch the parent resource after this time to obtain a fresh URL."
          }
        },
        "required": [
          "id",
          "file_name",
          "file_type",
          "download_url",
          "url_expires_at"
        ]
      },
      "PrintFarmDesignResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "dsg_kP4xT8aBnLf2sH9eY3jZ5dM7cR1vQbWtJ",
            "description": "Opaque public identifier for this design (`dsg_` prefix + 33 base62 chars). Use this value verbatim when referencing the design in other endpoints."
          },
          "name": {
            "type": "string",
            "example": "Dragon Figurine",
            "description": "Display name of the design."
          },
          "description": {
            "type": "object",
            "example": "Articulated dragon, 12cm tall.",
            "description": "Free-text description of the design.",
            "nullable": true
          },
          "color_number": {
            "type": "object",
            "example": 1,
            "description": "Number of distinct colours the design uses.",
            "nullable": true
          },
          "extra_parts": {
            "type": "object",
            "example": "Two M3 screws and one spring.",
            "description": "Free-text description of any non-printed parts needed.",
            "nullable": true
          },
          "extra_parts_config": {
            "type": "object",
            "description": "Structured configuration of the extra parts (e.g. quantities, images). Returned verbatim from storage.",
            "nullable": true
          },
          "required_filament": {
            "type": "boolean",
            "example": false,
            "description": "Whether the design requires a specific filament (see `materials_config` for the allowed set)."
          },
          "ams_required": {
            "type": "boolean",
            "example": false,
            "description": "Whether the design requires an Automatic Material System (AMS)."
          },
          "assembly": {
            "type": "boolean",
            "example": false,
            "description": "Whether the design requires post-print assembly."
          },
          "farm_instructions": {
            "type": "object",
            "example": "Print at 0.2mm layer height. Brim recommended.",
            "description": "Print-farm-facing instructions for producing the design.",
            "nullable": true
          },
          "materials_config": {
            "type": "object",
            "description": "Material configuration for the design. Shape: `{ mode, allowed_materials, saved_combinations? }`. Returned verbatim from storage.",
            "example": {
              "mode": "single",
              "allowed_materials": [
                {
                  "name": "Polymaker Polyterra Cotton White",
                  "type": "custom"
                }
              ]
            },
            "nullable": true
          },
          "hours_multiplier": {
            "type": "object",
            "example": "1.00",
            "description": "Multiplier applied to baseline print time when estimating production hours, as a numeric string.",
            "nullable": true
          },
          "grams_multiplier": {
            "type": "object",
            "example": "1.00",
            "description": "Multiplier applied to baseline filament usage when estimating grams, as a numeric string.",
            "nullable": true
          },
          "post_processing_multiplier": {
            "type": "object",
            "example": "1.00",
            "description": "Multiplier applied to baseline post-processing time, as a numeric string.",
            "nullable": true
          },
          "design_files": {
            "description": "All model files for this design (STL/3MF/etc.), each with a short-lived presigned download URL. Sorted by upload date (newest first).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmDesignFileDto"
            }
          },
          "extra_files": {
            "description": "Supporting files attached to this design (PDFs, manuals, spec sheets). Each entry includes a presigned download URL. Empty when no extras are uploaded.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmDesignFileDto"
            }
          }
        },
        "required": [
          "id",
          "name",
          "required_filament",
          "ams_required",
          "assembly",
          "design_files",
          "extra_files"
        ]
      },
      "PrintFarmExpandedDesignDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "dsg_kP4xT8aBnLf2sH9eY3jZ5dM7cR1vQbWtJ",
            "description": "Public identifier of the design (`dsg_…`)."
          },
          "name": {
            "type": "string",
            "example": "Dragon Body"
          },
          "description": {
            "type": "object",
            "nullable": true
          },
          "required_filament": {
            "type": "boolean",
            "example": false
          },
          "ams_required": {
            "type": "boolean",
            "example": false
          },
          "assembly": {
            "type": "boolean",
            "example": false
          },
          "farm_instructions": {
            "type": "object",
            "nullable": true
          },
          "design_files": {
            "description": "Model files with presigned download URLs.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmExpandedDesignFileDto"
            }
          },
          "extra_files": {
            "description": "Auxiliary files (manuals, support material) with presigned download URLs.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmExpandedDesignFileDto"
            }
          }
        },
        "required": [
          "id",
          "name",
          "required_filament",
          "ams_required",
          "assembly",
          "design_files",
          "extra_files"
        ]
      },
      "PrintFarmExpandedDesignFileDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "dfl_pL3xB9sK6mT2nH7yC1jZ4dR8vQ5wA9uXkF",
            "description": "Opaque public identifier of the file (`dfl_…`). Client-side tracking only."
          },
          "file_name": {
            "type": "string",
            "example": "dragon-body.3mf"
          },
          "file_type": {
            "type": "string",
            "example": "3mf"
          },
          "size": {
            "type": "object",
            "example": 1248320,
            "nullable": true
          },
          "download_url": {
            "type": "string",
            "description": "Short-lived presigned download URL.",
            "example": "https://s3.amazonaws.com/..."
          },
          "url_expires_at": {
            "type": "string",
            "description": "ISO 8601 timestamp at which the download URL stops working.",
            "example": "2026-05-21T13:00:00.000Z"
          }
        },
        "required": [
          "id",
          "file_name",
          "file_type",
          "download_url",
          "url_expires_at"
        ]
      },
      "PrintFarmExpandedExtraDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "xtr_mW2yH7cVjPq8rT5dN3kFx9eL4bA1uZcRh",
            "description": "Public identifier of the extra (`xtr_…`)."
          },
          "name": {
            "type": "string",
            "example": "M3 x 10mm screw",
            "description": "Display name of the extra."
          },
          "purchase_links": {
            "example": [
              "https://www.example.com/m3-screws"
            ],
            "description": "Purchase links for this extra.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "object",
            "example": "Stainless steel M3 x 10mm Phillips screws.",
            "description": "Free-text description.",
            "nullable": true
          },
          "price": {
            "type": "object",
            "example": "0.12",
            "description": "Catalog list price.",
            "nullable": true
          }
        },
        "required": [
          "id",
          "name",
          "purchase_links"
        ]
      },
      "PrintFarmExpandedMaterialDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "mat_jR6tN9pXq4sL8mB3dK7vH2cF5wYzA1ePsK",
            "description": "Public identifier of the material (`mat_…`)."
          },
          "name": {
            "type": "string",
            "example": "Polymaker Polyterra Cotton White",
            "description": "Display name of the material."
          },
          "type": {
            "type": "string",
            "example": "PLA",
            "description": "Filament family (e.g. PLA, PETG, ABS)."
          },
          "color": {
            "type": "object",
            "example": "#FFFFFF",
            "description": "Optional colour hint, free-text or hex.",
            "nullable": true
          }
        },
        "required": [
          "id",
          "name",
          "type"
        ]
      },
      "PrintFarmExpandedSkuDesignDto": {
        "type": "object",
        "properties": {
          "count": {
            "type": "number",
            "example": 1
          },
          "design_id": {
            "type": "string",
            "example": "dsg_kP4xT8aBnLf2sH9eY3jZ5dM7cR1vQbWtJ",
            "description": "Public identifier of the design (`dsg_…`)."
          },
          "materials": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmExpandedSkuDesignMaterialDto"
            }
          }
        },
        "required": [
          "count",
          "design_id",
          "materials"
        ]
      },
      "PrintFarmExpandedSkuDesignMaterialDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "example": "default"
          },
          "material_id": {
            "type": "object",
            "example": "mat_jR6tN9pXq4sL8mB3dK7vH2cF5wYzA1ePsK",
            "description": "Public material id (`mat_…`) when `type` is `default`. Null for custom.",
            "nullable": true
          },
          "name": {
            "type": "object",
            "example": "Transparent Red PLA",
            "nullable": true
          }
        },
        "required": [
          "type"
        ]
      },
      "PrintFarmExpandedSkuDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "sku_aB3xKp9wFqZ7vM2nLpHt12cN8jR3sLkPm",
            "description": "Public identifier of the SKU (`sku_…`)."
          },
          "name": {
            "type": "object",
            "nullable": true
          },
          "status": {
            "type": "string",
            "example": "active"
          },
          "code": {
            "type": "string",
            "example": "DRAGON-RED-PLA"
          },
          "description": {
            "type": "object",
            "nullable": true
          },
          "designs": {
            "description": "Designs that make up this SKU.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmExpandedSkuDesignDto"
            }
          },
          "extras": {
            "description": "Extras attached to this SKU (ids only).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmExpandedSkuExtraRefDto"
            }
          },
          "expanded_designs": {
            "description": "Present when `expand=items.sku.designs` is requested. One entry per unique design referenced by this SKU.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmExpandedDesignDto"
            }
          },
          "expanded_extras": {
            "description": "Present when `expand=items.sku.extras` is requested. One entry per unique extra referenced by this SKU.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmExpandedExtraDto"
            }
          },
          "expanded_materials": {
            "description": "Present when `expand=items.sku.materials` is requested. One entry per unique catalog material referenced across this SKU's designs.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmExpandedMaterialDto"
            }
          }
        },
        "required": [
          "id",
          "status",
          "code",
          "designs",
          "extras"
        ]
      },
      "PrintFarmExpandedSkuExtraRefDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "xtr_mW2yH7cVjPq8rT5dN3kFx9eL4bA1uZcRh",
            "description": "Public identifier of the extra (`xtr_…`)."
          },
          "qty": {
            "type": "number",
            "example": 1
          }
        },
        "required": [
          "id",
          "qty"
        ]
      },
      "PrintFarmExtraResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "xtr_mW2yH7cVjPq8rT5dN3kFx9eL4bA1uZcRh",
            "description": "Opaque public identifier for this extra (`xtr_` prefix + 33 base62 chars). Use this value verbatim when referencing the extra in other endpoints."
          },
          "name": {
            "type": "string",
            "example": "M3 screws (set of 4)",
            "description": "Display name of the extra."
          },
          "purchase_links": {
            "example": [
              "https://example.com/m3-screws"
            ],
            "description": "List of URLs where the extra can be purchased.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "object",
            "example": "Pack of four M3×10mm steel screws.",
            "description": "Free-text description of the extra.",
            "nullable": true
          },
          "price": {
            "type": "object",
            "example": "1.50",
            "description": "Unit price in USD, as a string to preserve precision.",
            "nullable": true
          }
        },
        "required": [
          "id",
          "name",
          "purchase_links"
        ]
      },
      "PrintFarmMaterialResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "mat_jR6tN9pXq4sL8mB3dK7vH2cF5wYzA1ePsK",
            "description": "Opaque public identifier for this material (`mat_` prefix + 33 base62 chars). Use this value verbatim when referencing the material in other endpoints."
          },
          "name": {
            "type": "string",
            "example": "Polymaker Polyterra Cotton White",
            "description": "Display name of the material."
          },
          "type": {
            "type": "string",
            "example": "PLA",
            "description": "Filament family (e.g. PLA, PETG, ABS)."
          },
          "color": {
            "type": "object",
            "example": "#FFFFFF",
            "description": "Optional colour hint, free-text or hex.",
            "nullable": true
          }
        },
        "required": [
          "id",
          "name",
          "type"
        ]
      },
      "PrintFarmOrderCustomerDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "John Doe",
            "description": "Full name of the recipient."
          },
          "shipping_address": {
            "type": "string",
            "example": "123 Main St, Springfield",
            "description": "Street address for delivery."
          },
          "notes": {
            "type": "object",
            "example": "Leave at the front door.",
            "description": "Free-text notes left by the customer for this order.",
            "nullable": true
          },
          "email": {
            "type": "object",
            "example": "john@example.com",
            "description": "Email address of the recipient.",
            "nullable": true
          },
          "phone": {
            "type": "object",
            "example": "+1 555 123 4567",
            "description": "Contact phone number for the delivery.",
            "nullable": true
          },
          "city": {
            "type": "object",
            "example": "Springfield",
            "description": "City for the delivery destination.",
            "nullable": true
          },
          "country": {
            "type": "object",
            "example": "United States",
            "description": "Country for the delivery destination.",
            "nullable": true
          }
        },
        "required": [
          "name",
          "shipping_address"
        ]
      },
      "PrintFarmOrderCustomLabelDto": {
        "type": "object",
        "properties": {
          "productName": {
            "type": "string",
            "example": "Dragon Figurine",
            "description": "Name of the product (listing) this custom label belongs to."
          },
          "url": {
            "type": "string",
            "example": "https://cdn.dapi.digital/labels/dragon-figurine.pdf",
            "description": "Public URL of the custom label. May be an image or a PDF."
          }
        },
        "required": [
          "productName",
          "url"
        ]
      },
      "PrintFarmOrderExtrasDto": {
        "type": "object",
        "properties": {
          "ams_required": {
            "type": "boolean",
            "example": false,
            "description": "Whether the order requires an Automatic Material System (AMS)."
          },
          "assembly": {
            "type": "boolean",
            "example": false,
            "description": "Whether the order requires assembly."
          },
          "extra_parts": {
            "type": "boolean",
            "example": false,
            "description": "Whether the order includes extra parts."
          },
          "custom_filament": {
            "type": "boolean",
            "example": false,
            "description": "Whether the order requires custom filament."
          }
        },
        "required": [
          "ams_required",
          "assembly",
          "extra_parts",
          "custom_filament"
        ]
      },
      "PrintFarmOrderItemDto": {
        "type": "object",
        "properties": {
          "skuId": {
            "type": "string",
            "example": "sku_aB3xKp9wFqZ7vM2nLpHt12cN8jR3sLkPm",
            "description": "Public identifier of the SKU (variant) for this line item (`sku_…`)."
          },
          "quantity": {
            "type": "number",
            "example": 2,
            "description": "Number of units ordered for this SKU."
          },
          "sku": {
            "description": "Present when `expand=items.sku` is requested. Inlines the SKU referenced by `skuId`.",
            "allOf": [
              {
                "$ref": "#/components/schemas/PrintFarmExpandedSkuDto"
              }
            ]
          }
        },
        "required": [
          "skuId",
          "quantity"
        ]
      },
      "PrintFarmOrderResponseDto": {
        "type": "object",
        "properties": {
          "order_id": {
            "type": "string",
            "example": "AP7K2M9X",
            "description": "Unique identifier for this order."
          },
          "status": {
            "type": "string",
            "example": "allocated",
            "description": "Current lifecycle stage of the order."
          },
          "designerName": {
            "type": "string",
            "example": "Jane Smith",
            "description": "Name of the designer who created the ordered design."
          },
          "customer": {
            "description": "Recipient contact and shipping address details.",
            "allOf": [
              {
                "$ref": "#/components/schemas/PrintFarmOrderCustomerDto"
              }
            ]
          },
          "extras": {
            "description": "Production requirements flagged for this order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/PrintFarmOrderExtrasDto"
              }
            ]
          },
          "tracking_number": {
            "type": "object",
            "example": "1Z999AA10123456784",
            "description": "Carrier tracking number, once the order has shipped.",
            "nullable": true
          },
          "courier": {
            "type": "object",
            "example": "ups",
            "description": "Name of the shipping carrier, populated alongside the tracking number.",
            "nullable": true
          },
          "external_order_id": {
            "type": "object",
            "example": "EXT-10492",
            "description": "Identifier of the order in an external system, when imported.",
            "nullable": true
          },
          "items": {
            "description": "Line items that make up this order.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmOrderItemDto"
            }
          },
          "customLabels": {
            "description": "Custom labels set by the seller, one entry per distinct product (listing) in this order that has a custom label. Print farms must print each label and include it with the corresponding product in the shipment. Empty when no product in the order has a custom label.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmOrderCustomLabelDto"
            }
          },
          "created_at": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-24T12:00:00.000Z",
            "description": "ISO 8601 timestamp of when this order was created."
          },
          "allocated_at": {
            "type": "object",
            "example": "2026-03-25T08:30:00.000Z",
            "description": "ISO 8601 timestamp of when this order was allocated to your print farm. The ship-by deadline is conventionally 5 days after this date. Null until the order is allocated.",
            "nullable": true
          }
        },
        "required": [
          "order_id",
          "status",
          "designerName",
          "customer",
          "extras",
          "items",
          "customLabels",
          "created_at"
        ]
      },
      "PrintFarmSkuDesignDto": {
        "type": "object",
        "properties": {
          "count": {
            "type": "number",
            "example": 1,
            "description": "Number of copies of this design included in the SKU."
          },
          "design_id": {
            "type": "string",
            "example": "dsg_kP4xT8aBnLf2sH9eY3jZ5dM7cR1vQbWtJ",
            "description": "Public identifier of the design (`dsg_…`)."
          },
          "materials": {
            "description": "Materials specified for this design.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmSkuDesignMaterialDto"
            }
          }
        },
        "required": [
          "count",
          "design_id",
          "materials"
        ]
      },
      "PrintFarmSkuDesignMaterialDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "example": "default",
            "description": "Either `default` (references a catalog material) or `custom` (designer-named)."
          },
          "material_id": {
            "type": "object",
            "example": "mat_jR6tN9pXq4sL8mB3dK7vH2cF5wYzA1ePsK",
            "description": "Public material identifier (`mat_…`) when `type` is `default`. Null for custom materials.",
            "nullable": true
          },
          "name": {
            "type": "object",
            "example": "Transparent Red PLA",
            "description": "Material name when `type` is `custom`.",
            "nullable": true
          }
        },
        "required": [
          "type"
        ]
      },
      "PrintFarmSkuExtraDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "xtr_mW2yH7cVjPq8rT5dN3kFx9eL4bA1uZcRh",
            "description": "Public identifier of the extra (`xtr_…`)."
          },
          "qty": {
            "type": "number",
            "example": 1,
            "description": "Quantity of this extra included."
          }
        },
        "required": [
          "id",
          "qty"
        ]
      },
      "PrintFarmSkuResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "sku_aB3xKp9wFqZ7vM2nLpHt12cN8jR3sLkPm",
            "description": "Opaque public identifier for this SKU (`sku_` prefix + 33 base62 chars). Use this value verbatim when referencing the SKU in other endpoints."
          },
          "name": {
            "type": "object",
            "example": "Dragon Figurine - Red PLA",
            "description": "Human-readable name of the SKU.",
            "nullable": true
          },
          "status": {
            "type": "string",
            "example": "active",
            "description": "Lifecycle status of the SKU.",
            "enum": [
              "active",
              "inactive",
              "deleted"
            ]
          },
          "code": {
            "type": "string",
            "example": "DRAGON-RED-PLA",
            "description": "Designer-defined code, unique within the designer."
          },
          "description": {
            "type": "object",
            "example": "Red PLA dragon figurine, 100mm tall.",
            "description": "Free-text description of the SKU.",
            "nullable": true
          },
          "designs": {
            "description": "Designs that make up this SKU.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmSkuDesignDto"
            }
          },
          "stocks": {
            "description": "Stocks this SKU participates in.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmSkuStockDto"
            }
          },
          "extras": {
            "description": "Extras attached to this SKU.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmSkuExtraDto"
            }
          },
          "customLabelUrl": {
            "type": "object",
            "example": "https://cdn.dapi.digital/labels/dragon-figurine.pdf",
            "description": "Public URL of the custom label set on the owning product (listing) for this SKU. May be an image or a PDF. Null when the product has no custom label.",
            "nullable": true
          }
        },
        "required": [
          "id",
          "status",
          "code",
          "designs",
          "stocks",
          "extras"
        ]
      },
      "PrintFarmSkuStockDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "stk_fL3sB8eYzKnQ7mX2dC9vR4tH6jW1uPbAcN",
            "description": "Public identifier of the stock this SKU is part of (`stk_…`)."
          },
          "enabled": {
            "type": "boolean",
            "example": true,
            "description": "Whether this SKU is currently enabled in the stock."
          }
        },
        "required": [
          "id",
          "enabled"
        ]
      },
      "PrintFarmStockDesignRefDto": {
        "type": "object",
        "properties": {
          "design_id": {
            "type": "string",
            "example": "dsg_kP4xT8aBnLf2sH9eY3jZ5dM7cR1vQbWtJ",
            "description": "Public identifier of the design (`dsg_…`)."
          },
          "count": {
            "type": "number",
            "example": 1,
            "description": "Number of copies of this design included per stock unit."
          }
        },
        "required": [
          "design_id",
          "count"
        ]
      },
      "PrintFarmStockLevelResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "slv_hG5dC2vKrPm8nT3sJ6yF1xL9bQ4wA7uZdF",
            "description": "Opaque public identifier for this stock-level row (`slv_` prefix + 33 base62 chars). Use this value verbatim when referencing the row in other endpoints."
          },
          "stock_id": {
            "type": "string",
            "example": "stk_fL3sB8eYzKnQ7mX2dC9vR4tH6jW1uPbAcN",
            "description": "Public identifier of the parent stock (`stk_…`)."
          },
          "stock_items_left": {
            "type": "number",
            "example": 11,
            "description": "Number of products remaining in this stock level."
          },
          "quantity": {
            "type": "number",
            "example": 4,
            "description": "Number of stocks bought (`quantity_purchased`). E.g. 4 means 4 stock-level rows were created."
          },
          "created_at": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-24T12:00:00.000Z",
            "description": "ISO 8601 timestamp of when this stock level was created."
          },
          "status": {
            "type": "string",
            "example": "pending",
            "description": "Lifecycle status of the stock level.",
            "enum": [
              "pending",
              "in_production",
              "completed",
              "consumed"
            ]
          },
          "stock_items_purchased": {
            "type": "number",
            "example": 48,
            "description": "Total number of products bought across this stock level. If `quantity = 4` and each stock holds 12 items, `stock_items_purchased = 48`."
          },
          "order_id": {
            "type": "object",
            "example": "ORD-001",
            "description": "Identifier of the order this stock level was created for. Null for proactive stock.",
            "nullable": true
          },
          "items_made": {
            "type": "number",
            "example": 0,
            "description": "Number of products produced so far."
          },
          "items_consumed": {
            "type": "number",
            "example": 0,
            "description": "Number of products consumed/shipped so far."
          }
        },
        "required": [
          "id",
          "stock_id",
          "stock_items_left",
          "quantity",
          "created_at",
          "status",
          "stock_items_purchased",
          "items_made",
          "items_consumed"
        ]
      },
      "PrintFarmStockRegionConfigDto": {
        "type": "object",
        "properties": {
          "region_id": {
            "type": "string",
            "example": "reg_dF8kP3xL6sV2nH9mT5cR1jY4bQ7wA9uZeM",
            "description": "Opaque public identifier of the print-farm region (`reg_…`). Encode-only - no endpoint currently consumes this id."
          },
          "price": {
            "type": "object",
            "example": "12.50",
            "description": "Manufacturer price for this stock in the given region. Authoritative per-region manufacturer price (the top-level `manufacturer_price` is deprecated).",
            "nullable": true
          }
        },
        "required": [
          "region_id"
        ]
      },
      "PrintFarmStockResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "stk_fL3sB8eYzKnQ7mX2dC9vR4tH6jW1uPbAcN",
            "description": "Opaque public identifier for this stock (`stk_` prefix + 33 base62 chars)."
          },
          "name": {
            "type": "string",
            "example": "Dragon Figurine Stock",
            "description": "Display name of the stock."
          },
          "description": {
            "type": "object",
            "example": "Pre-printed dragon figurines, batch of 48.",
            "description": "Free-text description of the stock.",
            "nullable": true
          },
          "stock_items_number": {
            "type": "number",
            "example": 48,
            "description": "Total number of stock items in this stock as defined by the designer."
          },
          "sales_price": {
            "type": "object",
            "example": "20.00",
            "description": "Authoritative aggregate sales price for the stock (designer-set, admin-approved).",
            "nullable": true
          },
          "approval_status": {
            "type": "string",
            "example": "approved",
            "description": "Approval lifecycle status (e.g. pending, approved, rejected)."
          },
          "design_list": {
            "description": "Designs included in this stock.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmStockDesignRefDto"
            }
          },
          "region_config": {
            "description": "Per-region configuration. Each entry exposes the manufacturer price for the region.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintFarmStockRegionConfigDto"
            }
          },
          "extra_parts_config": {
            "type": "object",
            "description": "Free-form extra parts configuration as stored on the stock."
          },
          "created_at": {
            "format": "date-time",
            "type": "string",
            "example": "2026-03-24T12:00:00.000Z",
            "description": "ISO 8601 timestamp of when this stock was created."
          },
          "updated_at": {
            "format": "date-time",
            "type": "string",
            "example": "2026-04-02T15:30:00.000Z",
            "description": "ISO 8601 timestamp of when this stock was last updated."
          },
          "approved_at": {
            "type": "object",
            "example": "2026-03-25T08:30:00.000Z",
            "description": "ISO 8601 timestamp of when this stock was approved. Null when not yet approved.",
            "nullable": true
          }
        },
        "required": [
          "id",
          "name",
          "stock_items_number",
          "approval_status",
          "design_list",
          "region_config",
          "created_at",
          "updated_at"
        ]
      },
      "UpdatePrintFarmOrderStatusBodyDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "New order status. `in_production` is allowed from `paid`; `shipping` is allowed from `in_production` (requires `tracking_number` + `courier`); `returned` is allowed from `shipping` or `completed` (no body fields required).",
            "enum": [
              "in_production",
              "shipping",
              "returned"
            ],
            "example": "shipping"
          },
          "tracking_number": {
            "type": "string",
            "description": "Shipping tracking number. Required when `status === \"shipping\"`. Persisted on the order and forwarded to the customer email + designer webhook.",
            "example": "1Z999AA10123456784"
          },
          "courier": {
            "type": "string",
            "description": "Carrier code from `GET /print-farm/courier-options` (e.g. `ups`, `fedex`). Required when `status === \"shipping\"`. When `courier === \"other\"`, also provide `courier_name` and we will flag the order for manual sync (we cannot push it to ShipStation automatically).",
            "example": "ups"
          },
          "courier_name": {
            "type": "string",
            "description": "Human-readable carrier name. Required when `courier === \"other\"`. Stored on the order as the courier value (since no machine code exists).",
            "example": "Local Courier Ltd"
          }
        },
        "required": [
          "status"
        ]
      },
      "UpdatePrintFarmOrderStatusResponseDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "in_production",
            "description": "The newly persisted order status."
          }
        },
        "required": [
          "status"
        ]
      }
    }
  }
}
