{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/3dpack-ing/json-schema/3dpack-ing-pack-result-schema.json",
  "title": "PackResult",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/3dpack-ing-openapi.json#/components/schemas/PackResult",
  "type": "object",
  "properties": {
    "containers": {
      "type": "array",
      "description": "One entry per container used. Empty if nothing could be packed.",
      "items": {
        "$ref": "#/$defs/PackedContainer"
      }
    },
    "unpackedItems": {
      "$ref": "#/$defs/Unpacked"
    },
    "linkToResult": {
      "type": "string",
      "format": "uri",
      "description": "An interactive 3D load plan. Opens without an account; the recipient can rotate the load, drag items and export the plan."
    }
  },
  "$defs": {
    "Dimensions": {
      "type": "object",
      "description": "Internal dimensions, in the unit the request used.",
      "properties": {
        "length": {
          "type": "number",
          "format": "double"
        },
        "width": {
          "type": "number",
          "format": "double"
        },
        "height": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "EmptyPocket": {
      "type": "object",
      "description": "A rectilinear free-space pocket. Pocket dimensions and coordinates use the unit inferred from the request.",
      "required": [
        "length",
        "width",
        "height",
        "x",
        "y",
        "z"
      ],
      "properties": {
        "length": {
          "type": "number",
          "format": "double"
        },
        "width": {
          "type": "number",
          "format": "double"
        },
        "height": {
          "type": "number",
          "format": "double"
        },
        "x": {
          "type": "number",
          "format": "double"
        },
        "y": {
          "type": "number",
          "format": "double"
        },
        "z": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "PackedContainer": {
      "type": "object",
      "properties": {
        "containerDims": {
          "$ref": "#/$defs/Dimensions"
        },
        "totalQuantity": {
          "type": "integer",
          "description": "Boxes placed in this container."
        },
        "itemQuantities": {
          "type": "object",
          "description": "Placed count per item name.",
          "additionalProperties": {
            "type": "integer"
          }
        },
        "volumeUsage": {
          "type": "number",
          "format": "double",
          "description": "Percentage of the container's volume occupied."
        },
        "weightUsage": {
          "type": "number",
          "format": "double",
          "description": "Percentage of the container's weight limit used. 0 when no weights were given."
        },
        "emptyPockets": {
          "type": "array",
          "description": "Up to five of the largest rectilinear free-space pockets. Pockets overlap and their volumes must not be summed.",
          "items": {
            "$ref": "#/$defs/EmptyPocket"
          }
        },
        "emptyPocketsNote": {
          "type": "string",
          "description": "A reminder that the free-space pockets overlap and how to interpret them."
        },
        "items": {
          "type": "array",
          "description": "Every packed item and its placement. Present only when the `coordinates` query parameter is included.",
          "items": {
            "$ref": "#/$defs/PackedItem"
          }
        }
      }
    },
    "PackedItem": {
      "type": "object",
      "description": "One placed item. Dimensions and coordinates use the unit inferred from the request; dimensions reflect the packed orientation.",
      "required": [
        "name",
        "length",
        "width",
        "height",
        "x",
        "y",
        "z"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The item name parsed from the shipment description."
        },
        "length": {
          "type": "number",
          "format": "double"
        },
        "width": {
          "type": "number",
          "format": "double"
        },
        "height": {
          "type": "number",
          "format": "double"
        },
        "x": {
          "type": "number",
          "format": "double",
          "description": "X coordinate of the item's corner."
        },
        "y": {
          "type": "number",
          "format": "double",
          "description": "Y coordinate of the item's corner."
        },
        "z": {
          "type": "number",
          "format": "double",
          "description": "Z coordinate of the item's corner."
        }
      }
    },
    "Unpacked": {
      "type": "object",
      "description": "What did not fit. A non-zero total on a 200 means the cargo needs more or larger containers, not that the request failed.",
      "properties": {
        "total": {
          "type": "integer"
        },
        "breakdown": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    }
  }
}